You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use the check_figures_equal in testing to compare figures. This decorator uses two figure instances fig_test and fig_ref for comparison. If we set any figure properties (like facecolor) in the test, they don't seem to be propagated when saving the actual figure.
Ran into this while writing a test for #24816 (cc @anntzer, for reference)
This test passes, which suggests that the two figures created are equal but they actually aren't since the facecolor for both figures are set to be different.
Expected outcome
This test shouldn't pass and the figures should have facecolors "teal" and "none" respectively.
Additional information
No response
Operating system
Arch
Matplotlib Version
3.6.0.dev1889+gc59a7fa8db.d20230103
Matplotlib Backend
No response
Python version
3.10
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered:
I haven't actually checked, but are you sure this is not due to a combination of a) tests defaulting to running with the classic (pre-mpl2) style and b) classic style setting savefig.facecolor = savefig.edgecolor = w? (The new default style sets savefig.facecolor = savefig.edgecolor = auto, which means "don't change it".)
It is indeed because of the default style being classic. I added an option to change style to the decorator and it worked with "mpl20". Shouldn't check_figures_equal also have an option like image_comparison to set style?
Bug summary
We use the
check_figures_equal
in testing to compare figures. This decorator uses two figure instancesfig_test
andfig_ref
for comparison. If we set any figure properties (likefacecolor
) in the test, they don't seem to be propagated when saving the actual figure.Ran into this while writing a test for #24816 (cc @anntzer, for reference)
Code for reproduction
Actual outcome
This test passes, which suggests that the two figures created are equal but they actually aren't since the facecolor for both figures are set to be different.
Expected outcome
This test shouldn't pass and the figures should have facecolors "teal" and "none" respectively.
Additional information
No response
Operating system
Arch
Matplotlib Version
3.6.0.dev1889+gc59a7fa8db.d20230103
Matplotlib Backend
No response
Python version
3.10
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered: