File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ tests it::
109
109
import matplotlib.pyplot as plt
110
110
111
111
@image_comparison(baseline_images=['line_dashes'], remove_text=True,
112
- extensions=['png'])
112
+ extensions=['png'], style='mpl20' )
113
113
def test_line_dashes():
114
114
fig, ax = plt.subplots()
115
115
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
130
130
baseline method). The decorator will arrange for setting up the figures and
131
131
then collect the drawn results and compare them.
132
132
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
+
133
139
See the documentation of `~matplotlib.testing.decorators.image_comparison ` and
134
140
`~matplotlib.testing.decorators.check_figures_equal ` for additional information
135
141
about their use.
You can’t perform that action at this time.
0 commit comments