diff --git a/examples/user_guide/Timeseries_Data.ipynb b/examples/user_guide/Timeseries_Data.ipynb index e4ebe709f..18fc67563 100644 --- a/examples/user_guide/Timeseries_Data.ipynb +++ b/examples/user_guide/Timeseries_Data.ipynb @@ -56,6 +56,23 @@ "sst.hvplot(xformatter=formatter)" ] }, + { + "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." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "sst.hvplot(autorange=\"y\")" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/hvplot/converter.py b/hvplot/converter.py index f17e81f56..b7d119038 100644 --- a/hvplot/converter.py +++ b/hvplot/converter.py @@ -84,6 +84,9 @@ class HoloViewsConverter: """ Generic options --------------- + autorange (default=None): Literal['x', 'y'] | None + Whether to enable auto-ranging along the x- or y-axis when + zooming. clim: tuple Lower and upper bound of the color scale cnorm (default='linear'): str @@ -383,7 +386,8 @@ def __init__( y_sampling=None, project=False, tools=[], attr_labels=None, coastline=False, tiles=False, sort_date=True, check_symmetric_max=1000000, transforms={}, stream=None, - cnorm=None, features=None, rescale_discrete_levels=None, **kwds + cnorm=None, features=None, rescale_discrete_levels=None, + autorange=None, **kwds ): # Process data and related options self._redim = fields @@ -485,6 +489,8 @@ def __init__( if ylim is not None: plot_opts['ylim'] = tuple(ylim) + plot_opts['autorange'] = autorange + self.invert = invert if loglog is not None: logx = logx or loglog