3535 tabsize=2,
3636 %
3737 emph = { plot, scatter, imshow, bar, contourf, pie, subplots, spines,
38- add_gridspec, add_subplot, set_xscale, set_minor_locator,
39- set_minor_formatter, tick_params, fill_betweenx, text, legend,
40- errorbar, boxplot, hist, title, xlabel, ylabel, suptitle },
38+ add_gridspec, add_subplot, set_xscale, set_minor_locator,
39+ annotate, set_minor_formatter, tick_params, fill_betweenx, text, legend,
40+ errorbar, boxplot, hist, title, xlabel, ylabel, suptitle },
4141 emphstyle = {\ttfamily\bfseries }
4242}
4343
@@ -162,16 +162,24 @@ \subsection*{\rmfamily Legend}
162162\end {lstlisting }
163163\includegraphics [width=\linewidth ]{sine-legend.pdf}
164164
165+ % -----------------------------------------------------------------------------
166+ \subsection* {\rmfamily Annotation }
167+ \ begin{lstlisting} []
168+ ax.annotate("A", (X[250],Y[250]),(X[250],-1),
169+ ha="center", va="center",arrowprops =
170+ {"arrowstyle" : "->", "color": "C1"})
171+ \end {lstlisting }
172+ \includegraphics [width=\linewidth ]{sine-annotate.pdf}
165173
166174% -----------------------------------------------------------------------------
167175\subsection* {\rmfamily Colors }
168176
169- Any color can be used but Matplotlib offers a set of colors:\\
177+ Any color can be used but Matplotlib offers sets of colors:\\
170178\includegraphics [width=\linewidth ]{colors-cycle.pdf} \smallskip
171179\includegraphics [width=\linewidth ]{colors-grey.pdf}\\
172- As well as nice colormaps (viridis an magma):\\
173- \includegraphics [width=\linewidth ]{colormap-viridis.pdf} \smallskip
174- \includegraphics [width=\linewidth ]{colormap-magma.pdf} \medskip
180+ % As well as nice colormaps (viridis an magma):\\
181+ % \includegraphics[width=\linewidth]{colormap-viridis.pdf} \smallskip
182+ % \includegraphics[width=\linewidth]{colormap-magma.pdf} \medskip
175183
176184% -----------------------------------------------------------------------------
177185\subsection* {\rmfamily Size \& DPI }
@@ -185,29 +193,6 @@ \subsection*{\rmfamily Size \& DPI}
185193 plt.savefig("figure.pdf", dpi=600)
186194\end {lstlisting }
187195
188- % % \begin{tabular}{@{}m{.821\linewidth}m{.169\linewidth}}
189- % % \begin{lstlisting}[belowskip=-\baselineskip]
190- % % ax = plt.subplot(projection="polar")
191- % % ax.set_rorigin(-3)
192- % % plt.plot(X, Y, "C1-")
193- % % \end{lstlisting}
194- % % & \raisebox{-0.75em}{\includegraphics[width=\linewidth]{sine-polar.pdf}}
195- % % \end{tabular}
196-
197-
198- % % X = np.linspace(0, 2*np.pi, 10000)
199- % % Y = np.sin(10*X)
200-
201- % % fig = plt.figure(figsize=(5,5))
202- % % ax = plt.subplot(projection="polar")
203-
204- % % ax.set_xticks(np.linspace(0, 2*np.pi, 8+1 ))
205- % % ax.set_xticklabels([])
206- % % ax.set_yticklabels([])
207- % % plt.ylim(-1.5, 1.5)
208- % % plt.plot(X, Y, "C1o-", markevery=500, mec="1.0", lw=2, ms=8.5, mew=2)
209- % % plt.savefig("../figures/sine-polar.pdf", dpi=100)
210- % % plt.show()
211196
212197\vfill
213198%
0 commit comments