Reputation: 185
I have this piece of code. Can I edit the width of error bars using px.scatter?
tab = pd.read_csv("hct.csv")
fig=px.scatter(tab, x="diametro", y="prof", color="s-c", trendline="ols",error_y="erro prof",error_x="erro diam", width=600, height=400)
fig.show()
Upvotes: 3
Views: 2157
Reputation: 61154
You haven't specified whether the width should be set by a numeric variable or if you'd just like to make the line for each error bar a bit wider. But the way to do the latter is, for example:
fig.data[0].error_y.thickness = 12
That will turn this:
Into this:
And it won't matter whether you've built your figure using ploty.express
or plotly.graph_objects
Upvotes: 3