Matplotlib 简明教程
Matplotlib - Anaconda Distribution
Библиотека Matplotlib - это широко используемая библиотека построения графиков в Python, и она обычно входит в дистрибутив Anaconda.
Matplotlib library is a widely-used plotting library in Python and it is commonly included in the Anaconda distribution.
What is Anaconda Distribution?
Anaconda - это дистрибутив Python и других пакетов с открытым исходным кодом, который стремится упростить процесс настройки среды Python для науки о данных, машинного обучения и научных вычислений.
Anaconda is a distribution of Python and other open-source packages that aims to simplify the process of setting up a Python environment for data science, machine learning and scientific computing.
可以在 https://www.anaconda.com/download/. 处下载 Anaconda 发行版以进行安装。对于在 Windows 中进行安装,有 32 位和 64 位二进制文件可用−
Anaconda distribution is available for installation at https://www.anaconda.com/download/. For installation on Windows, 32 and 64 bit binaries are available −
安装是一个非常简单的基于向导的过程。可以选择将 Anaconda 添加至 PATH 变量或将 Anaconda 注册为默认 Python。
Installation is a fairly straightforward wizard based process. You can choose between adding Anaconda in PATH variable and registering Anaconda as your default Python.
对于在 Linux 中进行安装,请从下载页面下载 32 位和 64 位安装程序 −
For installation on Linux, download installers for 32 bit and 64 bit installers from the downloads page −
现在,从 Linux 终端运行以下命令 −
Now, run the following command from the Linux terminal −
Syntax
$ bash Anaconda3-5.0.1-Linux-x86_64.sh
Canopy 和 ActiveState 是 Windows、macOS 和 Linux 常用平台的最佳选择。Windows 用户可以在 WinPython 中找到一项选项。
Canopy and ActiveState are the most sought after choices for Windows, macOS and common Linux platforms. The Windows users can find an option in WinPython.
以下是 Matplotlib 怎样通常与 Anaconda 发行版相关联:
Here is how Matplotlib is typically associated with the Anaconda distribution:
Matplotlib in Anaconda
Pre-Installed
Matplotlib 库通常包含在 Anaconda 发行版的默认安装中。当我们安装 Anaconda 时,Matplotlib 与许多其他必要的可视化数据的库一同可用。
Matplotlib library is often included in the default installation of the Anaconda distribution. When we install Anaconda Matplotlib is available along with many other essential libraries for data visualization.
Integration with Jupyter
Anaconda 附带 Jupyter Notebook,它是一种流行的交互式计算环境。Matplotlib 无缝地与 Jupyter 集成,让我们在 Jupyter Notebooks 中轻松创建和可视化绘图。
Anaconda comes with Jupyter Notebook which is a popular interactive computing environment. Matplotlib seamlessly integrates with Jupyter and makes our work easy to create and visualize plots within Jupyter Notebooks.
Anaconda Navigator
Anaconda Navigator 是 Anaconda 发行版附带的图形用户界面。它允许用户管理环境、安装程序包并启动应用程序。它提供了一种访问和启动用于 Matplotlib 绘图的 Jupyter Notebooks 的简单方法。
Anaconda Navigator is a graphical user interface that comes with the Anaconda distribution. This allows users to manage environments, install packages and launch applications. It provides an easy way to access and launch Jupyter Notebooks for Matplotlib plotting.
Conda Package Manager
Anaconda 使用“conda”程序包管理器,该管理器简化了 Python 程序包的安装、更新和管理。我们可以使用‘conda’在 Anaconda 环境中安装或更新 Matplotlib。
Anaconda uses the 'conda' package manager which simplifies the installation, updating and managing of Python packages. We can use 'conda' to install or update Matplotlib within our Anaconda environment.
Verifying Matplotlib Installation
要验证是否在 Anaconda 环境中安装了 Matplotlib,我们可以使用以下步骤。
To verify whether Matplotlib is installed in our Anaconda environment we can use the following steps.
-
Open the Anaconda Navigator.
-
Navigate to the "Envinornments" tab.
-
Look for "Matplotlib" in the list of installed packages. If it’s there Matplotlib is installed.
-
Alternatively we can open Anaconda Prompt or a terminal and run the below mentioned code
Installing or Updating Matplotlib in Anaconda
如果未安装 Matplotlib 或我们要更新它,则可以在 Anaconda Prompt 或终端中使用以下命令。
If Matplotlib is not installed or we want to update it then we can use the following commands in the Anaconda Prompt or terminal.
To install Matplotlib
conda install matplotlib
由于 matplotlib 已安装在系统中,因此它显示了所有请求的程序包已安装的消息。
As the matplotlib is already installed in the system it’s shown the message the All requested packages already installed.
To update Matplotlib
conda update matplotlib
上述命令将管理我们 Anaconda 环境中 Matplotlib 及其依赖项的安装或更新。
The above mentioned commands will manage the installation or update of Matplotlib and its dependencies in our Anaconda environment.
最后我们可以说,Matplotlib 是 Anaconda 发行版的基本部分,它使用户能够在 python 环境中方便地创建高质量的可视化,用于数据分析和科学计算。
Finally we can say Matplotlib is a fundamental part of the Anaconda distribution making it convenient for users to create high-quality visualizations in their Python environments for data analysis and scientific computing.