8000 moved nrows into plot_color_gradients · matplotlib/matplotlib@630086a · GitHub
[go: up one dir, main page]

Skip to content

Commit 630086a

Browse files
committed
moved nrows into plot_color_gradients
1 parent 2ab98d7 commit 630086a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tutorials/colors/colormaps.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,12 @@
199199
# First, we'll show the range of each colormap. Note that some seem
200200
# to change more "quickly" than others.
201201

202-
nrows = [len(cmap_list) for cmap_category, cmap_list in cmaps.items()]
203202
gradient = np.linspace(0, 1, 256)
204203
gradient = np.vstack((gradient, gradient))
205204

206205

207-
def plot_color_gradients(cmap_category, cmap_list, nrows):
206+
def plot_color_gradients(cmap_category, cmap_list):
207+
nrows = len(cmap_list)
208208
fig, axs = plt.subplots(nrows=nrows + 1, figsize=(6, 0.29 * nrows))
209209
fig.subplots_adjust(top=1, bottom=0, left=0.2, right=0.99)
210210
axs[0].text(0.5, 0.5, cmap_category + " colormaps", fontsize=14,
@@ -223,8 +223,8 @@ def plot_color_gradients(cmap_category, cmap_list, nrows):
223223
ax.set_axis_off()
224224

225225

226-
for rows, (cmap_category, cmap_list) in zip(nrows, cmaps.items()):
227-
plot_color_gradients(cmap_category, cmap_list, rows)
226+
for cmap_category, cmap_list in cmaps.items():
227+
plot_color_gradients(cmap_category, cmap_list)
228228

229229
plt.show()
230230

0 commit comments

Comments
 (0)
0