-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path00i9t83813.html
More file actions
1 lines (1 loc) · 2.38 KB
/
00i9t83813.html
File metadata and controls
1 lines (1 loc) · 2.38 KB
1
<div>The result is shown in Fig.<span class="au-ref raw v1">\ref{525200}</span> below. </div><div></div><div>What these commands do: </div><div></div><blockquote class="au-no-left-border"><div><code>%matplotlib inline</code> is an interactive Python (iPython) '<a href="http://ipython.readthedocs.io/en/stable/interactive/magics.html" target="_blank">magic command</a>' used when running Python within a Jupyter notebook. It allows the display of data plots within the notebook. </div><div></div><div>Tip: <a href="https://www.authorea.com/users/18589/articles/307487-matplotlib-pyplot-test" target="_blank">When running Jupyter notebooks within Authorea</a> , the<code>%matplotlib inline</code> command must precede the <code>from matplotlib import pyplot</code> command. </div><div></div><div><code>plt.figure()</code> signifies the beginning of the plotting instructions specific to that figure. </div><div></div><div><code>plt.errorbar(angle, V_pd, xerr = None, yerr=V_pd_delta)</code> is the command that instructs matplotlib to generate a x-y plot with error bars (as opposed to a bar graph or scatter plot, for example). All four parameters (<code>x, y, xerr, yerr</code>) are required. </div><div></div><div><code>linestyle</code> and <code>color</code> are used to customize the appearance of the data points. <code>Linestyle = None</code> means there are no connecting lines between points. <code>Color</code> means the color of the error bar lines and caps. The standard colors are blue, green, red, cyan, magenta, yellow, black, and white (with corresponding abbreviations 'b', 'g', 'r', 'c', 'm', 'y', 'k', and 'w'). </div><div></div><div><code>capsize</code>, and <code>capthick</code> are used to customize the appearance of the error bars. <code>capsize =3</code> sets the width of the error bars to '3' (in typesetter points), and <code>capthick=1</code>sets the thickness of the drawn bars to '1' (again in typesetter points). Note that if the <code>capsize</code> and <code>capthick</code> commands are omitted, matplotlib will draw lines indicating the given uncertainty but will omit the bars! </div><div></div><div><code>plt.show()</code> signifies the end of the plotting instructions and causes matplotlib to plot the data. </div></blockquote><div></div>