Skip to content

colorbar fill whole figure #426

Open

Description

@jaodan

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.

Activity

  1. jiaozhh commented on Oct 1, 2018

    @jiaozhh

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

  2. jklymak commented on Oct 1, 2018

    @jklymak
    Member

    Can you supply a self contained minimal example? Thanks!

  3. WeatherGod commented on Oct 1, 2018

    @WeatherGod
    Member
  4. WeatherGod commented on Oct 1, 2018

    @WeatherGod
    Member
  5. jklymak commented on Oct 1, 2018

    @jklymak
    Member

    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

  6. jklymak commented on Oct 1, 2018

    @jklymak
    Member

    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....

  7. jklymak commented on Oct 1, 2018

    @jklymak
    Member

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

  8. jaodan commented on Oct 1, 2018

    @jaodan
    Author

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

  9. CommonClimate commented on Dec 10, 2018

    @CommonClimate

    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?

  10. yongjias commented on Dec 10, 2018

    @yongjias

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

  11. CommonClimate commented on Dec 10, 2018

    @CommonClimate

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

  12. WeatherGod commented on Dec 10, 2018

    @WeatherGod
    Member
  13. CommonClimate commented on Dec 10, 2018

    @CommonClimate

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions