You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can round the corners on all bar traces in a figure by setting `barcornerradius` on the figure's layout. `barcornerradius` can be a number of pixels or a percentage of the bar width (using a string ending in %, for example "20%").
491
+
492
+
In this example, we set all bars to have a radius of 15 pixels.
493
+
494
+
```python
495
+
import plotly.graph_objects as go
496
+
from plotly import data
497
+
498
+
df = data.medals_wide()
499
+
500
+
fig = go.Figure(
501
+
data=[
502
+
go.Bar(x=df.nation, y=df.gold, name="Gold"),
503
+
go.Bar(x=df.nation, y=df.silver, name="Silver"),
504
+
go.Bar(x=df.nation, y=df.bronze, name="Bronze"),
505
+
],
506
+
layout=dict(
507
+
barcornerradius=15,
508
+
),
509
+
)
510
+
511
+
fig.show()
512
+
```
513
+
514
+
When you don't want all bar traces in a figure to have the same rounded corners, you can instead configure rounded corners on each trace using `marker.cornerradius`. In this example, which uses subplots, the first trace has a corner radius of 30 pixels, the second trace has a bar corner radius of 30% of the bar width, and the third trace has no rounded corners set.
0 commit comments