class matplotlib.figure.Figure

class matplotlib.figure.Figure(figsize=None, dpi=None, facecolor=None, edgecolor=None, linewidth=0.0, frameon=None, subplotpars=None, tight_layout=None)
Bases: matplotlib.artist.Artist

属性描述
patchThe figure patch is drawn by a matplotlib.patches.Rectangle instance
suppressCompositeFor multiple figure images, the figure will make composite images depending on the renderer option_image_nocomposite function. If suppressComposite is True
figsize宽度和高度w,h tuple in inches
dpiDots per inch
facecolor背景色The figure patch facecolor; defaults to rc figure.facecolor
edgecolor边缘色The figure patch edge color; defaults to rc figure.edgecolor
linewidthThe figure patch edge linewidth; the default linewidth of the frame
frameonIf False, suppress drawing the figure frame
subplotparsA SubplotParams instance, defaults to rc
tight_layout
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
函数matplotlib.pyplot.bar()是用来绘制垂直条形图的。它的函数签名为matplotlib.pyplot.bar(x, height, width=0.8, bottom=None, *, align='center', data=None, **kwargs)。在这个函数中,x表示条形图的位置,height表示每个条形图的高度,width表示条形图的宽度,默认为0.8。bottom表示条形图的基线位置,align表示条形图的对齐方式(默认为'center')。data参数可以传入一个DataFrame或一个类似数组的数据对象。其他的参数可以用来设置条形图的颜色、边框颜色、线宽等。如果你想绘制简单的水平条形图,你可以使用面向对象编程的方式,例如:import matplotlib.pyplot as plt import numpy as np plt.figure(figsize=(5,5)) ax=plt.axes() x=np.arange(0,6) y=np.random.random(6) ax.barh(x,y) plt.show()<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [matplotlib之pyplot模块之柱状图(bar():基础参数、外观参数)](https://blog.csdn.net/mighty13/article/details/113869911)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *2* [matplotlib.pyplot.bar()与barh()绘制条形图](https://blog.csdn.net/Yangyuqing_/article/details/124180245)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值