Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
707 views
in Technique[技术] by (71.8m points)

plotly - Selecting the values of a row for r in a scatterpolar

I'm trying to build a scatterplot and have problems with assigning the correct r value. Here you have a glimpse at my dataset:

Dataset

As you see, the first column represents the names of bikes, columns 2 to 11 show different geometry data. I want the scatterpolar to look like this:

plot_ly(
  type = 'scatterpolar',
  mode = 'markers',
  fill = "toself",
  r = c(435, 65.5, 629, 1193, 434, 440, 73.5, 635, 100, 32),
  theta = c("Kettenstrebe", "Lenkwinkel","Oberrohr","Radstand","Reach","Sattelrohr","Sitzwinkel","Stack","Steuerrohr",
                  "Tretlagerabsenkung"),
  showlegend = TRUE,
  name = ComparisonTable[1,1])

Scatterpolar

How can I define the r value in a way, that it automatically shows the values of the desired row?

I tried the following code, but without success:

plot_ly(
  type = 'scatterpolar',
  mode = 'markers',
  fill = "toself",
  r = as.matrix(ComparisonTable[1]),
  theta = c("Kettenstrebe", "Lenkwinkel","Oberrohr","Radstand","Reach","Sattelrohr","Sitzwinkel","Stack","Steuerrohr",
                  "Tretlagerabsenkung"),
  showlegend = TRUE,
  name = ComparisonTable[1,1])

I am happy to get your expertise on the problem!

question from:https://stackoverflow.com/questions/65873920/selecting-the-values-of-a-row-for-r-in-a-scatterpolar

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...