【发布时间】:2021-10-31 02:04:40
【问题描述】:
library(dplyr)
library(plotly)
library(plyr)
df <- data.frame(
Category = c('foo', 'bar', 'bar', 'foo'),
x = c(2.1, 3.4, 4, 4),
y = c(16, 21, 10, 17)
)
palette <- c("#007700", "#cc0000")
fig <- plot_ly(data = df, x = ~x, y = ~y, size = 10, color = ~Category,
colors = palette)
fig
如何将foo 点绘制为正方形,将bar 点绘制为三角形?
【问题讨论】:
标签: r plotly scatter-plot