簡體   English   中英

R plotly:在3D散點圖上調整絕對標記大小

[英]R plotly: Adjust absolute marker size on 3D scatterplot

我正在使用R中的plotly創建一個3D散點圖,我想減少所有點的標記大小。

library(plotly)
plot_ly(iris,x=~Petal.Width,y=~Sepal.Width,z=~Petal.Length) %>% 
add_markers(color=~Species)

默認

我試圖設置sizes參數,但這似乎沒有改變任何東西。

plot_ly(iris,x=~Petal.Width,y=~Sepal.Width,z=~Petal.Length) %>%
  add_markers(color=~Species,sizes=0.02)

還嘗試了另一個參數sizeref 但是,沒有任何反應。

plot_ly(iris,x=~Petal.Width,y=~Sepal.Width,z=~Petal.Length) %>%
  add_markers(color=~Species,marker=list(sizeref=0.02))

任何其他解決方案,以減少所有點的標記大小? 或者我做錯了什么?

你很接近,參數是size ,標記應該進入plot_ly()而不是add_markers()

library(plotly)
plot_ly(iris,x=~Petal.Width,y=~Sepal.Width,z=~Petal.Length,
        marker = list(size = 20)) %>% 
   add_markers(color=~Species)

在此輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM