matplotlib之figure大小的改变

plt.figure()  括号里是可以加参数实现 图表大小的改变的

plt.figure(figsize=(5,3)) #图像大小

bins1 = np.linspace(0, 15, 6) #横坐标起始和结束值,分割成 5 份  分割成 5 份,
plt.xticks(bins1) #设置x轴
plt.xlim(0, 15) #x轴开始和结束位置

bins2 = np.linspace(0, 9, 4) #横坐标起始和结束值,分割成 4份,
plt.yticks(bins2) #设置x轴
plt.ylim(0, 9) #x轴开始和结束位置
plt.show()

(80条消息)matplotlib (mplot3d) - 怎样拉伸/缩短坐标轴的长度_Python_qq_26443737的专栏-CSDN博客
https://blog.csdn.net/qq_26443737/article/details/82693387

(80条消息)plt.plot()的使用方法以及参数介绍_Python_我是小蚂蚁-CSDN博客
https://blog.csdn.net/missyougoon/article/details/90399938

(80条消息)plt.plot()函数解析(最清晰的解释)_Python_种树最好的时间是10年前,其次是现在!!!-CSDN博客
https://blog.csdn.net/tefuirnever/article/details/99672296

(80条消息)python 画图plot画图时数据太多,图看起来不好看。请问怎么拉长X轴,或者增加每个点之间的间隔-CSDN问答
https://ask.csdn.net/questions/1050619

发布了241 篇原创文章 · 获赞 54 · 访问量 13万+

猜你喜欢

转载自blog.csdn.net/txpp520/article/details/105656669