Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在r中的同一图形上绘制多个列表(散点图)_R_Plot_Scatter Plot - Fatal编程技术网

在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非常感谢。祝你今天愉快@莫里:当然,我会检查一下的。谢谢