matplotlib.pyplot.figure()–最容易被忽略的一些参数,但是很常用!
; matplotlib.pyplot.figure (常用 plt.figure())
matplotlib.pyplot.figure(num=None,figsize=None,dpi=None,facecolor=None,edgecolor=None,frameon=True,FigureClass=
Parameters:
- num:int or str or Figure,optional (一般不常用)
- figsize:(float,float) 图像大小 (宽,高)
- dpi:float,默认值100,分辨率,保证图片的清晰度
- facecolor:color,默认 ‘white’ 背景颜色
- edgecolor:color,默认’white’,边框颜色
- clear:bool ,默认False. 如果为True并且该图形已经存在,则将其清除
一般使用以上参数即可,其他参数不常用。
例: plt.figure(figsize=(10,5),dpi=600,facecolor='white',edgecolor='white')
Original: https://blog.csdn.net/weixin_50918736/article/details/125833711
Author: 想成为风筝
Title: matplotlib.pyplot.figure()–最容易被忽略的一些参数,但是很常用!
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/766889/
转载文章受原作者版权保护。转载请注明原作者出处!