![](/img/trans.png)
[英]How can I create multiple plots, each with different y axis labels and titles using a for loop in R?
[英]How do I create multiple axis labels in R?
這是我的代碼:
ggplot(q19.long,aes(x=species,score,fill=species))
+geom_boxplot(alpha=0.5)
+labs(y= "Score", x = "",title=questiontitle)
+theme(axis.text.x=element_blank(),axis.ticks.x=element_blank(),legend.title=element_blank())
+scale_fill_discrete(labels=c("Rat","Vampire fly","Blackberry","Smooth-billed ani","Goat","Frog","Cat","Guava","Dog","Elephant grass"))
在我的 Y 軸上,我有 label “分數”。 但我想要兩個標簽。 數字 5 旁邊的一個寫着“非常同意”,另一個寫在數字 1 旁邊,寫着“非常不同意”。 就像下圖一樣:
幾個小時以來我一直在嘗試不同的事情,但我所能做的就是添加第二個軸,但沒有第二個標簽。 感謝幫助。
我想出的“最簡單”的解決方案只是將 ylab 從“分數”更改為“非常同意非常不同意”。 我只是放了很多空格鍵。 不是很優雅,但它有效。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.