[英]R plot title involving a subscript and value of a variable
在 R 中,變量 MyVar 的值應該被評估並出現在簡單的 R plot p 的標題中。
MyVar<-0.23
使用 plot p 調用
plot(p, main = MyTitle)
我的 plot 標題需要一個下標,應該如下所示:
MyTitle= 的正確說法是什么? 我使用粘貼、表達式、替換和 bquote 嘗試了幾十種變體。 似乎沒有任何工作...
非常感謝任何幫助! 非常感謝! 標記
我不相信您可以將表達式粘貼到變量(粘貼/打印/cat/bquote/等)。 作為一種解決方法,您可以使用“Fbelow=”表達式作為標題並使用 mtext 插入 MyVar 的值,例如
MyVar<-0.23 plot(mtcars[2:3], main = expression('F'[below]*'=')) mtext(text = MyVar, side = 3, adj = 0.625, padj = -1.75, cex = 1.5)
顯然這並不理想,但除非其他人有聰明的方法來解決你的問題,否則這至少會給你一個潛在的選擇
[英]Subscript in plot title in r
[英]Plot legend with subscript and insert stored value in R
[英]R plot title with greek letter, newline and variable value
[英]R plot title with variable name
[英]Pasting value into R plot title
[英]R: plot : variable title font size
[英]R plot: Using italics and a variable in a title
[英]R: subscript text as a variable
[英]Subscript and super script in R plot
[英]R Naming plot with variable value
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.