@@ -184,6 +184,7 @@ All skills are base on the implementation of Python 3.
184
184
<td ><ul style =" margin : 8px " >
185
185
<li ><a href =" #basic-single-plot " >Basic (Single Plot)</li >
186
186
<li ><a href =" #multiple-figures-and-axes " >Multiple Figures and Axes</li >
187
+ <li ><a href =" #line-plots-and-filling-area " >Line Plots and Filling Area</li >
187
188
</ul ></td >
188
189
</table >
189
190
@@ -1863,48 +1864,92 @@ plt.annotate("wow \nmax", xy=(16, 1), xytext=(40, 0.9), arrowprops={"facecolor":
1863
1864
plt.annotate(" wow \n max again" , xy = (78 , 1 ), xytext = (95 , 0.9 ), arrowprops = {" facecolor" : " red" , " shrink" : 0.05 })
1864
1865
```
1865
1866
1867
+ ![ ] ( assets/matplotlib/basic.jpg )
1868
+
1866
1869
- [ Details 🔥] ( matplotlib/basic.ipynb )
1867
1870
1868
1871
## Multiple Figures and Axes
1869
1872
1870
1873
``` py
1871
- # Pyplot style
1872
- plt.figure(1 )
1873
- plt.plot(... )
1874
-
1875
- plt.figure(2 )
1876
- plt.subplot(2 , 1 , 1 )
1877
- plt.plot(... )
1878
- plt.subplot(2 , 1 , 2 )
1879
- plt.plot(... )
1880
-
1881
-
1882
1874
# Object-oriented style
1883
1875
fig1, ax = plt.subplots()
1884
1876
ax.plot(... )
1885
1877
1886
1878
fig2, axs = plt.subplots(2 , 1 )
1887
1879
axs[0 ].plot(... )
1888
1880
axs[1 ].plot(... )
1881
+
1882
+
1883
+ # Pyplot style
1884
+ plt.figure(1 )
1885
+ plt.title(" Figure 1" )
1886
+
1887
+ plt.figure(2 )
1888
+ plt.subplot(311 )
1889
+ plt.title(" Figure 2" )
1890
+
1891
+ plt.subplot(323 )
1892
+ plt.subplot(324 )
1893
+
1894
+ plt.subplot(337 )
1895
+ plt.subplot(338 )
1896
+ plt.subplot(339 )
1889
1897
```
1890
1898
1899
+ <p float =" left " >
1900
+ <img src =" assets/matplotlib/figure1.jpg " width =" 350 " />
1901
+ <img src =" assets/matplotlib/figure2.jpg " width =" 350 " />
1902
+ </p >
1903
+
1891
1904
- [ Details 🔥] ( matplotlib/figures_axes.ipynb )
1892
1905
1893
- ## Style
1906
+ ## Line Plots and Filling Area
1907
+
1908
+ ``` py
1909
+ # Line Plots
1910
+ plt.plot(years,
1911
+ salary,
1912
+ marker = " o" ,
1913
+ markersize = 5 ,
1914
+ lw = 2 ,
1915
+ ls = " -" ,
1916
+ )
1917
+
1918
+
1919
+ # Filling Areas
1920
+ plt.fill_between(years,
1921
+ salary,
1922
+ salary_mean,
1923
+ where = (salary > salary_mean),
1924
+ alpha = .4 ,
1925
+ color = " green" ,
1926
+ edgecolor = " black" ,
1927
+ interpolate = True ,
1928
+ label = " On Average"
1929
+ )
1930
+ ```
1931
+
1932
+ <p float =" center " >
1933
+ <img src =" assets/matplotlib/line_plots.jpg " width =" 260 " />
1934
+ <img src =" assets/matplotlib/filling_area.jpg " width =" 260 " />
1935
+ <img src =" assets/matplotlib/filling_area_with_mean.jpg " width =" 260 " />
1936
+ </p >
1937
+
1938
+ - [ Details 🔥] ( matplotlib/plot_and_filling_area.ipynb )
1939
+
1940
+ ## Time Series
1894
1941
1942
+ ## Scatter Plots
1895
1943
1944
+ ## Bar Charts
1896
1945
1946
+ ## Pie Charts
1897
1947
1898
- <!-- plot - fill
1899
- bar
1900
- pie
1901
- stack
1902
- histogram - distribution
1903
- scatter
1904
- time series
1905
- image -->
1948
+ ## Histograms
1906
1949
1950
+ ## Stack Plots
1907
1951
1952
+ ## Image
1908
1953
1909
1954
# TODOs
1910
1955
0 commit comments