我一直在花很多时间来制作带有以下代码的情节:
# Load the data
#data(mtcars)
# Basic scatter plot
ggplot(data = mtcars, aes(x = log2(wt), fill=gear)) +
geom_histogram(alpha = 1, breaks=seq(from=1, to=max(log2(mtcars$wt)), by=0.1))+
scale_x_continuous(sec.axis = sec_axis(~ 10^.))+
scale_fill_manual(values=c("black", "goldenrod1", "red"))
我意识到在最新版本的ggplot2(3.1)中,上部x轴看起来很奇怪(不成比例),而在以前的版本(3.0)中,它绘制的很好。 ggplot2的最新版本是否存在错误?