【发布时间】:2020-12-02 15:05:01
【问题描述】:
我想将 y 轴划分为附图以参与,分数 scale_y_discrete(limits 。我使用了这个p<- p+scale_y_continuous(breaks = 1:20, labels = c(1:20,"//",40:100)),但它还不起作用。
我使用了attached data,这是我的代码
代码
p<-ggscatter(data, x = "Year" , y = "Score" ,
color = "grey", shape = 21, size = 3, # Points color, shape and size
add.params = list(color = "blue", fill = "lightgray"), # Customize reg. line
add = "loess", #reg.line
conf.int = T,
cor.coef = F, cor.method = "pearson",
xlab = "Year" , ylab= "Score")
p<-p+ coord_cartesian(xlim = c(1980, 2020));p
【问题讨论】:
-
ggplot2 不支持轴中断(出于我同意的原因),但是您是否考虑过对 y 轴进行对数或 sqrt 转换?
-
@teunbrand 感谢您的意见。那么有没有办法在另一个包中产生相同的情节呢?我的高级同事不同意转型。坦克很多