如何在grid.arrange()中使用希腊符号

发布于 2025-02-05 06:53:58 字数 239 浏览 4 评论 0原文

我在r中使用grid.Arnange()函数来解析多个图。我当前的代码结构如下:

grid.arrange(
plot1,
plot2,
legend,
ncol = 3,
top = "Change in Score",
left = "Change in Score"
)

我试图将左=“分数更改”更改为希腊符号“ delta”,以替换“更改”。

不知道该怎么做...谢谢您的建议!

I am using the grid.arrange() function in R to parse together multiple plots. My current code is structured as follows:

grid.arrange(
plot1,
plot2,
legend,
ncol = 3,
top = "Change in Score",
left = "Change in Score"
)

I am trying to change the left = "Change in Score" to the Greek symbol "Delta" in order to replace "Change in."

No clue how to do this...Thanks for any suggestions!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

静谧幽蓝 2025-02-12 06:53:59

我将iris数据集用作示例。在这种情况下,您可以使用Unicode字符进行Delta \ U0394。您可以使用以下代码:

library(ggplot2)
plot1 <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) +geom_point()
plot2 <- ggplot(iris, aes(x = Petal.Length, y = Petal.Width)) +geom_point()

library(gridExtra)
library(grid)
grid.arrange(
  plot1,
  plot2,
  #legend,
  #ncol = 3,
  top = "Change in Score",
  left = "\u0394 Score"
)

输出:

”在此处输入图像描述”

I am using the iris dataset as an example. You can use Unicode Characters for in this case Delta \u0394. You can use the following code:

library(ggplot2)
plot1 <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) +geom_point()
plot2 <- ggplot(iris, aes(x = Petal.Length, y = Petal.Width)) +geom_point()

library(gridExtra)
library(grid)
grid.arrange(
  plot1,
  plot2,
  #legend,
  #ncol = 3,
  top = "Change in Score",
  left = "\u0394 Score"
)

Output:

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文