[英]R ggplpot(): Thicker X and Y Axes
我有橫穿x軸的數據,並且我正在嘗試使這些軸變暗,以使其在圖表中更明顯。 我使用的代碼只是使圖表周圍方框底部和左側的線條變暗,而不是軸本身變暗。 我想念什么? 代碼和圖像如下。
ggplot() +
geom_line(data=eff, aes(EaR, Forward.Cost), color=rgb(187,8,38, max=255)) +
geom_line(data=arbitrary, aes(EaR, Forward.Cost), color=rgb(196,165,96, max=255)) +
ggtitle("Efficient Frontier \n") +
labs(x="EaR", y="Forward Cost") +
theme_bw() +
theme(axis.line = element_line(size = 1, color = rgb(0,0,0,max=255))) +
geom_point(data=eff, aes(EaR, Forward.Cost),size=2, color=rgb(187,8,38,max=255)) +
geom_point(data=arbitrary, aes(EaR, Forward.Cost),size=2, color=rgb(196,165,96,max=255))
用於背景和邊框。
gg+theme(panel.border = element_rect(linetype = "solid", colour = "black", size=5))+
您的其余代碼
ggplot2中的參數“ panel.border”存在問題 。 用戶etiennebr和nfdisco已檢測到,即使以PDF打印時,線條也顯示出不同軸之間的厚度差異。
因此,似乎很少有解決此持續性問題的方法。 您可能想要嘗試不同的線寬值,例如png(res=xxx)
或ggsave(dpi=xxx)
,以查看是否存在任何重大變化,如合作者wch所建議。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.