@@ -87,7 +87,7 @@ \subsection*{\rmfamily Transparency}
8787\begin {tabular }{@{}m{.774\linewidth }m{.216\linewidth }}
8888\ begin{lstlisting} [belowskip=-\baselineskip]
8989 X = np.random.normal(-1,1,500)
90- Y = np.random.normal(-1,1,500)
90+ Y = np.random.normal(-1,1,500)
9191 ax.scatter(X, Y, 50, "0.0", lw=2) # optional
9292 ax.scatter(X, Y, 50, "1.0", lw=0) # optional
9393 ax.scatter(X, Y, 40, "C1", lw=0, alpha=0.1)
@@ -102,7 +102,7 @@ \subsection*{\rmfamily Rasterization}
102102in vector format.
103103\ begin{lstlisting}
104104 X = np.random.normal(-1, 1, 10_000)
105- Y = np.random.normal(-1, 1, 10_000)
105+ Y = np.random.normal(-1, 1, 10_000)
106106 ax.scatter(X, Y, rasterized=True)
107107 fig.savefig("rasterized-figure.pdf", dpi=600)
108108\end {lstlisting }
@@ -117,7 +117,7 @@ \subsection*{\rmfamily Offline rendering}
117117 ... # draw som stuff
118118 canvas.draw()
119119 Z = np.array(canvas.renderer.buffer_rgba())
120- \end {lstlisting }
120+ \end {lstlisting }
121121
122122% -----------------------------------------------------------------------------
123123\subsection* {\rmfamily Range of continuous colors }
@@ -127,7 +127,7 @@ \subsection*{\rmfamily Range of continuous colors}
127127 X = np.random.randn(1000, 4)
128128 cmap = plt.get_cmap("Oranges")
129129 colors = cmap([0.2, 0.4, 0.6, 0.8])
130-
130+
131131 ax.hist(X, 2, histtype='bar', color=colors)
132132\end {lstlisting } &
133133\raisebox {-0.75em}{\includegraphics [width=\linewidth ]{tip-color-range.pdf}}
@@ -166,9 +166,9 @@ \subsection*{\rmfamily Dotted lines}
166166To have rounded dotted lines, use a custom {\ttfamily linestyle} and
167167modify {\ttfamily dash\_ capstyle}.
168168\ begin{lstlisting}
169- ax.plot([0,1], [0,0], "C1",
169+ ax.plot([0,1], [0,0], "C1",
170170 linestyle = (0, (0.01, 1)), dash_capstyle="round")
171- ax.plot([0,1], [1,1], "C1",
171+ ax.plot([0,1], [1,1], "C1",
172172 linestyle = (0, (0.01, 2)), dash_capstyle="round")
173173\end {lstlisting }
174174\includegraphics [width=\linewidth ]{tip-dotted.pdf}
@@ -194,7 +194,7 @@ \subsection*{\rmfamily Colorbar adjustment}
194194\begin {tabular }{@{}m{.754\linewidth }m{.236\linewidth }}
195195\ begin{lstlisting} [belowskip=-\baselineskip]
196196 im = ax.imshow(Z)
197-
197+
198198 cb = plt.colorbar(im,
199199 fraction=0.046, pad=0.04)
200200 cb.set_ticks([])
0 commit comments