Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4b28d78

Browse files
committed
Add test case
Adapted from the code samples in #7937 by @TomDLT and @afvincent.
1 parent f7d8162 commit 4b28d78

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Binary file not shown.

lib/matplotlib/tests/test_text.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,3 +411,16 @@ def test_text_size_binding():
411411
matplotlib.rcParams['font.size'] = 100
412412

413413
assert sz1 == fp.get_size_in_points()
414+
415+
416+
@image_comparison(baseline_images=['font_scaling'],
417+
extensions=['pdf'])
418+
def test_font_scaling():
419+
matplotlib.rcParams['pdf.fonttype'] = 42
420+
fig, ax = plt.subplots(figsize=(6.4, 12.4))
421+
ax.xaxis.set_major_locator(plt.NullLocator())
422+
ax.yaxis.set_major_locator(plt.NullLocator())
423+
ax.set_ylim(-10, 600)
424+
425+
for i, fs in enumerate(range(4, 43, 2)):
426+
ax.text(0.1, i*30, "{fs} pt font size".format(fs=fs), fontsize=fs)

0 commit comments

Comments
 (0)