@@ -9,7 +9,7 @@ Matplotlib - Plotting
99
1010
1111Simple plot
12- <img src =" /figures/intro/simple_plot.png " style =" width : 600px ;" />
12+ <img src =" .. /figures/intro/simple_plot.png" style =" width : 600px ;" />
1313``` python
1414import pylab as pl
1515import numpy as np
@@ -49,7 +49,7 @@ pl.show()
4949
5050
5151Change linestyles
52- <img src =" /figures/intro/simple_plot_cust.png " style =" width : 600px ;" />
52+ <img src =" .. /figures/intro/simple_plot_cust.png" style =" width : 600px ;" />
5353``` python
5454pl.figure(figsize = (10 , 6 ), dpi = 80 )
5555pl.plot(X, C, color = " blue" , linewidth = 2.5 , linestyle = " -" )
@@ -59,7 +59,7 @@ pl.plot(X, S, color="red", linewidth=2.5, linestyle="-")
5959
6060
6161Adding legend
62- <img src =" /figures/intro/simple_plot_legend.png " style =" width : 600px ;" />
62+ <img src =" .. /figures/intro/simple_plot_legend.png" style =" width : 600px ;" />
6363``` python
6464pl.plot(X, C, color = " blue" , linewidth = 2.5 , linestyle = " -" , label = " cosine" )
6565pl.plot(X, S, color = " green" , linewidth = 2.5 , linestyle = " --" , label = " sine" ) # Set x limits
@@ -69,7 +69,7 @@ pl.legend(loc='upper left')
6969
7070
7171Moving splines
72- <img src =" /figures/intro/simple_plot_cust2.png " style =" width : 600px ;" />
72+ <img src =" .. /figures/intro/simple_plot_cust2.png" style =" width : 600px ;" />
7373``` python
7474ax = pl.gca() # gca stands for 'get current axis'
7575ax.spines[' right' ].set_color(' none' )
@@ -83,7 +83,7 @@ ax.spines['left'].set_position(('data',0))
8383
8484
8585Histograms
86- <img src =" /figures/intro/hist.png " style =" width : 600px ;" />
86+ <img src =" .. /figures/intro/hist.png" style =" width : 600px ;" />
8787
8888``` python
8989import pylab as pl
@@ -95,7 +95,7 @@ pl.show()
9595
9696
9797Add a fit line and legend
98- <img src =" /figures/intro/hist_legend_fit.png " style =" width : 600px ;" />
98+ <img src =" .. /figures/intro/hist_legend_fit.png" style =" width : 600px ;" />
9999``` python
100100n, bins, patches = pl.hist(pl.randn(1000 ), 40 , normed = 1 )
101101l, = pl.plot(bins, pl.normpdf(bins, 0.0 , 1.0 ), ' r--' , label = ' fit' , linewidth = 3 )
@@ -104,20 +104,22 @@ legend([l, patches[0]], ['fit', 'hist'])
104104
105105
106106
107- Other types of plots include
108- - Scatter
109- - Bar
110- - Pie
111- - Sankey
112- - Images
113- - Quivers
114- - Multiplots
115- - Polar
116- - 3D
107+ Other types of plots include:
108+
109+ * Scatter
110+ * Bar
111+ * Pie
112+ * Sankey
113+ * Images
114+ * Quivers
115+ * Multiplots
116+ * Polar
117+ * 3D
117118
118119
119120
120121Other elements to know about:
122+
121123- Ticks: control how the ticks look
122124- Annotations: Add visual elements to your plot
123125- Axes: draw plots on top of themselves
0 commit comments