Matplotlib庫的入門
![1796993-29096835615f87ca.png](https://i.iter01.com/images/186a7e74b14bfce597c98ce93186d29573d730c6f3e47422e975bd9f0e606ecd.jpg)
import matplotlib.pyplot as plt(引用模組的別名)
![1796993-11213a99a1f959ad.png](https://i.iter01.com/images/717392038c316ad72d8c5c47b3d774ab36c13400167a08103ece137488281e6b.png)
![1796993-22456d1650f14610.png](https://i.iter01.com/images/6cb17631161ebae68223538e9150f262bff6f25cb5452f581a2ece73a6b115e8.png)
![1796993-775b4e1627ddfada.png](https://i.iter01.com/images/8845869abbec6c1cf8e0cb275db918fde65ea83714cdeca8f32088e32a169fa6.png)
![1796993-c7578f8515aab0e0.png](https://i.iter01.com/images/bf715423b45e4c68bfdac1e65a098a94a0cc4aa6446ec95fd97897c65e078987.png)
pyplot的plot()函式
plt.plot(x,y,format_string,**kwargs)
x :x軸資料,列表或陣列,可選
y :y軸資料,列表或陣列
format_string :控制曲線的格式字串,可選
**kwargs :第二組或更多(x,y,format_string)
當繪製多條曲線時,各條曲線的x不能省略
![1796993-7c506019753f6333.png](https://i.iter01.com/images/f8608a6bfa3dfa5a1fe12ab9b3e9e390984d0a445274ed4e9ac371688371437d.png)
![1796993-241982788b08d138.png](https://i.iter01.com/images/474ebd762e38435ec132b2cede5973169a0d9e8fb64d73cee7da64ab6e766d47.png)
![1796993-ecf9538c9f15aff6.png](https://i.iter01.com/images/1e1a969833d125140765de2df2ba3a2ecb5089569ba66c7aa5ad16e2445c9db4.png)
![1796993-87be0d744d00fbff.png](https://i.iter01.com/images/1dd10faaeb7f4edc68bf55d257e7b3e711accd77595e354025ae4bedadc5cbb2.png)
![1796993-5a017f34d175e410.png](https://i.iter01.com/images/8cfd73ffa9eca4ac3a6de396564243294689e717828428b943af692a3ca0a186.png)
plt.plot(x,y,format_string,**kwargs)
**kwargs :第二組或更多(x,y,format_string)
color :控制顏色,color =‘green’
linestyle :線條風格,linestyle =‘dashed’
marker :標記風格,marker = ‘o’
markerfacecolor :標記顏色,markerfacecolor = 'blue'
markersize :標記尺寸,markersize=20
![1796993-912f3c14926db474.png](https://i.iter01.com/images/84c1064a238a3ba4efe0d83dd9d406ee251657782e87c88550101777b2c78f26.png)
rcParams的屬性
font.family 用於顯示字型的名字
font.strle 字型風格,正常‘normal’ 或斜體‘italic’
font.size 字型大小,整數字號或者'large'、'x-small'
![1796993-995a58d42dbb1136.png](https://i.iter01.com/images/8e54a767d9f83337559014f0d53ff5948b096ed00a196961ffeaf047133fbab2.png)
![1796993-7002825b3a4af06f.png](https://i.iter01.com/images/acb317e75de67486fef385cc8480205cf4f69e27d2d0e85d6ef444c30fef3671.png)
![1796993-c7594b2b1639b235.png](https://i.iter01.com/images/e63207e468402020dfbc98a7c039266f5e5d78133b66da94499529937e6d0629.png)
pyplot的文字顯示函式
plt.xlabel() 對x軸增加文字標籤
plt.ylabel() 對y軸增加文字標籤
plt.title() 對圖形整體增加文字標籤
plt.text() 在任意位置增加文字
plt.annotate() 在圖形中增加帶箭頭的註解
![1796993-7bd554650de1ebc7.png](https://i.iter01.com/images/a87763c5a430658186a4e7598fa10212f9fbbc7e6a304fbd5486a19ef5b485a4.png)
![1796993-0c775dda587735ee.png](https://i.iter01.com/images/cfdd3d837d91d51da930dd2395337880f5151a076d655c52fa3f7dfee7de79b5.png)
pyplot的子繪圖區域
![1796993-6b0b3cf30569fd28.png](https://i.iter01.com/images/d11d06e53610948d2540eae935f2797c59a21c4d00201306555abaac99adbc29.png)
![1796993-1131f5c290b5e1fd.png](https://i.iter01.com/images/aa64ba889fdd092dc112148e5d61c4cd2f82893f1c31a3cad37ffc7c4ba22293.png)
![1796993-e2e2117cc2fd309f.png](https://i.iter01.com/images/adf423ab43f7b99e6648c2501835ed2067394ade253eb10aa06891ba9d8bc286.png)
![1796993-784d297a9187c5e9.png](https://i.iter01.com/images/a6a27ef52b6a2d12fead4b3152962972c7169a4d02b219825369d3ef6b92e781.png)
pyplot基礎圖示函式概述
plt.plot(x,y,fmt,...) 繪製一個座標圖
plt.boxplot(data,notch,position) 繪製一個箱形圖
plt.bar(left,height,width,bottom) 繪製一個條形圖
plt.barh(width,bottom,left,height) 繪製一個橫向條形圖
plt.polar(theta,r) 繪製極座標圖
plt.pie(data,explode) 繪製餅圖
plt.psd(x,NFFT=256,pad_to,Fs) 繪製功率譜密度圖
plt.specgram(x,NFFT=256,pad_to,F) 繪製譜圖
plt.cohere(x,y,NFFT=256,Fs) 繪製X-Y的相關性函式
plt.scatter(x,y) 繪製散點圖,其中,x和y長度相同
plt.step(x,y,where) 繪製步階圖
plt.hist(x,bins,normed) 繪製直方圖
plt.contour(X,Y,Z,N) 繪製等值圖
plt.vlines() 繪製垂直圖
plt.stem(x,y,linefmt,markerfmt) 繪製柴火圖
plt.plot_date() 繪製資料日期
![1796993-4a0dd03d255ed2c4.png](https://i.iter01.com/images/08298bc7fffcf093a12eef424f34d736421bf9ed828008d4f3d56e5cb3acb86c.png)
![1796993-e3ba7c15dfe21554.png](https://i.iter01.com/images/88531d32fc039295be01964e483d7dd4c9277629f386c99cada3df8e270382c8.png)
![1796993-5edbd762d1dcee16.png](https://i.iter01.com/images/5c3119f4ab84f359b7db43ab0e843bd0d0cc8098194b19a0a70afff2d4ace9ef.png)
![1796993-87e240545bcd4f63.png](https://i.iter01.com/images/f9bfa21365c3c493159993109efe5d6841ef8e6ff5d0810c582d7d51dd17c4f1.png)
![1796993-aef16f561eb9878d.png](https://i.iter01.com/images/4b00f406d65579d7d3a2b28dfe9752ca9d2b59f39bd08a9bbc5621b7152dbb45.png)
![1796993-c1f1b9d61ec513f2.png](https://i.iter01.com/images/5714b0857f7a7d07c73b3eab014d6a41cb2979f1a181327839285eaf7f5df785.png)
![1796993-1f15afb8e1023e95.png](https://i.iter01.com/images/557b98722e1717472298aeb5b5b4f995300a348f8f58487a4e69adc3f9bea21e.png)
相關文章
- python資料視覺化神庫:Matplotlib快速入門Python視覺化
- Python 繪相簿 Matplotlib 入門教程Python
- Python 語言的2D繪相簿之 Matplotlib 入門教程Python
- Python 的加密庫入門Python加密
- Python-matplotlib-入門教程(一)-基礎圖表繪製Python
- python--matplotlib庫使用3Python
- python資料視覺化-matplotlib入門(6)-從檔案中載入資料Python視覺化
- MongoDB資料庫入門MongoDB資料庫
- python資料視覺化-matplotlib入門(5)-餅圖和堆疊圖Python視覺化
- matplotlib 畫圖直接寫入excelExcel
- python資料視覺化-matplotlib入門(4)-條形圖和直方圖Python視覺化直方圖
- Elasticsearch和向量資料庫的快速入門Elasticsearch資料庫
- 向量資料庫Chromadb的入門資訊資料庫
- Python資料視覺化matplotlib庫Python視覺化
- Python HTTP庫:requests快速入門PythonHTTP
- MongoDB從入門到刪庫MongoDB
- LVGL庫入門教程 - 動畫動畫
- cache資料庫入門教程資料庫
- 【Python入門】Python資料分析最重要的庫!Python
- python資料視覺化-matplotlib入門(7)-從網路載入資料及資料視覺化的小總結Python視覺化
- Docker入門-搭建docker私有倉庫Docker
- python爬蟲 之 BeautifulSoup庫入門Python爬蟲
- 資料庫事務入門指南資料庫
- Nodejs教程21:資料庫入門NodeJS資料庫
- Python——astroplan庫入門例項(二)PythonAST
- Java 命令列互動輸入庫 JLine 入門Java命令列
- 何入CTF的“門”?——所謂入門就是入門
- 如何入CTF的“門”?——所謂入門就是入門
- python資料處理matplotlib入門(2)-利用隨機函式生成變化圖形Python隨機函式
- MySQL入門系列:資料庫和表的基本操作MySql資料庫
- git 入門教程之本地倉庫Git
- git 入門教程之遠端倉庫Git
- Milvus向量資料庫入門實踐資料庫
- MySQL資料庫入門多例項配置MySql資料庫
- python學習筆記——jieba庫入門Python筆記Jieba
- 快速入門pandas擴充套件庫(上)套件
- LVGL庫入門教程 - 顏色和影像
- python滲透測試入門——Scapy庫Python
- Redis快取資料庫-快速入門Redis快取資料庫