Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5890283

Browse filesBrowse files
committed
removed whitespace from colormaps tutorial
1 parent e453e26 commit 5890283
Copy full SHA for 5890283

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎tutorials/colors/colormaps.py

Copy file name to clipboardExpand all lines: tutorials/colors/colormaps.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@
199199
# First, we'll show the range of each colormap. Note that some seem
200200
# to change more "quickly" than others.
201201

202-
nrows = max(len(cmap_list) for cmap_category, cmap_list in cmaps.items())
202+
nrows = [len(cmap_list) for cmap_category, cmap_list in cmaps.items()]
203203
gradient = np.linspace(0, 1, 256)
204204
gradient = np.vstack((gradient, gradient))
205205

206206

207207
def plot_color_gradients(cmap_category, cmap_list, nrows):
208-
fig, axs = plt.subplots(nrows=nrows)
208+
fig, axs = plt.subplots(nrows=nrows, figsize=(6, 0.24 * nrows))
209209
fig.subplots_adjust(top=0.95, bottom=0.01, left=0.2, right=0.99)
210210
axs[0].set_title(cmap_category + ' colormaps', fontsize=14)
211211

@@ -221,8 +221,8 @@ def plot_color_gradients(cmap_category, cmap_list, nrows):
221221
ax.set_axis_off()
222222

223223

224-
for cmap_category, cmap_list in cmaps.items():
225-
plot_color_gradients(cmap_category, cmap_list, nrows)
224+
for i, (cmap_category, cmap_list) in enumerate(cmaps.items()):
225+
plot_color_gradients(cmap_category, cmap_list, nrows[i])
226226

227227
plt.show()
228228

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.