我正在尝试将值'10 ^ 0'和'10 ^ 7'添加到下图中。但是,我似乎无法获得图表中显示的任何值。任何帮助将不胜感激。
我正在使用的缩放功能是
scale_y_log10(breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))
完整代码位于图片下方。
ggplot(data=mydata.long, aes(x=variable, y=value, group=BenchMark, shape=BenchMark, colour=BenchMark)) +
geom_line(aes(linetype=BenchMark), size=1) + # Set linetype by sex
geom_point(size=3, fill="white") + # Use larger points, fill with white
scale_colour_hue(name="BenchMark", # Set legend title
l=30) + # Use darker colors (lightness=30)
scale_shape_manual(name="BenchMark",
values=c("#CC0000", "#006600", "#669999", "#00CCCC",
"#660099", "#CC0066", "#FF9999", "#FF9900",
"black", "black", "black", "black", "black")) + # Use points with a fill color
scale_linetype_discrete(name="BenchMark") +
xlab("Pipeline stage") + ylab("Number of comparisons") + # Set axis labels
ggtitle("The number of tests identified\n at each pipeline stage\n in a two stage pipeline") + # Set title
theme_bw() + # Position legend inside
scale_y_log10(breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))
答案 0 :(得分:2)
您可以执行以下操作:
scale_y_log10(limits=c(10^0, 10^7), breaks=10^(0:7))