Search code examples
python-3.xbokehholoviews

HoloViews Layout Scatter and ErrorBars Different Axis Ranges


I have a layout of two plots that have very different y-axis scales. Is there a way to automatically set the y-axis range for each plot? By default, both plots are initially displayed with the same y-axis range of the second plot. See example below.

A_points = [
    ("2000", 1.5, 0.3, 0.5),
    ("2015", 2.3, 0.7, 0.3)
]
B_points = [
    ("2000", 13000, 800, 200),
    ("2015", 12000, 400, 600)
]

%%opts Scatter (size=10)
(hv.Scatter(A_points, kdims=["Year"], vdims=["A"]) * hv.ErrorBars(A_points, vdims=["y", "yerrneg", "yerrpos"])) + \
(hv.Scatter(B_points, kdims=["Year"], vdims=["B"]) * hv.ErrorBars(B_points, vdims=["y", "yerrneg", "yerrpos"]))


Solution

  • Sure; just specify +axiswise normalization for each of the Element types in your plot:

    axiswise illustration

    The default is to normalize all plots that share the same axes together, but turning on independent normalization per axis will disable that behavior.