0
我有下圖,我希望它格式化,使得每個座標軸上的刻度線是由粗黑邊框限定的區域的上限和下限。如何調整軸刻度線的極限與ggplot中的邊界相同?
ggplot(WPND, aes(x = Year)) +
geom_line(aes(y=FOX_LS), colour="black", size=1.2, linetype=1) +
geom_line(aes(y=FOX_HS), colour="red", size=1.2, linetype=1) +
theme_light() +
theme(axis.text.x = element_text(color= "black", size=11, angle=90, hjust =
-2, vjust = 0.5)) +
theme(axis.text.y = element_text(color = "black", size = 11)) +
ylab(expression("BAI (cm "*{}^2*")")) +
scale_x_continuous(breaks = seq(1960, 2015, by=5)) +
scale_y_continuous(limits = c(0,60), breaks = seq(0, 60, b=10)) +
theme(panel.border = element_rect(color = "black", fill = NA, size = 1.5),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(color = 'grey', linetype= 'dashed'),
axis.ticks.length = unit(-0.25, "cm"),
axis.ticks = element_line(color = "black", size = 1),
axis.text.x = element_text(margin = unit(c(0.5,0.5,0.5,0.5), "cm")),
axis.text.y = element_text(margin = unit(c(0.5,0.5,0.5,0.5), "cm")))`
圖我在ggplot取得
如何我想刻度線/利潤率看
是的工作。謝謝! –
@CameronM如果這解決了你的問題,請記得點擊這個答案旁邊的綠色檢查 – rawr