-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Use matplotlib's compare_images to check plots #5379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
ggplot has some similar code which can be used similar to matplotlibs Testing is very easy:
or via the decorator:
It will compare the current images to once which are in The fork of the decorator was needed for two reasons: using it outside of matplotlib can only be done after matplotlib 1.1.1 (which we test against) and we also wanted to change some antialising settings which were hardcoded in matplotlib. I also changed the code to only produce/compare png images (yhat/ggpy@901f049). ggplot also has a https://github.com/yhat/ggplot/blob/master/visual_tests.py which generates a browser page which can be used to visually compare the images. |
I would be interested in this - if this is still requiring a PR ? If so, do all the plotting tests need to be dealt with in this PR itself or split into different ones ? Is there a preference for using |
I tried using this for a personal project 5ish years ago and found that I got very slightly different images on different machines (mac vs ubuntu), python versions, dependency versions, ... In the end I threw in the towel on it. I'd be happy to find I was doing something wrong. |
With #5378 - could be a good time to start comparing against images for these plotting tests... matplotlib has a test function and GeoPandas is working on it here - geopandas/geopandas#43, so we could work off of their example, maybe a decorator that handles ensure_clean and comparisons...
The text was updated successfully, but these errors were encountered: