Pandas繪圖

學(xué)習(xí)pandas數(shù)據(jù)框的繪圖轧钓,輕松搞定各種圖畫法版确。

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)
Parameters:
data : DataFrame
x : label or position, default None#指數(shù)據(jù)框列的標(biāo)簽或位置參數(shù)
y : label or position, default None
Allows plotting of one column versus another

kind : str
‘line’ : line plot (default)#折線圖
‘bar’ : vertical bar plot#條形圖
‘barh’ : horizontal bar plot#橫向條形圖
‘hist’ : histogram#柱狀圖
‘box’ : boxplot#箱線圖
‘kde’ : Kernel Density Estimation plot#Kernel 的密度估計(jì)圖麸塞,主要對(duì)柱狀圖添加Kernel 概率密度線
‘density’ : same as ‘kde’
‘a(chǎn)rea’ : area plot#不了解此圖
‘pie’ : pie plot#餅圖
‘scatter’ : scatter plot#散點(diǎn)圖
‘hexbin’ : hexbin plot#不了解此圖

ax : matplotlib axes object, default None#一個(gè)圖片切成不同片段休蟹,子圖對(duì)象
subplots : boolean, default False#判斷圖片中是否有子圖
Make separate subplots for each column

sharex : boolean, default True if ax is None else False#如果有子圖者冤,子圖共x軸刻度兴垦,標(biāo)簽
In case subplots=True, share x axis and set some x axis labels to invisible; defaults to True if ax is None otherwise False if an ax is passed in; Be aware, that passing in both an ax and sharex=True will alter all x axis labels for all axis in a figure!

sharey : boolean, default False#如果有子圖徙赢,子圖共y軸刻度,標(biāo)簽
In case subplots=True, share y axis and set some y axis labels to invisible

layout : tuple (optional)#子圖的行列布局
(rows, columns) for the layout of subplots

figsize : a tuple (width, height) in inches#圖片尺寸大小
use_index : boolean, default True#默認(rèn)用索引做x軸
Use index as ticks for x axis

title : string#圖片的標(biāo)題用字符串
Title to use for the plot

grid : boolean, default None (matlab style default)#圖片是否有網(wǎng)格
Axis grid lines

legend : False/True/’reverse’#子圖的圖例
Place legend on axis subplots

style : list or dict#對(duì)每列折線圖設(shè)置線的類型
matplotlib line style per column

logx : boolean, default False#設(shè)置x軸刻度是否取對(duì)數(shù)
Use log scaling on x axis

logy : boolean, default False
Use log scaling on y axis

loglog : boolean, default False#同時(shí)設(shè)置x探越,y軸刻度是否取對(duì)數(shù)
Use log scaling on both x and y axes

xticks : sequence#設(shè)置x軸刻度值狡赐,序列形式(比如列表)
Values to use for the xticks

yticks : sequence#設(shè)置y軸刻度,序列形式(比如列表)
Values to use for the yticks

xlim : 2-tuple/list#設(shè)置坐標(biāo)軸的范圍钦幔,列表或元組形式
ylim : 2-tuple/list
rot : int, default None#設(shè)置軸標(biāo)簽(軸刻度)的顯示旋轉(zhuǎn)度數(shù)
Rotation for ticks (xticks for vertical, yticks for horizontal plots)

fontsize : int, default None#設(shè)置軸刻度的字體大小
Font size for xticks and yticks

colormap : str or matplotlib colormap object, default None#設(shè)置圖的區(qū)域顏色
Colormap to select colors from. If string, load colormap with that name from matplotlib.

colorbar : boolean, optional
If True, plot colorbar (only relevant for ‘scatter’ and ‘hexbin’ plots)

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, default 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 : same types as yerr.
stacked : boolean, default False in line and
bar plots, and True in area plot. If True, create stacked plot.

sort_columns : boolean, default False
Sort column names to determine plot ordering

secondary_y : boolean or sequence, default False
Whether to plot on the secondary y-axis If a list/tuple, which columns to plot on secondary y-axis

mark_right : boolean, default True
When using a secondary_y axis, automatically mark the column labels with “(right)” in the legend

kwds : keywords
Options to pass to matplotlib plotting method

Returns:axes* : matplotlib.AxesSubplot or np.array of them*

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末枕屉,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子鲤氢,更是在濱河造成了極大的恐慌搀擂,老刑警劉巖,帶你破解...
    沈念sama閱讀 222,681評(píng)論 6 517
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件卷玉,死亡現(xiàn)場離奇詭異哨颂,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)相种,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,205評(píng)論 3 399
  • 文/潘曉璐 我一進(jìn)店門威恼,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事沃测$郧” “怎么了?”我有些...
    開封第一講書人閱讀 169,421評(píng)論 0 362
  • 文/不壞的土叔 我叫張陵蒂破,是天一觀的道長馏谨。 經(jīng)常有香客問我,道長附迷,這世上最難降的妖魔是什么惧互? 我笑而不...
    開封第一講書人閱讀 60,114評(píng)論 1 300
  • 正文 為了忘掉前任,我火速辦了婚禮喇伯,結(jié)果婚禮上喊儡,老公的妹妹穿的比我還像新娘。我一直安慰自己稻据,他們只是感情好艾猜,可當(dāng)我...
    茶點(diǎn)故事閱讀 69,116評(píng)論 6 398
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著捻悯,像睡著了一般匆赃。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上今缚,一...
    開封第一講書人閱讀 52,713評(píng)論 1 312
  • 那天算柳,我揣著相機(jī)與錄音,去河邊找鬼姓言。 笑死瞬项,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的何荚。 我是一名探鬼主播囱淋,決...
    沈念sama閱讀 41,170評(píng)論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼餐塘!你這毒婦竟也來了妥衣?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 40,116評(píng)論 0 277
  • 序言:老撾萬榮一對(duì)情侶失蹤唠倦,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后涮较,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體稠鼻,經(jīng)...
    沈念sama閱讀 46,651評(píng)論 1 320
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,714評(píng)論 3 342
  • 正文 我和宋清朗相戀三年狂票,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了候齿。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,865評(píng)論 1 353
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖慌盯,靈堂內(nèi)的尸體忽然破棺而出周霉,到底是詐尸還是另有隱情,我是刑警寧澤亚皂,帶...
    沈念sama閱讀 36,527評(píng)論 5 351
  • 正文 年R本政府宣布俱箱,位于F島的核電站,受9級(jí)特大地震影響灭必,放射性物質(zhì)發(fā)生泄漏狞谱。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,211評(píng)論 3 336
  • 文/蒙蒙 一禁漓、第九天 我趴在偏房一處隱蔽的房頂上張望跟衅。 院中可真熱鬧,春花似錦播歼、人聲如沸伶跷。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,699評(píng)論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽叭莫。三九已至,卻和暖如春谒撼,著一層夾襖步出監(jiān)牢的瞬間食寡,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,814評(píng)論 1 274
  • 我被黑心中介騙來泰國打工廓潜, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留抵皱,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 49,299評(píng)論 3 379
  • 正文 我出身青樓辩蛋,卻偏偏與公主長得像呻畸,于是被迫代替她去往敵國和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子悼院,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,870評(píng)論 2 361

推薦閱讀更多精彩內(nèi)容

  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理伤为,服務(wù)發(fā)現(xiàn),斷路器据途,智...
    卡卡羅2017閱讀 134,716評(píng)論 18 139
  • acorr(x, hold=None, data=None, **kwargs) 繪制x的自相關(guān)圖像 angle_...
    shuhanrainbow閱讀 824評(píng)論 0 0
  • 中文翻譯 ng help ng build 構(gòu)建您的應(yīng)用程序并將其放入輸出路徑(dist /默認(rèn)情況下)绞愚。 別名:...
    4ea0af17fd67閱讀 2,043評(píng)論 0 0
  • Series繪制序列圖dta=pd.Series(map(lambda x: x.value ,data[1]),...
    Epiphanyyaoyao閱讀 258評(píng)論 0 1
  • 小蘭對(duì)民謠的認(rèn)知位衩,是從溫先生開始的。在認(rèn)識(shí)溫先生之前熔萧,小蘭是個(gè)只會(huì)聽陳綺貞和張懸的偽民謠愛好者糖驴,以為小眾音樂就是民...
    張善良_閱讀 610評(píng)論 0 0