Skip to content

Commit 4cf0f21

Browse files
committed
show_fonts axes height based on newlines in sample text
1 parent c6faa9a commit 4cf0f21

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

proplot/styletools.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3623,9 +3623,11 @@ def show_fonts(*args, size=12, text=None):
36233623
r'$\Phi\phi$ $\Psi\psi$ $\Omega\omega$ !?&#%'
36243624

36253625
# Create figure
3626-
f, axs = subplots(ncols=1, nrows=len(args), space=0,
3627-
axwidth=4.5, axheight=6.5 * size / 72,
3628-
fallback_to_cm=False)
3626+
f, axs = subplots(
3627+
ncols=1, nrows=len(args), space=0,
3628+
axwidth=4.5, axheight=(text.count('\n') + 3.5) * size / 72,
3629+
fallback_to_cm=False
3630+
)
36293631
axs.format(xloc='neither', yloc='neither',
36303632
xlocator='null', ylocator='null', alpha=0)
36313633
axs[0].format(title='Fonts demo', titlesize=size,

0 commit comments

Comments
 (0)