python3实现绘制⼆维点图如下所⽰:
import matplotlib.pyplot as plt
plt.plot([1,2,3],[4,5,6],'ro')
python在线编辑器python3plt.show()#这个智障的编辑器,,,看来⾼版本的确修复了⼀些bug
⽤python3的qt5出来的图形,效果很好:
⽽且在上⾯的图像中也可以⽤调整按钮进⾏适当的调整。
下⾯我们直接⽤代码进⾏坐标的调整:
import matplotlib.pyplot as plt
plt.xlim(xmax=7,xmin=0)
plt.ylim(ymax=7,ymin=0)
cursor:pointer怎么用
plt.plot([1,2,3],[4,5,6],'ro')
plt.show()
下⾯加⼀个标题,叫做散点图import matplotlib.pyplot as plt
plt.title("I'm a scatter diagram.") plt.xlim(xmax=7,xmin=0)
plt.ylim(ymax=7,ymin=0)
plt.plot([1,2,3],[4,5,6],'ro')
plt.show()
给xy轴进⾏命名
import matplotlib.pyplot as plt plt.title("I'm a scatter diagram.") plt.xlim(xmax=7,xmin=0)
plt.ylim(ymax=7,ymin=0)
plt.xlabel("x")
plt.ylabel("y")
前端用ps切图
plt.plot([1,2,3],[4,5,6],'ro')
plt.show()
加⼀个标注:
import matplotlib.pyplot as plt
plt.title("I'm a scatter diagram.")
plt.xlim(xmax=7,xmin=0)
plt.ylim(ymax=7,ymin=0)
plt.annotate("(3,6)", xy = (3, 6), xytext = (4, 5), arrowprops = dict(facecolor = 'black', shrink = 0.1)) plt.xlabel("x")
plt.ylabel("y")
plt.plot([1,2,3],[4,5,6],'ro')
plt.show()
多画⼏个图:
import matplotlib.pyplot as plt plt.subplot(221)
sqlite appplt.xlim(xmax=7,xmin=0) plt.ylim(ymax=7,ymin=0) plt.xlabel("x")
plt.ylabel("y")
plt.plot([1,2,3],[4,5,6],'ro') plt.subplot(222)
plt.xlim(xmax=7,xmin=0) plt.ylim(ymax=7,ymin=0) plt.xlabel("x")
plt.ylabel("y")
plt.plot([1,2,3],[4,5,6],'ro') plt.subplot(223)
plt.xlim(xmax=7,xmin=0) plt.ylim(ymax=7,ymin=0) plt.xlabel("x")
plt.ylabel("y")
什么编程软件适合初学者plt.plot([1,2,3],[4,5,6],'ro') plt.show()html超链接之间的空格

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。