Skip to content

Commit 2f600bc

Browse files
committed
Make show_xyz functions return figure *and* axes
1 parent d32c650 commit 2f600bc

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

proplot/styletools.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3365,7 +3365,7 @@ def _draw_bars(
33653365
if imap == 0:
33663366
ax.set_title(cat, weight='bold')
33673367
nbars += len(names)
3368-
return fig
3368+
return fig, axs
33693369

33703370

33713371
def show_channels(
@@ -3485,13 +3485,14 @@ def show_channels(
34853485
)
34863486
# Colorbar on the bottom
34873487
for cmap in cmaps:
3488-
fig.colorbar(cmap,
3489-
loc='b', span=(2, 5),
3490-
locator='null', label=cmap.name, labelweight='bold')
3491-
return fig
3488+
fig.colorbar(
3489+
cmap, loc='b', span=(2, 5),
3490+
locator='null', label=cmap.name, labelweight='bold'
3491+
)
3492+
return fig, axs
34923493

34933494

3494-
def show_colorspaces(luminance=None, saturation=None, hue=None, axwidth=2):
3495+
def show_colorspaces(*, luminance=None, saturation=None, hue=None, axwidth=2):
34953496
"""
34963497
Generate hue-saturation, hue-luminance, and luminance-saturation
34973498
cross-sections for the HCL, HSL, and HPL colorspaces.
@@ -3570,9 +3571,9 @@ def show_colorspaces(luminance=None, saturation=None, hue=None, axwidth=2):
35703571
xlabel=xlabel, ylabel=ylabel, suptitle=suptitle,
35713572
grid=False, xtickminor=False, ytickminor=False,
35723573
xlocator=xloc, ylocator=yloc, facecolor='k',
3573-
title=space.upper(), titleweight='bold'
3574+
title=space.upper(),
35743575
)
3575-
return fig
3576+
return fig, axs
35763577

35773578

35783579
def _color_filter(hcl, ihue, nhues, minsat):
@@ -3949,7 +3950,7 @@ def show_fonts(
39493950
stretch=stretch, style=style, weight=weight,
39503951
ha='left', va='center'
39513952
)
3952-
return fig
3953+
return fig, axs
39533954

39543955

39553956
# Convert colormaps that *should* be LinearSegmented from Listed

0 commit comments

Comments
 (0)