我正在为以下数据绘制条形图:
library(ggplot2)
myData <- data.frame(
x = c(rep("",100),"B","C","A","A"),y = c(rep(3,1,5,6,7,3,3)
)
myData$x <- factor(myData$x,levels = c("B","A"))
ggplot(myData,aes(x=x)) +
geom_bar(width = 0.5)+
geom_text(stat='count',aes(label = ..count..),vjust = -1)
这是我的情节:
如何在y轴和最高的列中添加比例尺中断,以使图表更紧凑?
我的意思是这样的:https://peltiertech.com/broken-y-axis-in-excel-chart/