還是有點在你的真實意圖混淆。也許這會幫助你看到在ggplot2的封面下面發生了什麼。 !另外,log()
,trans="log"
== log10()
,trans="log10"
:
library(ggplot2)
library(tibble)
library(gridExtra)
set.seed(1492)
df <- data_frame(x=abs(rnorm(10) * 100) + 1,
y=seq(0, 1, length.out=10))
gg <- ggplot(df, aes(x, y)) + geom_point()
gg <- gg + geom_vline(xintercept=10)
gg1 <- gg + scale_x_continuous()
gg2 <- gg + scale_x_continuous(breaks=c(10, 50, 100, 150))
gg3 <- gg + scale_x_continuous(trans="log")
gg4 <- gg + scale_x_continuous(trans="log", breaks=c(10, 50, 100, 150))
grid.arrange(
gg1,
gg2,
gg3,
gg4,
ncol=1
)
您可以通過'labels'參數直接歪曲x軸刻度標籤。 – hrbrmstr
@hrbrmstr:你可以舉例說明如何在'scale_x_continuous'中指定'labels'選項嗎? –
http://stackoverflow.com/search?q=user%3A1457051+%5Br%5D+scale_x_continuous+label – hrbrmstr