holoviz / holoviz/hvplot

padding doesn't work with map tiles

Open
#1,475 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

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:
```python
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](https://github.com/user-attachments/assets/4d1edf0c-8298-4867-a407-9c8376f33c19)

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

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.