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

padding doesn't work with map tiles #1475

Open
rsignell opened this issue Jan 22, 2025 · 4 comments
Open

padding doesn't work with map tiles #1475

rsignell opened this issue Jan 22, 2025 · 4 comments

Comments

@rsignell
Copy link

rsignell commented Jan 22, 2025

I want to plot a single station location (lon,lat point) on a map, but set a larger lon/lat extent than default so I can more easily see the "big picture" for where the point is located.

@ahuang11 suggested I post an issue here, as padding should work, but seems to fail when map tiles are specified.

For example, this code:

import hvplot.pandas
import pandas as pd

# Create a DataFrame with the single lon, lat point
data = {'lon': [-70.4], 'lat': [42.35]}  # A point in Massachusetts Bay
df = pd.DataFrame(data)
df.hvplot.points('lon', 'lat', geo=True, size=10, color='red', tiles='ESRI', padding=2.0)

results in plot where it seems the padding was just ignored:

Image

My workaround is to calculate and specify the xlim and ylim, but it would be nice if padding just worked!

I'm running WSL on Windows 11 with:

(pangeo) rsignell@OSC:~$ conda list | grep -E "bokeh|pyviz|widgets|hvplot|geoviews|holoviews|panel|datashader"
bokeh                     3.6.2              pyhd8ed1ab_1    conda-forge
datashader                0.16.3             pyhd8ed1ab_1    conda-forge
geoviews                  1.14.0               hd8ed1ab_0    conda-forge
geoviews-core             1.14.0             pyha770c72_0    conda-forge
holoviews                 1.20.0             pyhd8ed1ab_1    conda-forge
hvplot                    0.11.2             pyhd8ed1ab_0    conda-forge
ipywidgets                8.1.5              pyhd8ed1ab_1    conda-forge
jupyterlab_widgets        3.0.13             pyhd8ed1ab_1    conda-forge
panel                     1.5.4              pyhd8ed1ab_0    conda-forge
pyviz_comms               3.0.3              pyhd8ed1ab_0    conda-forge
widgetsnbextension        4.0.13             pyhd8ed1ab_1    conda-forge

@holovizbot
Copy link

This issue has been mentioned on HoloViz Discourse. There might be relevant details there:

https://discourse.holoviz.org/t/setting-padding-in-hvplot-when-using-tiles/8521/10

@philippjfr
Copy link
Member

philippjfr commented Jan 22, 2025

Thanks @rsignell, I think it's way past time we revisited the map tiles renderer implementation in Bokeh which is at fault for a lot of the oddities (like this one) that happen if you add a tile to your plot.

@maximlt
Copy link
Member

maximlt commented Jan 23, 2025

@philippjfr if you have more concrete ideas on the changes required in Bokeh to improve this, I encourage you to capture them in a Bokeh issue 🙃

@rsignell
Copy link
Author

Thanks @philippjfr and @maximlt for jumping in on this!

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

4 participants