我正在尝试使用ggplot2在R中制作散点图,其中y轴的中间被折叠或移除,因为那里没有数据.我在下面的photoshop中做过,但有没有办法用ggplot创建类似的情节?这是具有连续比例的数据:
这是代码:
ggplot(data=distance_data) +
geom_point(
aes(
x = mdistance,
y = maxZ,
shape = factor(subj),
color = factor(side),
size = (cSA)
)
) +
scale_size_continuous(range = c(4, 10)) +
theme(
axis.text.x = element_text(colour = "black", size = 15),
axis.text.y = element_text(colour = "black", size = 15),
axis.title.x = element_text(colour = "black", size= 20, vjust = 0),
axis.title.y = element_text(colour = "black", size= 20),
legend.position = "none"
) +
ylab("Z-score") +
xlab("Distance")
Run Code Online (Sandbox Code Playgroud)