Hi @loomaisand ,
As I understand what you mean.
You need to change theta
value with list of degrees where the bar will be positioned.
After doing that the delta theta will not the same, and you can set custom width
of each bar to make certain bar wider.
fig.update_traces(
r=[10, 90, 50, 60, 70, 80],
# set theta as degrees
theta = [0,90,180,225,270,315],
# set color of each bar
marker_color= ["red", "red", "red", "grey", "blue", "red"],
# set custom width of each bar
width=[40, 120, 40, 40, 40, 40],
selector=dict(type='barpolar'))
Replace the tick from degrees to text with update_layout
fig.update_layout(
polar=dict(
angularaxis=dict(
# set custom tick
tickvals=[0,90,180,225,270,315],
# set custom tick text
ticktext=["B_right", "A", "B_left","C1", "C2", "C3"]
)
)
)
Here is the code, when you put together:
import plotly.graph_objects as go
rs = [10, 20, 30, 40, 50, 60, 70, 80]
thetas= ["B_right", "A2", "A1", "A3", "B_left","C1", "C2", "C3"]
fills = ["red", "red", "grey", "blue", "red", "grey", "blue", "red"]
fig = go.Figure()
fig.add_trace(
go.Barpolar(
r=rs,
theta=thetas,
marker_color=fills
)
)
fig.update_traces(
r=[10, 90, 50, 60, 70, 80],
# set theta as degrees
theta = [0,90,180,225,270,315],
# set color of each bar
marker_color= ["red", "red", "red", "grey", "blue", "red"],
# set custom width of each bar
width=[40, 120, 40, 40, 40, 40],
selector=dict(type='barpolar'))
fig.update_layout(
polar=dict(
angularaxis=dict(
# set custom tick
tickvals=[0,90,180,225,270,315],
# set custom tick text
ticktext=["B_right", "A", "B_left","C1", "C2", "C3"]
)
)
)
fig.show()