8000 Merge pull request #24672 from meeseeksmachine/auto-backport-of-pr-24… · matplotlib/matplotlib@2e8f5dd · GitHub
[go: up one dir, main page]

Skip to content

Commit 2e8f5dd

Browse files
authored
Merge pull request #24672 from meeseeksmachine/auto-backport-of-pr-24669-on-v3.6.2-doc
Backport PR #24669 on branch v3.6.2-doc (Doc: clarify preferred image comparison test settings)
2 parents 4f66a7a + 025b98e commit 2e8f5dd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/devel/testing.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ tests it::
109109
import matplotlib.pyplot as plt
110110

111111
@image_comparison(baseline_images=['line_dashes'], remove_text=True,
112-
extensions=['png'])
112+
extensions=['png'], style='mpl20')
113113
def test_line_dashes():
114114
fig, ax = plt.subplots()
115115
ax.plot(range(10), linestyle=(0, (3, 3)), lw=5)
@@ -130,6 +130,12 @@ images on the figures using two different methods (the tested method and the
130130
baseline method). The decorator will arrange for setting up the figures and
131131
then collect the drawn results and compare them.
132132

133+
It is preferred that new tests use ``style='mpl20'`` as this leads to smaller
134+
figures and reflects the newer look of default Matplotlib plots. Also, if the
135+
texts (labels, tick labels, etc) are not really part of what is tested, use
136+
``remove_text=True`` as this will lead to smaller figures and reduce possible
137+
issues with font mismatch on different platforms.
138+
133139
See the documentation of `~matplotlib.testing.decorators.image_comparison` and
134140
`~matplotlib.testing.decorators.check_figures_equal` for additional information
3BEA 135141
about their use.

0 commit comments

Comments
 (0)
0