-
Notifications
You must be signed in to change notification settings - Fork 80
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
add_basemap: keep original axis limits of figure #38
add_basemap: keep original axis limits of figure #38
Conversation
Nice! so, just to make sure I get it correctly, this PR will make sure the extent of the plot will stay that of the original plot, not that of the pulled down full image, right? |
Yes, that is correct |
(will add a test if you approve the change) |
Yes, I think this makes sense. Quick question, would this also apply to the case where |
Updated the PR to fix merge conflicts.
For now, I didn't make any distinction between both. And I also updated the test |
Cool. One more thing, could you please add the option of |
contextily/plotting.py
Outdated
@@ -92,8 +93,12 @@ def add_basemap(ax, zoom=ZOOM, url=sources.ST_TERRAIN, | |||
# Plotting | |||
ax.imshow(image, extent=extent, | |||
interpolation=interpolation, **extra_imshow_args) | |||
|
|||
ax.axis((xmin, xmax, ymin, ymax)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think giving the option should just be adding here:
if reset_extent:
ax.axis(...)
@jorisvandenbossche I've cleaned conflicts in one of the tests with current |
Whoops, looks like this introduces errors on the tests now... https://travis-ci.org/darribas/contextily/jobs/522345969 These are in addition to the 3.5 issue and come up in 3.6. Would you mind having a look into it @jorisvandenbossche? |
d8edd3b
to
369a39e
Compare
…tion to reset extent or not (#1)
369a39e
to
f53e394
Compare
Opening this for discussion: in my original implementation (http://geopandas.readthedocs.io/en/latest/gallery/plotting_basemap_background.html#contextily-helper-function) I reset the axis limits to the original ones when the
ax
is passed to the function.One reason to do this: the extent of the figure does not depend on the zoom level (on how many tiles are merged).
Closes https://github.com/darribas/contextily/issues/45