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 540c2b8

Browse filesBrowse files
committed
colormap title on extra axes
1 parent 5890283 commit 540c2b8
Copy full SHA for 540c2b8

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+6
-4
lines changed

‎tutorials/colors/colormaps.py

Copy file name to clipboardExpand all lines: tutorials/colors/colormaps.py
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,13 @@
205205

206206

207207
def plot_color_gradients(cmap_category, cmap_list, nrows):
208-
fig, axs = plt.subplots(nrows=nrows, figsize=(6, 0.24 * nrows))
209-
fig.subplots_adjust(top=0.95, bottom=0.01, left=0.2, right=0.99)
210-
axs[0].set_title(cmap_category + ' colormaps', fontsize=14)
208+
fig, axs = plt.subplots(nrows=nrows + 1, figsize=(6, 0.29 * nrows))
209+
fig.subplots_adjust(top=1, bottom=0, left=0.2, right=0.99)
210+
axs[0].text(0.5, 0.5, cmap_category + " colormaps", fontsize=14,
211+
transform=axs[0].transAxes, horizontalalignment="center",
212+
verticalalignment="center")
211213

212-
for ax, name in zip(axs, cmap_list):
214+
for ax, name in zip(axs[1:], cmap_list):
213215
ax.imshow(gradient, aspect='auto', cmap=plt.get_cmap(name))
214216
pos = list(ax.get_position().bounds)
215217
x_text = pos[0] - 0.01

0 commit comments

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