ggplot2 中使用 scale_y_scientific() 函数设置纵坐标为科学计数法
要使得画出的图的纵坐标符合科学计数法,可以使用ggplot2包中的scale_y_scientific()函数。将该函数添加到ggplot()函数中的管道操作符中即可。\n\n修改后的代码如下:\n\nggplot(data, aes(group, value, color = group)) +\n geom_boxplot(alpha=0.1, outlier.size=0, size=1, width=0.55, fill="transparent") +\n theme_bw(base_size = 16) +\n geom_jitter( position=position_jitter(0.2), size=1)+ \n theme(axis.text.x=element_text(angle=45,vjust=1, hjust=1))+\n ggsci::scale_color_igv() + # 配色\n xlab('') +\n ylab('') +\n facet_wrap( ~ variable, scales = 'free', nrow = 1) +\n scale_y_scientific()
原文地址: https://www.cveoy.top/t/topic/p1cX 著作权归作者所有。请勿转载和采集!