-
Notifications
You must be signed in to change notification settings - Fork 6
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
"No non overlapping boxes found" when trying to arrange labels on cartopy map? #12
Comments
I am not familiar with this way of plotting maps, but if there is this sort of built in transform I do not expect it to work with the current version of this package. I am not sure if I should even try to solve this one, or just suggest a workaround, which I believe works somewhat okay by extracting the OSM-image as an array, and then using the standard way of plotting images:
This works right, or what do you think? |
That's very clever, and it certainly looks right! However, trying to run your code on my machine errors out:
Does the code you posted work as is for you? |
This is really odd. The byte buffer saved to io_buf is one byte too short for the reshape to 3079x3079, but also, the height returned from ax.get_window_extent() is one pixel too many at 3080. |
Yes, it works as is, very strange! Maybe it is some issue with versions of the relevant packages? Here are mine: |
Created a new conda env with the exact same versions as you - no luck. Same error. I'm on MacOS. What OS are you on? |
I'm right now on Ubuntu (WSL). I guess there are easier ways to download OSM-images if you don't have to use Cartopy. It would be great if this package could support your original code, but it seems quite complex and I don't have that much time to look at it right now, so don't expect a quick solution this way. |
Hi again, I have made an update which should solve the original issue. To avoid adding cartopy as a dependency I found no better way than to add another argument src_crs for now, which is required together with the transform argument. The value you should use for PlateCarree() is found in the code below. I am closing this issue with this change, but if this solution is not sufficient it might be necessary to start using display coordinates instead of data coordinates, which will require bigger changes in this repo.
|
This is an amazing tool for "regular" data plots... however I can't seem to get it to work when labelling geographic data on a cartopy plot.
Entertain the code below if you will to illustrate the behaviour. The labels do overlap, and the message "No non overlapping boxes found" is shown.
The text was updated successfully, but these errors were encountered: