How to add a histogram to just the x-axis?

Hi! I’m wondering how I add a histogram to just the x-axis.

Surprisingly (to me) this adds a histogram to the y-axis:

import holoviews as hv
import vega_datasets

iris = vega_datasets.data.iris()

hv.Points(iris[["sepalLength", "sepalWidth"]]).hist("sepalLength")

As does this:

pts = hv.Points(iris[["sepalLength", "sepalWidth"]])
xhist = hv.operation.histogram(pts, dimension="sepalLength")
pts << xhist

How do I attach a histogram to just the x-axis without also having a histogram on the y-axis?

I also wonder how this can be done.
The only documentation I could find about hv.AdjointLayout() is: http://holoviews.org/reference/elements/bokeh/Histogram.html

I noticed there’s 3 positions in a AdjointLayout: ‘main’, ‘right’ and ‘top’.
So I wonder if there’s a way to point out specifically which plot should go where in the AdjointLayout.

1 Like

So AdjointLayout is kind of unfortunate in its design, the easiest way to do this is to adjoin an Empty element in the position on the right:

scatter = hv.Scatter(np.random.rand(100, 2))

scatter << hv.Empty() << scatter.hist(adjoin=False)