Matplotlib 安装

本页内容
上一节: Matplotlib_教程 下一节: Matplotlib_Pyplot

Matplotlib 安装

本章节,我们使用 pip 工具来安装 Matplotlib 库,如果还未安装该工具,可以参考 Python pip 安装与使用

升级 pip:


示例

python3 -m pip install -U pip

安装 matplotlib 库:


示例

python3 -m pip install -U matplotlib

安装完成后,我们就可以通过 import 来导入 matplotlib 库:


示例

import matplotlib

以下实例,我们通过导入 matplotlib 库,然后查看 matplotlib 库的版本号:


示例

import matplotlib

print(matplotlib.__version__)

执行以上代码,输出结果如下:


示例

3.4.2
上一节: Matplotlib_教程 下一节: Matplotlib_Pyplot
此页面最后编辑于2022年8月17日 (星期三) 21:54。