How to adjust width of Bar Chart

Hello!

I’m creating a Candlestick chart on y0 and a Bar chart on y1, sharing the same X axis.
But the Bar chart not display well. How to adjust width of Bar chart?
Maybe it is because the auto adjustment of Bar chart due to the data.

Good case:
6
Bad case:
4

You give the go.Figure a list with all the desired widths.
See under " Customizing Individual Bar Widths " in here:

Thanks, Blaceus.

Maybe I have found a bug in Bar Chart’s width property.
when X axis is numeric, it looks good, like the document you refered.

But when X axis is type of datetime, there is nothing show in the figure.
666

Hey @Morgan, I’m having the same issue here. Did you find a fix?

Hey @Juanouo, I’m also having the same issue. Did you kind a solution?

Hey @pepito. I discovered datetime width is measured in milliseconds, which means, you’ll need a width of:

1000 * 3600 * 24 * 31

To have a one month width. If your time series is large, you’ll have to take into account gap years and the like and probably manually program each width. A bit cumbersome if you ask me

1 Like