-
Notifications
You must be signed in to change notification settings - Fork 397
The SuperCuts patch! Clipping done right. #290
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
Conversation
* Clip just about all artists to map limbs, and clip the map limbs to the plot area
attn @cpaulik |
@WeatherGod: Nice one)) I was looking at it myself, but dropped because could not see why it was happening. Cheers |
Our unit tests wouldn't cover this, so I ran the "run_all.py" script in the examples directory. Not only did I check to make sure all of the examples ran correctly, I also would pan all of the interactive plots. With this change, not only does imshow() for robinson projection and others now work, but I can now confirm that all other artists are now clipped to the map, and to the plot area, even when panning/zooming. Of particular concern was the parallels and meridians, the coastlines and other such items, which all works fine now. Technically speaking, this is a behavior change, as the plotting area was often not used for clipping. However, it was very inconsistent whether or not an artist was clipped or not, so I considered that a bug and made everything (except ticklines and tick labels) clipped to the plotting area. |
Thanks for confirming the fix! I am going to go ahead and merge this in. If all goes well (personal schedule-wise), I hope to be cutting a release candidate either this weekend or next weekend. An additional goal is to have the release candidate available on pypi. |
@WeatherGod, not sure if this is related to this, but is there any option to set the thickness of the map boundary, it looks like the top/bottom line are much thinner than the left/right one. Looking closely to the line at the equator makes it also a little bit thinner. I know this is just a facial issue, but maybe you know how to control this? |
Actually, this is an inadvertent side-effect of this recent change. The map limbs are now clipped to the plotting area, which solves a lot of other problems. However, because of the way the limbs are drawn, they go all the way to the edge of the plot area, and get "trimmed" by the clipping. I am not exactly sure how we should address this. I'll have to think about this one. |
Yes, it seems like the lines are trimmed and therefore appear less thick at the top/bottom and the equator. A buffer zone around the lines/clipping area may help? |
Easier said than done, I think. The problem is that the map limbs are done in data coordinates. So, defining a buffer zone around that in points is tricky. Also, I am not sure if there might be other implications as well (thinking of rotpol and such). |
Hmmm, think I just came across another possible side-effect of this set of changes. It apparently has been assumed that set_axes_limits() would be the last method called in each of the plotting methods, so if one was in interactive mode, it would trigger a draw. However, now, that draw would happen before clipping. This might not be terrible, though, with the changes in the interactive mode for matplotlib v1.5, which should trigger another redraw right after the clipping, I think. |
and clip the map limbs to the plot area