-
Notifications
You must be signed in to change notification settings - Fork 365
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
Gridliner tick labels are attached to background patch, not to the boundary spines #1541
Comments
Sorry, I was not able to reproduce the figure. |
I'm able to reproduce this on both The versions of mpl and Cartopy I'm using are: |
I've been able to reproduce it by playing with the zoom tool in intercative mode.
This means that lines and labels are recomputed and redrawn everytime, but it works well. |
I'd say those are two different features, so a new different PR may be better? What you say makes sense to me. I only wonder if you need to redraw every single time, or if you can just update the transforms/locations of the already drawn items so that it can be rendered faster by keeping the same artists that are already present? |
I agree with about creating another PR, once PR #1537 (not #1538) is merged. About refreshing, It seems to be fast enough to be acceptable, since only the lines and labels are redrawn. The point of doing it this way is that when you zoom in for instance, you may quickly no longer have grid line and label. This makes the system really nice! |
I'm ready to make a PR, once #1537 is ok since the former starts from the latter. |
Closed by #1537 |
Hello, I'm using cartopy 0.20.1 and matplotlib 3.5.0 and I'm getting this issue with the tick labels moving with the background (which I can reproduce using the code in the first post above) - was this actually supposed to have been fixed, and if so is any modification of the code necessary? Or is there code that can be used in the meantime to make this work? (bringing to attention of @stefraynaud since you seem to be the person who has worked on fixing this) |
Hi @PAGWatson Try to pass the |
@stefraynaud - thanks, yes that seems to work. This feature seems quite hidden in the docs, I hadn't found it after quite a bit of searching - it would perhaps be good if it were included in a plotting example somewhere. |
You are right. We should add content to the documentation on the gridliner capabilities. |
@stefraynaud An issue I came across with this is that if I run code in a jupyter notebook, set auto_update=True and set gridlines to be added to the plot (e.g. gl.bottom_labels=True), then if I've not run "%matplotlib notebook" beforehand I get an error, the last part of which is copied below. I found that I could prevent it by only setting the auto_update option if matplotlib.get_backend()!='module://matplotlib_inline.backend_inline' . I'm not sure if there are other situations where it could fail and if there's a better check. It took a while to find a solution for this, so it would be helpful if the code checked that this error wouldn't occur and gave a warning or something. I got this with both matplotlib 3.5.0 and 3.5.1 with cartopy 0.20.1.
|
Description
When panning on a map, the tick labels are attached to the background and move around with the pan. I would expect them to be attached to the boundary and be right on the axes spines.
Here is an example where I panned over a little bit.
I came across this looking at the recent Gridliner example in #1537
@stefraynaud, I'm going to ping you here since you've dealt a lot with the gridliner ticks.
Code to reproduce
Full environment definition
Reproduced on both `macosx` and `qt5agg` backends.matplotlib==3.2.0
cartopy==0.18.0b3.dev25+
Cartopy version
master
The text was updated successfully, but these errors were encountered: