In matplotlib we can change the limits of the x-axis with the xlim() method. Is there an equivalent method in HoloViews?
I searched the HV options page, but didn't find anything that seemed to do this.
I created the image below with the following code in a Jupyter notebook:
import numpy as np
import holoviews as hv
hv.notebook_extension('bokeh', width=90)
values = np.array([list of floats])
frequencies, edges = np.histogram(values, 10)
hv.Histogram(frequencies, edges)
How can I change the x-axis limit to [0.002, 0.016].
Also, is it possible to get a plot to return its current x-axis limit?
HoloViews will usually just use the bounds of the data you give it. So the easiest way to change the bounds of a histogram is to change it in the np.histogram call itself:
If you simply want to change the viewing extents you can do also set those directly:
where extents is defined as
(xmin, ymin, xmax, ymax)
.