I’m testing a simple timeline plot as follows:
df = pd.DataFrame([ dict(Task="Job A", Start='2009-01-01', Finish='2009-02-20', Resource="Alex"), dict(Task="Job C", Start='2009-02-21', Finish='2009-05-30', Resource="Max") ]) fig = px.timeline(df, x_start="Start", x_end="Finish", y="Task", color="Resource") fig.show()
To remove the gap, I was able to achieve it using
fig.update_layout(bargap=0), and it’s all great.
However, I feel that the bar is too thickness. How can I correctly reduce it? I tried
fig.update_traces(width=0.7), but this makes the bar gap visible again.
How can I come around this? I don’t wish to reduce the entire plot size, because other operation can load in many data and the entire space is needed to display all the rows. Something like this, for example (sorry for the quick paint edit).