[英]How to include “superscript +” in corrplot label?
I want to include "+" as a superscript in corrplot label.我想在 corrplot label 中包含“+”作为上标。 I was able to find ways to put subscript but not superscript.我能够找到放置下标而不是上标的方法。 Any help would be really appreciated.任何帮助将非常感激。 Here is a simple example I found and I changed a little to make it relevant to my problem.这是我发现的一个简单示例,我进行了一些更改以使其与我的问题相关。 R corrplot change data labels R corrplot 更改数据标签
I want a^+(+ as superscript) and a^2(a-squared) as 4th and 5th column names.我想要 a^+(+ 作为上标) 和 a^2(a-squared) 作为第 4 和第 5 列名称。
M <- cor(mtcars)[1:5,1:5]
colnames(M) <- c("alpha", "beta", ":alpha+beta", ":a^[+]", ":a^[2]")
rownames(M) <- c("alpha", "beta", NA, "$a[0]", "$ a[beta]")
corrplot(M)
Try to put it in single quotes:尝试将其放在单引号中:
library(corrplot)
#> corrplot 0.84 loaded
M <- cor(mtcars)[1:5,1:5]
colnames(M) <- c("alpha", "beta", ":alpha+beta", ":a^'+'", ":a^2")
rownames(M) <- c("alpha", "beta", NA, "$a[0]", "$ a[beta]")
corrplot(M)
Created on 2020-07-22 by the reprex package (v0.3.0)由代表 package (v0.3.0) 于 2020 年 7 月 22 日创建
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.