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

Improve autorange docs #1158

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions examples/user_guide/Timeseries_Data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"source": [
"import hvplot.pandas # noqa\n",
"from bokeh.sampledata.sea_surface_temperature import sea_surface_temperature as sst\n",
"\n",
"sst.hvplot()"
]
},
Expand Down Expand Up @@ -60,8 +61,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Auto range\n",
"Automatic auto-ranging on the data in x or y is supported, making it easy to scale the given axes and fit the entire visible curve after a zoom or pan."
"### Auto-range\n",
"\n",
"*(Available with HoloViews >= 1.16)*\n",
"\n",
"Automatic ranging, aka auto-ranging, on the data in x or y is supported, making it easy to scale the given axes and fit the entire visible curve after a zoom or pan. Try zooming in on the plot and panning around, the y range nicely adapt to fit the curve. "
]
},
{
Expand Down
7 changes: 5 additions & 2 deletions hvplot/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class HoloViewsConverter:
---------------
autorange (default=None): Literal['x', 'y'] | None
Whether to enable auto-ranging along the x- or y-axis when
zooming.
zooming. Requires HoloViews >= 1.16.
clim: tuple
Lower and upper bound of the color scale
cnorm (default='linear'): str
Expand Down Expand Up @@ -494,7 +494,10 @@ def __init__(
if ylim is not None:
plot_opts['ylim'] = tuple(ylim)

plot_opts['autorange'] = autorange
if autorange is not None and hv_version < Version('1.16.0'):
param.main.param.warning('autorange option requires HoloViews >= 1.16')
else:
plot_opts['autorange'] = autorange

self.invert = invert
if loglog is not None:
Expand Down