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

Adding a colorbar with matplotlib backend moves the x/y axes into the center of the plot #537

Open
stefmolin opened this issue Nov 5, 2021 · 1 comment

Comments

@stefmolin
Copy link

stefmolin commented Nov 5, 2021

ALL software version info

(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc)

  • Python 3.8
  • jupyterlab 3.1.1
  • geoviews 1.9.1
  • holoviews 1.14.5
  • matplotlib 3.4.3

Description of expected behavior and the observed behavior

Adding the colorbar should not affect the x/y axes of the plot (world map), but it is moving both to the center for some reason.

Complete, minimal, self-contained example code that reproduces the issue

import geoviews as gv
import geoviews.feature as gf
gv.extension('matplotlib')

(gf.land * gf.coastline * gf.borders * gv.Points(
    [{'latitude': 0, 'longitude': 0, 'mag': 7},
     {'latitude': 10, 'longitude': 10, 'mag': 2},
     {'latitude': -10, 'longitude': -10, 'mag': 0}], kdims=['longitude', 'latitude'], vdims='mag'
).opts(color='mag', cmap='fire', colorbar=True)).opts(global_extent=True)

Screenshots or screencasts of the bug in action

image

@jbednar
Copy link
Member

jbednar commented Nov 5, 2021

Yikes! I can reproduce that with geoviews=1.9.2. holoviews=1.14.6, and matplotlib=3.4.3. Hard to see how that could be HoloViews rather than Matplotlib itself, but I'm not sure how to reproduce that with pure Matplotlib.

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

2 participants