Skip to content
31 changes: 31 additions & 0 deletions doc/gallery/geospatial/map_overlay.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,37 @@
")"
]
},
{
"cell_type": "markdown",
"id": "8c428430",
"metadata": {},
"source": [
"If `xlim` and `ylim` are in `lat`/`lon` coordinates, they will be automatically transformed to Web Mercator coordinates."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we should document things this way in the gallery. Which is why I suggested doing it in the tiles example section, as this behavior is only enabled when tiles is enabled. For this example, I simply suggest updating the original snippet with xlim=..., ylim=....

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying, that makes sense. I wasn’t really sure what “a real example in the tiles section” referred to since I haven't worked in hvplot docs for a while, so just a heads up a quick link to the hvPlot docs section would be helpful for future comments / contributors! 🙇🏻

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! 👍

]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4fa7dd18",
"metadata": {},
"outputs": [],
"source": [
"df.hvplot.points(\n",
" x='lon',\n",
" y='lat',\n",
" xlim=(80, 120),\n",
" ylim=(-15, 30),\n",
" tiles=True,\n",
" tiles_opts={'alpha': 0.3},\n",
" alpha=0.6,\n",
" color='mag',\n",
" cmap='viridis_r',\n",
" title='Earthquake Map Overlay (Bokeh)',\n",
" xlabel='Longitude',\n",
" ylabel='Latitude',\n",
")"
]
},
{
"cell_type": "markdown",
"id": "753fbf24-e6e8-4df6-ae19-1ae040aeeed5",
Expand Down
4 changes: 3 additions & 1 deletion doc/ref/plotting_options/axis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,9 @@
"(option-xlim_ylim)=\n",
"## `xlim / ylim`\n",
"\n",
"The x- and y-axis ranges can be defined with the `xlim` and `ylim` options, respectively. These options accept a 2-tuple representing the minimum and maximum bounds of the plotted ranged. One bound can be left unset by using `None` (e.g. `xlim=(10, None)` means there is no upper bound)."
"The x- and y-axis ranges can be defined with the `xlim` and `ylim` options, respectively. These options accept a 2-tuple representing the minimum and maximum bounds of the plotted ranged. One bound can be left unset by using `None` (e.g. `xlim=(10, None)` means there is no upper bound).\n",
"\n",
"If `tiles` is provided and the `xlim` and `ylim` are in `lat`/`lon` coordinates, they will be automatically transformed to Web Mercator coordinates."
]
},
{
Expand Down
Loading