Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b3d9595

Browse files
committed
cmap() can be called on array-like
1 parent c7f47ae commit b3d9595

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

handout-tips.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ \subsection*{\rmfamily Range of continuous colors}
126126
\begin{lstlisting}[belowskip=-\baselineskip]
127127
X = np.random.randn(1000, 4)
128128
cmap = plt.get_cmap("Oranges")
129-
colors = [cmap(i) for in in [.2,.4,.6,.8]]
129+
colors = cmap([0.2, 0.4, 0.6, 0.8])
130130

131131
ax.hist(X, 2, histtype='bar', color=colors)
132132
\end{lstlisting} &

0 commit comments

Comments
 (0)