Pandas.plot()画图方法

转自:https://blog.csdn.net/claroja/article/details/73872066?utm_source=debugrun&utm_medium=referral

 

Series

Series.plot(kind=’line’, ax=None, figsize=None, use_index=True, title=None, grid=None, legend=False, style=None, logx=False, logy=False, loglog=False, xticks=None, yticks=None, xlim=None, ylim=None, rot=None, fontsize=None, colormap=None, table=False, yerr=None, xerr=None, label=None, secondary_y=False, **kwds)
参数:

参数描述
dataSeries
kindstr:”line”,”bar”,”barh”,”hist”,”box”,”kde”,”density”,”area”,”pie”
axmatplotlib axes 对象,默认使用gca()
figsizetuple(宽度,高度),单位是英寸
use_indexboolean,默认为True,使用索引作为刻度标签
titlestring or list,传入str直接在figure上打印,传入list则会打印在subplot上
gridboolean,默认为None,使用matlab样式
legendFalse/True/”reverse”
stylelist or dict,matplotlib line style per column
logxboolean,默认False,x轴使用log刻度
logyboolean,默认False,y轴使用log刻度
xtickssequence,x轴刻度标签
ytickssequence,y轴刻度标签
xlim2-tuple/list
ylim2-tuple/list
rotint 默认为None,改变刻度标签的旋转度
fontsizeint 默认为None,设置刻度标签的大小
colormapstr or matplotlib colromap对象 默认为None
colorbarboolean,optional,如果为True绘制colorbar(只有在scatter和hexbin中起作用)
positionfloat,Specify relative alignments for bar plot layout. From 0 (left/bottom-end) to 1 (right/top-end). Default is 0.5 (center)
layouttuple(optional),(rows, columns) for the layout of the plot
tableboolean,Series or DataFrame 默认为False,If True, draw a table using the data in the DataFrame and the data will be transposed to meet matplotlib’s default layout. If a Series or DataFrame is passed, use passed data to draw a table.
yerrDataFrame,Series,array-like,dict and str,See Plotting with Error Bars for detail.
xerr 
lablelabel argument to provide to plot
secondary_yboolean or sequence of ints, default False
mark_rightboolean, default True
kwdskeywords,Options to pass to matplotlib plotting method

DataFrame

DataFrame.plot(x=None, y=None, kind=’line’, ax=None, subplots=False, sharex=None, sharey=False, layout=None, figsize=None, use_index=True, title=None, grid=None, legend=True, style=None, logx=False, logy=False, loglog=False, xticks=None, yticks=None, xlim=None, ylim=None, rot=None, fontsize=None, colormap=None, table=False, yerr=None, xerr=None, secondary_y=False, sort_columns=False, **kwds)

参数描述
dataDataFrame
xlabel or position, default None
ylabel or position, default None
kindstr:‘scatter’,‘hexbin’
subplotsboolean, default False,为每一列单独画一个子图
sharexboolean, default True if ax is None else False
shareyboolean, default False
loglogboolean, default False,x轴/y轴同时使用log刻度

tips:
可以先用plt.figure()新建一个画板,然后再用pandas里面的做图命令,这样就可以修改pandas的图。

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值