2012-01-09 49 views
1

我可能忽略了一些明顯的東西,但也可能有其他人也會這樣。R中的刻度標記文本方向

我在R圖中的x軸上使用了很多蜱蟲。 我已經縮小了邊距文本以騰出空間(使用cex.axis),但是我想要更多,如果能夠使文本垂直,會更好。

+0

在回答你關於搜索問題。嘗試在搜索列表中使用r-project:https://www.google.com/search?q = axis + label + orientation + r-project&ie = utf-8&oe = utf-8&aq = t&rls = org.mozilla:en- US:official&client = firefox-a – 2012-01-09 20:25:46

+0

這取決於你正在繪製什麼,但有時最好交換你的x軸和y軸,這樣所有的標籤都可以有水平文本。 – 2012-01-09 22:30:29

回答

2

這些命令將使x軸垂直的文字:

##The numbers next to the tick marks 
par(las=3) 
plot(x=1:10, y=1:10, xlab="") 

##The x-axis label 
mtext("sfdf", 1, las=3, adj=3) 
+1

實際上,'las = 2'使軸標籤始終垂直於軸。 'las = 3'使它們垂直。 – 2012-01-09 20:02:10

+0

太棒了!感謝名單!爲什麼我很難用Google搜索? – AWE 2012-01-09 20:05:49

+0

@JoshuaUlrich:哎呀,謝謝。 – csgillespie 2012-01-09 20:08:53