R 用ggplot更改ylim

R 用ggplot更改ylim,r,ggplot2,plot,R,Ggplot2,Plot,我有此代码,但当我尝试打印绘图时,它显示如下: 是否可以更改y轴以每0.5打印一个值?我的意思是从0到7每0.5 当我使用scale\u y\u discrete(limits=c(0,7),breaks=seq(0,7,by=0.5))绘图中没有任何内容,出现以下消息: ggplot(parte2, aes(fct_reorder(INDICE, TIEMPO2, min), y=value, color = variable),ylim=c(0,7)) + geom_point(aes(

我有此代码,但当我尝试打印绘图时,它显示如下:

是否可以更改y轴以每0.5打印一个值?我的意思是从0到7每0.5

当我使用
scale\u y\u discrete(limits=c(0,7),breaks=seq(0,7,by=0.5))
绘图中没有任何内容,出现以下消息:

ggplot(parte2, aes(fct_reorder(INDICE, TIEMPO2, min), y=value, color = variable),ylim=c(0,7)) + 
geom_point(aes(y = TIEMPO1, col = "f1(v)")) + 
geom_point(aes(y = TIEMPO2, col = "f2(v)")) + 
geom_point(aes(y = TIEMPO3, col = "f3(v)")) +
labs(title="Tiempos obtenidos", x ="Identificador Prueba", y = "Tiempo en segundos")
我的数据如下:

    Warning messages:
1: Continuous limits supplied to discrete scale.
Did you mean `limits = factor(...)` or `scale_*_continuous()`? 
2: Removed 42 rows containing missing values (geom_point). 
3: Removed 42 rows containing missing values (geom_point). 
4: Removed 42 rows containing missing values (geom_point). 
5: Position guide is perpendicular to the intended axis. Did you mean to specify a different guide `position`? 
这可以起到以下作用:

structure(list(V1 = c("8600108166784055888L", "-6507824305763562165L", 
"-1372751961323668699L", "2774902296422635368L", "8972986591681446237L"
), V2 = c(12L, 18L, 6L, 2L, 4L), V3 = c("3,51", "1,67", "1,42", 
"3,30", "3,00"), V4 = c("0,22", "0,50", "0,55", "0,60", "0,60"
), V5 = c("1,05", "3,60", "1,28", "4,36", "1,71")

尝试
scale\u y\u discrete(极限=c(0,7),中断=seq(0,7,by=0.5))
。你可以根据自己的需要更改。我的y轴不工作,我编辑了问题这里有问题。y轴是离散的还是连续的?@IvanG请添加一些数据样本,以便使用
dput(head(yourdata,30))
当我运行此代码时,不要显示y轴@IvanG请添加一些数据以便提供帮助,使用
dput(yourdata)
编辑问题并粘贴输出。我们是来帮忙的。
library(ggplot2)
#Code
ggplot(parte2, aes(fct_reorder(INDICE, TIEMPO2, min),
                   y=value, color = variable),ylim=c(0,7)) + 
  geom_point(aes(y = TIEMPO1, col = "f1(v)")) + 
  geom_point(aes(y = TIEMPO2, col = "f2(v)")) + 
  geom_point(aes(y = TIEMPO3, col = "f3(v)")) +
  scale_y_discrete(breaks=as.character(seq(0,7, by=0.5)))+
  labs(title="Tiempos obtenidos",
       x ="Identificador Prueba",
       y = "Tiempo en segundos")