在r中的同一图形上绘制多个列表(散点图)
我试图根据下面的代码绘制一个类似下图的图形:在r中的同一图形上绘制多个列表(散点图),r,plot,scatter-plot,R,Plot,Scatter Plot,我试图根据下面的代码绘制一个类似下图的图形: xAxisName将所有“car”对象放入列表,用bind_行绑定并使用ggplot,然后转向“long”格式并使用ggplot library(ggplot2) library(dplyr) library(tidyr) mget(ls(pattern = '^car\\d+$')) %>% bind_rows(.id = 'car') %>% pivot_longer(cols = -car) %>%
xAxisName将所有“car”对象放入列表
,用bind_行
绑定并使用ggplot
,然后转向“long”格式并使用ggplot
library(ggplot2)
library(dplyr)
library(tidyr)
mget(ls(pattern = '^car\\d+$')) %>%
bind_rows(.id = 'car') %>%
pivot_longer(cols = -car) %>%
ggplot(aes(x = name, y = value, color = car)) +
geom_point()+
scale_y_continuous(expand = c(5, 6))
有没有一种方法可以把汽车的价值并排画出来,但不在同一条线上?明白了,谢谢!我明天会给这个贴标签post@moli非常感谢。祝你今天愉快@莫里:当然,我会检查一下的。谢谢