Python学习记录

    xiaoxiao2022-06-24  175

    matplotlib

    https://blog.51cto.com/12731497/2154195 代码:

    import matplotlib.pyplot as plt squares = [1, 4, 9, 16, 25] plt.plot(squares, linewidth=5) plt.title("Square Numbers", fontsize=24) plt.xlabel("Value", fontsize=14) plt.ylabel("Square of Value", fontsize=14) plt.tick_params(axis='both', labelsize=14) plt.show()

    问题:

    ImportError: No module named matplotlib.pyplot

    解决:

    不再使用pip安装matplotlib 使用 pip uninstall matplotlib,卸载已经安装的matlplotlib 再使用 sudo apt-get install python-matplotlib 安装

    最新回复(0)