This is my code:
trace1 = go.Scatterpolar(
r = r,
theta = theta,
mode='markers',
marker=dict(
size=12,
color= iris.target,
opacity=1
)
)
dc_1 = go.Scatterpolar( r = [0,V_r[0][0]],
theta = [0,V_r[0][1]],
marker = dict( size = 1,
color = "rgb(84,48,5)"),
line = dict( color = "red",
width = 6),
name = "Var1"
)
dc_2 = go.Scatterpolar( r = [0,V_r[1][0]],
theta = [0,V_r[1][1]],
marker = dict( size = 1,
color = "rgb(84,48,5)"),
line = dict( color = "green",
width = 6),
name = "Var2"
)
dc_3 = go.Scatterpolar( r = [0,V_r[2][0]],
theta = [0,V_r[2][1]],
marker = dict( size = 1,
color = "rgb(84,48,5)"),
line = dict( color = "blue",
width = 6),
name = "Var3"
)
dc_4 = go.Scatterpolar( r = [0,V_r[3][0]],
theta = [0,V_r[3][1]],
marker = dict( size = 1,
color = "rgb(84,48,5)"),
line = dict( color = "yellow",
width = 6),
name = "Var4"
)
data = [dc_1,dc_2,dc_3,dc_4, trace1]
layout = go.Layout(
xaxis=dict(
title='PC1',
rangemode='tozero',
titlefont=dict(
family='Courier New, monospace',
size=18,
color='#080707'
)
)
)
fig = go.Figure(data=data, layout=layout)
plot(fig, filename='Scatter polar, PCA.')
And this is the graph resultant:
As you can see, currently the lines of the variables start from “0”, but the origin of coordinates is in r = - 5 (since that is the first value it receives) how can I set it to r = 0?