问题描述:
在将离散数据可视化的过程中,出现y轴上界的点图显示不全的情况:
解决方法:
离散数据可以使用scale_y_discrete(expand=expansion(mult=c(0,.05))),c(下界增加量,上界增加量),x轴同。
具体可以用"?expansion"查看帮助以了解:
expansion(mult = 0, add = 0)
'''
mult
vector of multiplicative range expansion factors.
If length 1, both the lower and upper limits of the scale are expanded outwards by mult.
If length 2, the lower limit is expanded by mult[1] and the upper limit by mult[2].
add
vector of additive range expansion constants.
If length 1, both the lower and upper limits of the scale are expanded outwards by add units.
If length 2, the lower limit is expanded by add[1] and the upper limit by add[2].
'''
最终实现效果: