-
Notifications
You must be signed in to change notification settings - Fork 367
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
Calling tight_layout between gridlines and set_extent screws up #1792
Comments
Just wanted to mention that this is still an issue with cartopy 0.20.2. I haven't tested with 0.21 though. |
Thanks for testing with 0.21! That means the issue is unchanged for 0.21. |
I have learned quite a lot about the
Since #2249 and #2252 made the updating more efficient, I wonder if we should consider making |
That would make sense to me and call it a bugfix even. People can still turn it off if they want by setting that directly, but it doesn't seem necessary anymore and maybe we should take it a step further and deprecate that option altogether? |
Description
Since cartopy 0.19.0 (this does not apply to 0.18.0), calling
plt.tight_layout()
aftergridlines
, but beforeset_extent
screws up the map extent and the grid lines are drawn for the whole valid extent of the selected projection instead of only the selected extent. In a Jupyter notebook, with%matplotlib widget
, this will lead to no gridline labels and too few lines. With%matplotlib inline
the plotted area is truncated without truncating the gridline labels (see output below).Code to reproduce
In a jupyter notebook:
Output:
Note that there is no problem when the call to
plt.tight_layout()
is moved either beforeax.gridlines
or afterax.set_extent
. In that case, the result looks like this:Full environment definition
Operating system
Ubuntu 20.04
Cartopy version
cartopy 0.19.0.post1 (py38hc9c980b_0) from conda-forge (does not apply to 0.18.0)
conda list
pip list
The text was updated successfully, but these errors were encountered: