pylab和pyplot的区别

Pylab combines the functionality of pyplot with the capabilities of NumPy in a single namespace, and therefore you do not need to import NumPy separately. Furthermore, if you import pylab, pyplot, and NumPy functions can be called directly without any reference to a module (namespace), making the environment more similar to Matlab.

使用pylab

from pylab import *
...
plot(x,y)
array([1,2,3,4])

使用pyplot

import matplotlib.pyplot as plt
import numpy as np
...
plt.plot()
np.array([1,2,3,4])
posted @ 2017-07-02 17:45  2021年的顺遂平安君  阅读(1410)  评论(0编辑  收藏  举报