尝试用python3画图。出错,试错,还是没修好。
安装matplotlib后,运行:
"""
========================
A more complex fill demo
========================
In addition to the basic fill plot, this demo shows a few optional features:
* Multiple curves with a single command.
* Setting the fill color.
* Setting the opacity (alpha value).
"""
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 2 * np.pi, 500)
y1 = np.sin(x)
y2 = np.sin(3 * x)
fig, ax = plt.subplots()
ax.fill(x, y1, 'b', x, y2, 'r', alpha=0.3)
plt.show()
报错ModuleNotFoundError: No module named ‘matplotlib._image’
尝试解决。
检查安装包是否成功安装,
pip3 install matplotlib