为什么有些人说matlab被禁影响没有那么大
因为大部分基础绘图Python中的matplotlib模块完美胜任
1.draw a line
import matplotlib.pyplot as plt #use pyplot to draw
import numpy as np #admin
x=np.linspace(-1,1,50)#random points np.linspace(range1,range2,number)
y=2*x+1
plt.plot(x,y)
plt.show()#draw
2.draw multiple figures with customized style
import matplotlib.pyplot as plt
import numpy as np
x=np.linspace(-3,3,50)
y1=2*x+1
y2=x**2
plt.figure()#draw the first figure
plt.plot(x,y1)
plt.figure(num="fucking name",figsize=(8,5))#num=define the title of the figure
plt.plot(x,y2)#draw the second figure
plt.plot(x,y1,color="red",linewidth=5.0,linestyle="--")#draw two lines in figure"fucking name"
plt.show
3.改变坐标轴的形式 并画图例( upperleft upper right lower right/left best 都是地址)
plt.plot(x,y2,label="up")#draw the second figure
plt.plot(x,y1,color="red",linewidth=5.0,linestyle="--",label="down")#draw two lines in figure"fucking name"
plt.legend(handles=[],labels=[],loc="best")#打出图例
4.add annotation添加注解
plt.annotate(r"$你想要的名字%s$"%y0,xy=(x