仅标记选定的中断

int*_*ost 5 r ggplot2

由于轴上的空间限制(对数变换),我想仅在为连续序列显示中断时标记选择中断.当然以下导致错误:

scale_x_continuous(breaks=c(-10,0,10,20,30),labels=c(-10,0,10,30))

Error: breaks and labels have unequal lengths
Run Code Online (Sandbox Code Playgroud)

有没有办法解决这个问题?

KFB*_*KFB 7

请试试:

scale_x_continuous(breaks=c(-10,0,10,20,30), labels=c(-10,0,10,"",30))
Run Code Online (Sandbox Code Playgroud)