Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

How to retrieve Histogram max bin count?

I created a histogram using the graph_objects.Histogram. Is there any way to retrieve the bin counts for each of the bins? I am adding a vertical line (shape) to my figure, to represent a specific value on the x-axis. When creating a line, you set the y1 to represent where the line should stop being drawn. I would like to draw this line up to the largest bin count across my bins.


hi @davey I don’t think this is possible… You can take advantage of the fact that the largest bin count is close to the top of the plot to create a line with xref:x (data coordinates) y=0.95, yref=paper ( but it’s a hack…

1 Like

Thanks @Emmanuelle, the hack was good enough for me. It would be nice if the graph figures could draw this line versus creating a Shape.