Thanks for using the forum!
I think that what you are looking for is the fact that px.histogram()
accepts an nbins
parameter which allows you to set the size of the bins in your histogram.
For example:
import plotly.express as px
df = px.data.tips()
fig = px.histogram(df, x="total_bill", nbins=20)
fig.show()
This is documented at https://plotly.com/python/histograms/#choosing-the-number-of-bins
I hope this answers your question!