PyQt5: chapter10-使用Matplotlib绘制直线

将使用matplotlib.pyplot的以下方法

  • title():此方法用于设置图形的标题              
  • xlabel():此方法用于沿x轴显示特定文本              
  • ylabel():此方法用于沿y轴显示特定文本              
  • plot():此方法用于在指定的x和y坐标绘制

创建demoPlotLine.py文件

import matplotlib.pyplot as graph
graph.title('Plotting a Line!')
graph.xlabel('x - axis')
graph.ylabel('y - axis')
x = [10,20,30]
y = [20,40,60]
graph.plot(x, y)
graph.show()

猜你喜欢

转载自blog.csdn.net/weixin_43307431/article/details/105982218
今日推荐