R 雷达绘图仪的美学变化
我想更改以下plotly雷达图的反转颜色,并删除轴标签中的-0.2。此图由以下代码生成:R 雷达绘图仪的美学变化,r,plotly,R,Plotly,我想更改以下plotly雷达图的反转颜色,并删除轴标签中的-0.2。此图由以下代码生成: fig <- plot_ly( type = 'scatterpolar', fill = 'toself' ) fig <- fig %>% add_trace( r = as.numeric(threats.mod["Country avg.", ]), theta = threat.lab
fig <- plot_ly(
type = 'scatterpolar',
fill = 'toself'
)
fig <- fig %>%
add_trace(
r = as.numeric(threats.mod["Country avg.", ]),
theta = threat.labs,
name = 'Country Avg.'
) %>%
add_trace(
r = as.numeric(threats.mod["Selection", ]),
theta = threat.labs,
name = 'Selection'
) %>%
layout(
polar = list(
radialaxis = list(
visible = T,
range = c(-0.2,1)
)
)
)
fig
fig%
添加跟踪(
r=作为.numeric(威胁.mod[“选择”,]),表示,
θ=威胁。实验室,
名称='Selection'
) %>%
布局(
polar=列表(
径向轴=列表(
可见=T,
范围=c(-0.2,1)
)
)
)
无花果
以下是我如何修复它的:
fig <- plot_ly(
type = 'scatterpolar',
fill = 'toself',
marker = list(colorscale="Greys")
)
fig <- fig %>%
add_trace(
r = as.numeric(threats.mod["Country avg.", ]),
theta = threat.labs,
name = 'Country Avg.',
fillcolor=rgb(153, 213, 148, 150, maxColorValue = 255),
marker=list(color=rgb(153, 213, 148, maxColorValue = 255))
) %>%
add_trace(
r = as.numeric(threats.mod["Selection", ]),
theta = threat.labs,
name = 'Selection',
fillcolor=rgb(252, 141,89, 150, maxColorValue = 255),
marker=list(color=rgb(252, 141, 89, maxColorValue = 255))
) %>%
layout(
polar = list(
radialaxis = list(
visible = T,
range = c(-20,100),
tickmode = "array",
tickvals = c(0, 50, 100),
ticktext = c("0%", "50%", "100%"),
angle= 0,
tickangle = 0
)
)
)
fig%
添加跟踪(
r=作为.numeric(威胁.mod[“选择”,]),表示,
θ=威胁。实验室,
名称='选择',
fillcolor=rgb(252141,89150,maxColorValue=255),
标记=列表(颜色=rgb(252、141、89、maxColorValue=255))
) %>%
布局(
polar=列表(
径向轴=列表(
可见=T,
范围=c(-20100),
tickmode=“数组”,
tickvals=c(0,50,100),
ticktext=c(“0%,“50%,“100%”),
角度=0,
滴答声角度=0
)
)
)
制作一张从-0.2开始的雷达图真的有意义吗?它是一种可以绘出类似于雷达图的图形结果的设备,雷达图的核心是空的。