matplotlib figure change

plt.figure () in parentheses can add parameters to change the size of the chart

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 messages) matplotlib (mplot3d)-how to stretch / shorten the length of the coordinate axis_Python_qq_26443737 column-CSDN blog
https://blog.csdn.net/qq_26443737/article/details/82693387

(80 messages) usage of plt.plot () and parameter introduction_Python_ 我 是 小 蚁 -CSDN blog
https://blog.csdn.net/missyougoon/article/details/90399938

(80 messages) plt.plot () function analysis (the clearest explanation) _Python_ the best time to plant trees is 10 years ago, followed by now! ! ! -CSDN blog
https://blog.csdn.net/tefuirnever/article/details/99672296

(80 messages) python plot drawing too much data when drawing, the picture looks ugly. Ask how elongated X-axis, or increase the interval between each point Q -CSDN
https://ask.csdn.net/questions/1050619

 

 

Published 241 original articles · praised 54 · 130,000 visits +

Guess you like

Origin blog.csdn.net/txpp520/article/details/105656669