3.8

涓婄骇 883abde3
# 3.8 灞忓箷鎴浘
> 鍘熸枃锛歔Screenshots](http://matplotlib.org/users/screenshots.html)
> 璇戣咃細[椋為緳](https://github.com/)
> 鍗忚锛歔CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/)
杩欓噷浣犱細鎵惧埌涓浜涚ず渚嬪浘鍜岀敓鎴愬畠浠殑浠g爜銆
## 绠鍗曠粯鍥
杩欓噷鏄竴涓甫鏈夋枃鏈爣绛剧殑鍩烘湰鐨勭粯鍥撅細
[婧愪唬鐮](http://matplotlib.org/mpl_examples/pylab_examples/simple_plot.py)
![](http://matplotlib.org/_images/simple_plot1.png)
## 瀛愬浘绀轰緥
澶氫釜杞村煙锛堜緥濡傚瓙鍥撅級鍙娇鐢`subplot()`鍛戒护鍒涘缓锛
[婧愪唬鐮](http://matplotlib.org/mpl_examples/subplots_axes_and_figures/subplot_demo.py)
![](http://matplotlib.org/_images/subplot_demo3.png)
## 鐩存柟鍥
`hist()`鍛戒护鑷姩鐢熸垚鐩存柟鍥撅紝骞惰繑鍥為」鏁版垨鑰呮鐜囷細
[婧愪唬鐮](http://matplotlib.org/mpl_examples/statistics/histogram_demo_features.py)
![](http://matplotlib.org/_images/histogram_demo_features2.png)
## 璺緞绀轰緥
浣犲彲浠ヤ娇鐢` matplotlib.path`妯″潡锛屽湪`maplotlib`涓坊鍔犱换鎰忚矾寰勶細
[婧愪唬鐮](http://matplotlib.org/mpl_examples/shapes_and_collections/path_patch_demo.py)
![](http://matplotlib.org/_images/path_patch_demo1.png)
## mplot3d
mplot3d 宸ュ叿鍖咃紙瑙 [mplot3d 鏁欑▼](http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html#toolkit-mplot3d-tutorial)[mplot3d 绀轰緥](http://matplotlib.org/examples/mplot3d/index.html#mplot3d-examples-index)锛夋敮鎸佺畝鍗曠殑涓夌淮鍥惧舰锛屽寘鎷钩鍙般佺嚎妗嗗浘銆佹暎鐐瑰浘鍜屾潯褰㈠浘銆
[婧愪唬鐮](http://matplotlib.org/mpl_examples/mplot3d/surface3d_demo.py)
![](http://matplotlib.org/_images/surface3d_demo4.png)
鎰熻阿 John Porter锛孞onathan Taylor锛孯einier Heeres 鍜 Ben Root 寮鍙戜簡 mplot3d 宸ュ叿鍖呫 姝ゅ伐鍏峰寘鍖呭惈浜庢墍鏈夋爣鍑 matplotlib 瀹夎涓
## Streamplot
`streamplot()`鍑芥暟缁樺埗鍚戦噺鍦虹殑娴佺嚎鍥俱 闄や簡绠鍗曞湴缁樺埗娴佺嚎涔嬪锛屽畠杩樺厑璁稿皢娴佺嚎鐨勯鑹插拰/鎴栫嚎瀹芥槧灏勫埌鍗曠嫭鐨勫弬鏁帮紝渚嬪鍚戦噺鍦虹殑閫熷害鎴栧眬閮ㄥ瘑搴︺
[婧愪唬鐮](http://matplotlib.org/mpl_examples/images_contours_and_fields/streamplot_demo_features.py)
![](http://matplotlib.org/_images/streamplot_demo_features_001.png)
![](http://matplotlib.org/_images/streamplot_demo_features_011.png)
杩欎釜鐗规у畬鍠勪簡缁樺埗鍚戦噺鍦虹殑`quiver()`鍑芥暟銆 鎰熻阿 Tom Flanagan 鍜 Tony You 娣诲姞`streamplot`鍑芥暟銆
## 妞渾
涓轰簡鏀寔 [Phoenix Mars Mission](http://www.jpl.nasa.gov/news/phoenix/main.php)锛堜娇鐢 matplotlib 灞曠ず鍦伴潰璺熻釜鐨勮埅澶╁櫒锛夛紝Michael Droettboom 鍦 Charlie Moad 鐨勫伐浣滃熀纭涓婃彁渚涗簡闈炲父绮剧‘鐨勬き鍦嗗姬鐨 8-鏍锋潯杩戜技锛堣[`Arc`](http://matplotlib.org/api/patches_api.html#matplotlib.patches.Arc)锛夛紝瀹冨缂╂斁绾у埆骞朵笉鏁忔劅銆
[婧愪唬鐮](http://matplotlib.org/mpl_examples/pylab_examples/ellipse_demo.py)
![](http://matplotlib.org/_images/ellipse_demo1.png)
## 鏉″舰鍥
浣跨敤`bar()`鍛戒护鍒涘缓鏉″舰鍥惧崄鍒嗗鏄擄紝鍏朵腑鍖呮嫭涓浜涘畾鍒讹紙濡傝宸潯锛夛細
[婧愪唬鐮](http://matplotlib.org/mpl_examples/pylab_examples/barchart_demo.py)
![](http://matplotlib.org/_images/barchart_demo3.png)
鍒涘缓鍫嗗彔鏉★紙[`bar_stacked.py`](http://matplotlib.org/examples/pylab_examples/bar_stacked.html)锛夛紝铚$儧鏉★紙[`finance_demo.py`](http://matplotlib.org/examples/pylab_examples/finance_demo.html)锛夊拰姘村钩鏉″舰鍥撅紙[`barh_demo.py`](http://matplotlib.org/examples/lines_bars_and_markers/barh_demo.html)锛変篃寰堢畝鍗曘
## 楗煎浘
`pie()`鍛戒护鍏佽鎮ㄨ交鏉惧垱寤洪ゼ鍥俱 鍙夊姛鑳藉寘鎷嚜鍔ㄦ爣璁板尯鍩熺殑鐧惧垎姣旓紝浠庨ゼ鍥句腑蹇冨悜澶栫敓鎴愪竴涓垨澶氫釜妤斿舰浠ュ強闃村奖鏁堟灉銆 浠旂粏鏌ョ湅闄勫姞鐨勪唬鐮侊紝瀹冪敤鍑犺浠g爜鏉ョ敓鎴愯繖涓浘鍍忋
[婧愪唬鐮](http://matplotlib.org/mpl_examples/pie_and_polar_charts/pie_demo_features.py)
![](http://matplotlib.org/_images/pie_demo_features_001.png)
![](http://matplotlib.org/_images/pie_demo_features_011.png)
## 琛ㄦ牸绀轰緥
`table()`鍛戒护鍚戣酱鍩熸坊鍔犳枃鏈〃鏍笺
[婧愪唬鐮](http://matplotlib.org/mpl_examples/pylab_examples/table_demo.py)
![](http://matplotlib.org/_images/table_demo1.png)
## 鏁g偣鍥剧ず渚
`scatter()`鍛戒护浣跨敤锛堝彲閫夌殑锛夊ぇ灏忓拰棰滆壊鍙傛暟鍒涘缓鏁g偣鍥俱 姝ょず渚嬫弿缁樹簡 Google 鑲$エ浠锋牸鐨勫彉鍖栵紝鏍囪鐨勫昂瀵稿弽鏄犱簡浜ゆ槗閲忥紝骞朵笖棰滆壊闅忔椂闂村彉鍖栥 杩欓噷锛孉LPHA 灞炴х敤浜庡埗浣滃崐閫忔槑鍦嗗舰鏍囪銆
[婧愪唬鐮](http://matplotlib.org/mpl_examples/pylab_examples/scatter_demo2.py)
![](http://matplotlib.org/_images/scatter_demo21.png)
## 婊戝潡绀轰緥
Matplotlib 鎷ユ湁鍩烘湰鐨 GUI 灏忛儴浠讹紝瀹冧滑鐙珛浜庢偍姝e湪浣跨敤鐨勫浘褰㈢敤鎴风晫闈紝鍏佽鎮ㄧ紪鍐 GUI 浜ゅ弶鍥惧舰鍜屽皬閮ㄤ欢銆 璇峰弬闃[`matplotlib.widgets`](http://matplotlib.org/api/widgets_api.html#module-matplotlib.widgets)[灏忛儴浠剁ず渚](http://matplotlib.org/examples/widgets/index.html)
[婧愪唬鐮](http://matplotlib.org/mpl_examples/widgets/slider_demo.py)
![](http://matplotlib.org/_images/slider_demo.png)
## 濉厖绀轰緥
`fill()`鍛戒护鍙互缁樺埗濉厖鏇茬嚎鍜屽杈瑰舰锛
[婧愪唬鐮](http://matplotlib.org/mpl_examples/lines_bars_and_markers/fill_demo.py)
![](http://matplotlib.org/_images/fill_demo2.png)
鎰熻阿 Andrew Straw 娣诲姞浜嗚繖涓嚱鏁般
## 鏃ユ湡绀轰緥
鎮ㄥ彲浠ョ粯鍒舵棩鏈熸暟鎹笌涓昏鍜屾瑕佸埢搴︼紝浠ュ強鐢ㄤ簬浜岃呯殑鑷畾涔夊埢搴︽牸寮忓寲鍣ㄣ
[婧愪唬鐮](http://matplotlib.org/mpl_examples/api/date_demo.py)
![](http://matplotlib.org/_images/date_demo3.png)
璇︾粏淇℃伅鍜岀敤娉曡鍙傞槄[`matplotlib.ticker`](http://matplotlib.org/api/ticker_api.html#module-matplotlib.ticker)[`matplotlib.dates`](http://matplotlib.org/api/dates_api.html#module-matplotlib.dates)
## 閲戣瀺鍥捐〃
鎮ㄥ彲浠ラ氳繃缁撳悎 matplotlib 鎻愪緵鐨勫悇绉嶇粯鍥惧嚱鏁帮紝甯冨眬鍛戒护鍜屾爣绛惧伐鍏锋潵鍒涘缓澶嶆潅鐨勯噾铻嶅浘琛ㄣ 浠ヤ笅绀轰緥妯℃嫙 ChartDirector 涓殑涓涓储鍔″浘锛
[婧愪唬鐮](http://matplotlib.org/mpl_examples/pylab_examples/finance_work2.py)
![](http://matplotlib.org/_images/finance_work21.png)
## 鍦板浘绀轰緥
Jeff Whitaker 鐨 [Basemap](http://matplotlib.org/mpl_toolkits/index.html#toolkit-basemap) 闄勫姞宸ュ叿鍖呭彲浠ュ湪璁稿涓嶅悓鐨勫湴鍥炬姇褰变笂缁樺埗鏁版嵁銆 姝ょず渚嬪睍绀轰簡濡備綍鍦ㄧ洿瑙掓姇褰变笂缁樺埗杞粨锛屾爣璁板拰鏂囨湰锛屼互 NASA 鐨勨滆摑鑹插ぇ鐞嗙煶鈥濆崼鏄熷浘鍍忎綔涓鸿儗鏅
[婧愪唬鐮](http://matplotlib.org/pyplots/plotmap.py)
## 瀵规暟缁樺浘
`semilogx()``semilogy()``loglog()`鍑芥暟绠鍖栦簡瀵规暟缁樺浘鐨勫垱寤恒
[婧愪唬鐮](http://matplotlib.org/mpl_examples/pylab_examples/log_demo.py)
![](http://matplotlib.org/_images/log_demo2.png)
## 鏋佽酱缁樺浘
`polar()`鍛戒护鐢熸垚鏋佽酱缁樺浘銆
[婧愪唬鐮](http://matplotlib.org/mpl_examples/pylab_examples/polar_demo.py)
![](http://matplotlib.org/_images/polar_demo1.png)
## 鍥句緥
`legend()`鍛戒护浣跨敤 MATLAB 鍏煎鐨勫浘渚嬪竷灞鍛戒护鑷姩鐢熸垚鍥惧舰鍥句緥銆
[婧愪唬鐮](http://matplotlib.org/mpl_examples/api/legend_demo.py)
![](http://matplotlib.org/_images/legend_demo6.png)
鎰熻阿 Charles Twardy 缂栧啓浜嗗浘渚嬪懡浠ょ殑杈撳叆銆
## 鏁板鍏紡绀轰緥
涓嬮潰鏄 matplotlib 鍐呴儴鏁板鍏紡寮曟搸鐜板湪鏀寔鐨勮澶 TeX 琛ㄨ揪寮忕殑绀轰緥銆 `mathtext`妯″潡浣跨敤 [freetype2](http://www.freetype.org/) 鍜 BaKoMa 鎴 [STIX](http://www.stixfonts.org/) 鐜颁唬瀛椾綋鎻愪緵 TeX 椋庢牸鐨勬暟瀛﹁〃杈惧紡銆 鍏朵粬璇︾粏淇℃伅璇峰弬闃[`matplotlib.mathtext`](http://matplotlib.org/api/mathtext_api.html#module-matplotlib.mathtext)妯″潡銆
[婧愪唬鐮](http://matplotlib.org/mpl_examples/pylab_examples/mathtext_examples.py)
![](http://matplotlib.org/_images/mathtext_examples_01_001.png)
Matplotlib 鐨`mathtext`鍩虹缁撴瀯鏄竴涓嫭绔嬬殑瀹炵幇锛屼笉闇瑕 TeX 鎴栬绠楁満涓婂畨瑁呯殑浠讳綍澶栭儴杞欢鍖呫 璇峰弬闃[缂栧啓鏁板琛ㄨ揪寮](http://matplotlib.org/users/mathtext.html#mathtext-tutorial)鏁欑▼銆
## TeX 鍘熺敓娓叉煋
铏界劧 matplotlib 鐨勫唴閮ㄦ暟瀛︽覆鏌撳紩鎿庣浉褰撳己澶э紝浣嗘湁鏃朵綘杩樻槸闇瑕 TeX銆侻atplotlib 鏀寔甯︽湁 usetex 閫夐」鐨 TeX 澶栭儴瀛楃涓叉覆鏌撱
[婧愪唬鐮](http://matplotlib.org/pyplots/tex_demo.py)
![](http://matplotlib.org/_images/tex_demo1.png)
## EEG 绀轰緥
鎮ㄥ彲浠ュ皢 matplotlib 宓屽叆鍒 pygtk锛寃x锛孴k锛孎LTK 鎴 Qt 搴旂敤绋嬪簭涓 杩欐槸涓涓悕涓 [pbrain](http://github.com/nipy/pbrain) 鐨 EEG 鏌ョ湅鍣ㄧ殑灞忓箷鎴浘銆
![](http://matplotlib.org/_images/eeg_small.png)
涓嬭酱浣跨敤`specgram()`缁樺埗鍏朵腑涓涓 EEG 閫氶亾鐨勯璋卞浘銆
鏈夊叧灏 matplotlib 宓屽叆涓嶅悓宸ュ叿鍖呯殑绀轰緥锛岃鍙傞槄锛
+ [`user_interfaces`绀轰緥浠g爜锛歚embedding_in_gtk2.py`](http://matplotlib.org/examples/user_interfaces/embedding_in_gtk2.html#user-interfaces-embedding-in-gtk2)
+ [`user_interfaces`绀轰緥浠g爜锛歚embedding_in_wx2.py`](http://matplotlib.org/examples/user_interfaces/embedding_in_wx2.html#user-interfaces-embedding-in-wx2)
+ [`user_interfaces`绀轰緥浠g爜锛歚mpl_with_glade.py`](http://matplotlib.org/examples/user_interfaces/mpl_with_glade.html#user-interfaces-mpl-with-glade)
+ [`user_interfaces`绀轰緥浠g爜锛歚embedding_in_qt4.py`](http://matplotlib.org/examples/user_interfaces/embedding_in_qt4.html#user-interfaces-embedding-in-qt4)
+ [`user_interfaces`绀轰緥浠g爜锛歚embedding_in_tk.py`](http://matplotlib.org/examples/user_interfaces/embedding_in_tk.html#user-interfaces-embedding-in-tk)
## XKCD 椋庢牸鐨勬墜缁樺浘
matplotlib 鏀寔`xkcd`椋庢牸鐨勭粯鍥俱
[婧愪唬鐮](http://matplotlib.org/mpl_examples/showcase/xkcd.py)
![](http://matplotlib.org/_images/xkcd_001.png)
![](http://matplotlib.org/_images/xkcd_011.png)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
鍏堝畬鎴愭娑堟伅鐨勭紪杈戯紒
鎯宠璇勮璇 娉ㄥ唽