Skip to content
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

colorbar fill whole figure #426

Open
jaodan opened this issue Oct 1, 2018 · 13 comments
Open

colorbar fill whole figure #426

jaodan opened this issue Oct 1, 2018 · 13 comments

Comments

@jaodan
Copy link

jaodan commented Oct 1, 2018

I use the matplotlib3.0 and basemap 1.2 to plot a map figure. The figure is correct. However, if I add colorbar by "m.colorbar(...)", the colorbar will fill the whole figure. There is no such issue for matplotlib2.2.2 and basemap1.1.

@jiaozhh
Copy link

jiaozhh commented Oct 1, 2018

The same problem that can be found in matplotlib/matplotlib#12355

@jklymak
Copy link
Member

jklymak commented Oct 1, 2018

Can you supply a self contained minimal example? Thanks!

@WeatherGod
Copy link
Member

WeatherGod commented Oct 1, 2018 via email

@WeatherGod
Copy link
Member

WeatherGod commented Oct 1, 2018 via email

@jklymak
Copy link
Member

jklymak commented Oct 1, 2018

colorbar changed in 3.0 so that aspect ratios mean something a bit different. So its possible there is a bad interaction there. But an example that doesn't require external data sets would help

@jklymak
Copy link
Member

jklymak commented Oct 1, 2018

This is an axes_toolkit/colorbar/bbox_inches=tight interaction that I can reproduce in Matplotlib.

I'll leave this open at @WeatherGod's discretion; one could imagine basemap not relying on axes_grid for colorbar placement. But thats not to minimize the fact that there is a bug in 3.0 with the above combination....

@jklymak
Copy link
Member

jklymak commented Oct 1, 2018

Just to be clea, this is only an issue if you do: plt.savefig(..., bbox_inches='tight')? Otherwise I cannot reproduce..

@jaodan
Copy link
Author

jaodan commented Oct 1, 2018

@jklymak is correct. The issue come from plt.savefig(...,bbox_inchs='tight'). Without this option, everything is fine.

@CommonClimate
Copy link

The issue come from plt.savefig(...,bbox_inchs='tight'). Without this option, everything is fine.

Well that is a pretty useful option. Any idea when we go back to re-using this essential feature for producing publication-quality figures? Currently (with MPL 3.0.2) I am wasting a bunch of time editing prior scripts to reproduce some work that used to work beautifully with this option, but no longer does. Is there a workaround for producing figures that minimize white space?

@yongjias
Copy link

The latest version has fixed this issue, just use the latest version.

@CommonClimate
Copy link

the latest version of matplotlib appears to be 3.0.2, which is what I am using. are you referring to another package?

@WeatherGod
Copy link
Member

WeatherGod commented Dec 10, 2018 via email

@CommonClimate
Copy link

CommonClimate commented Dec 10, 2018

Problem was due to running the general Spyder and not the environment-specific Spyder. Sorry for adding to the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants