@@ -87,7 +87,7 @@ \subsection*{\rmfamily Transparency}
87
87
\begin {tabular }{@{}m{.774\linewidth }m{.216\linewidth }}
88
88
\ begin{lstlisting} [belowskip=-\baselineskip]
89
89
X = np.random.normal(-1,1,500)
90
- Y = np.random.normal(-1,1,500)
90
+ Y = np.random.normal(-1,1,500)
91
91
ax.scatter(X, Y, 50, "0.0", lw=2) # optional
92
92
ax.scatter(X, Y, 50, "1.0", lw=0) # optional
93
93
ax.scatter(X, Y, 40, "C1", lw=0, alpha=0.1)
@@ -102,7 +102,7 @@ \subsection*{\rmfamily Rasterization}
102
102
in vector format.
103
103
\ begin{lstlisting}
104
104
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)
106
106
ax.scatter(X, Y, rasterized=True)
107
107
fig.savefig("rasterized-figure.pdf", dpi=600)
108
108
\end {lstlisting }
@@ -117,7 +117,7 @@ \subsection*{\rmfamily Offline rendering}
117
117
... # draw som stuff
118
118
canvas.draw()
119
119
Z = np.array(canvas.renderer.buffer_rgba())
120
- \end {lstlisting }
120
+ \end {lstlisting }
121
121
122
122
% -----------------------------------------------------------------------------
123
123
\subsection* {\rmfamily Range of continuous colors }
@@ -127,7 +127,7 @@ \subsection*{\rmfamily Range of continuous colors}
127
127
X = np.random.randn(1000, 4)
128
128
cmap = plt.get_cmap("Oranges")
129
129
colors = cmap([0.2, 0.4, 0.6, 0.8])
130
-
130
+
131
131
ax.hist(X, 2, histtype='bar', color=colors)
132
132
\end {lstlisting } &
133
133
\raisebox {-0.75em}{\includegraphics [width=\linewidth ]{tip-color-range.pdf}}
@@ -166,9 +166,9 @@ \subsection*{\rmfamily Dotted lines}
166
166
To have rounded dotted lines, use a custom {\ttfamily linestyle} and
167
167
modify {\ttfamily dash\_ capstyle}.
168
168
\ begin{lstlisting}
169
- ax.plot([0,1], [0,0], "C1",
169
+ ax.plot([0,1], [0,0], "C1",
170
170
linestyle = (0, (0.01, 1)), dash_capstyle="round")
171
- ax.plot([0,1], [1,1], "C1",
171
+ ax.plot([0,1], [1,1], "C1",
172
172
linestyle = (0, (0.01, 2)), dash_capstyle="round")
173
173
\end {lstlisting }
174
174
\includegraphics [width=\linewidth ]{tip-dotted.pdf}
@@ -194,7 +194,7 @@ \subsection*{\rmfamily Colorbar adjustment}
194
194
\begin {tabular }{@{}m{.754\linewidth }m{.236\linewidth }}
195
195
\ begin{lstlisting} [belowskip=-\baselineskip]
196
196
im = ax.imshow(Z)
197
-
197
+
198
198
cb = plt.colorbar(im,
199
199
fraction=0.046, pad=0.04)
200
200
cb.set_ticks([])
0 commit comments