Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我尝试以下任一方法时,轴比例为 1e+03、1e+06、1e+09 - 是否可以在不借助手动标签的情况下获得漂亮的上标 10^3、10^6、10^9?我似乎记得过去自动得到这个。
qplot(1:10, 10^(1:10))+scale_y_log10() qplot(1:10, 10^(1:10), log='y')
您可以使用trans_breaks()and trans_format()from libraryscales来获得所需的轴值格式。
trans_breaks()
trans_format()
scales
library(scales) qplot(1:10, 10^(1:10)) + scale_y_log10(breaks = trans_breaks("log10", function(x) 10^x), labels = trans_format("log10", math_format(10^.x)))