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)
參數:

參數 描述
data Series
kind str:”line”,”bar”,”barh”,”hist”,”box”,”kde”,”density”,”area”,”pie”
ax matplotlib axes 對象,默認使用gca()
figsize tuple(寬度,高度),單位是英寸
use_index boolean,默認爲True,使用索引作爲刻度標籤
title string or list,傳入str直接在figure上打印,傳入list則會打印在subplot上
grid boolean,默認爲None,使用matlab樣式
legend False/True/”reverse”
style list or dict,matplotlib line style per column
logx boolean,默認False,x軸使用log刻度
logy boolean,默認False,y軸使用log刻度
xticks sequence,x軸刻度標籤
yticks sequence,y軸刻度標籤
xlim 2-tuple/list
ylim 2-tuple/list
rot int 默認爲None,改變刻度標籤的旋轉度
fontsize int 默認爲None,設置刻度標籤的大小
colormap str or matplotlib colromap對象 默認爲None
colorbar boolean,optional,如果爲True繪製colorbar(只有在scatter和hexbin中起作用)
position float,Specify relative alignments for bar plot layout. From 0 (left/bottom-end) to 1 (right/top-end). Default is 0.5 (center)
layout tuple(optional),(rows, columns) for the layout of the plot
table boolean,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.
yerr DataFrame,Series,array-like,dict and str,See Plotting with Error Bars for detail.
xerr  
lable label argument to provide to plot
secondary_y boolean or sequence of ints, default False
mark_right boolean, default True
kwds keywords,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)

參數 描述
data DataFrame
x label or position, default None
y label or position, default None
kind str:‘scatter’,‘hexbin’
subplots boolean, default False,爲每一列單獨畫一個子圖
sharex boolean, default True if ax is None else False
sharey boolean, default False
loglog boolean, default False,x軸/y軸同時使用log刻度

tips:
可以先用plt.figure()新建一個畫板,然後再用pandas裏面的做圖命令,這樣就可以修改pandas的圖。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章