35
35
tabsize=2,
36
36
%
37
37
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 },
41
41
emphstyle = {\ttfamily\bfseries }
42
42
}
43
43
@@ -162,16 +162,24 @@ \subsection*{\rmfamily Legend}
162
162
\end {lstlisting }
163
163
\includegraphics [width=\linewidth ]{sine-legend.pdf}
164
164
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}
165
173
166
174
% -----------------------------------------------------------------------------
167
175
\subsection* {\rmfamily Colors }
168
176
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:\\
170
178
\includegraphics [width=\linewidth ]{colors-cycle.pdf} \smallskip
171
179
\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
175
183
176
184
% -----------------------------------------------------------------------------
177
185
\subsection* {\rmfamily Size \& DPI }
@@ -185,29 +193,6 @@ \subsection*{\rmfamily Size \& DPI}
185
193
plt.savefig("figure.pdf", dpi=600)
186
194
\end {lstlisting }
187
195
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()
211
196
212
197
\vfill
213
198
%
0 commit comments