R中的数字文本突然变成斜体

R中的数字文本突然变成斜体,r,figure,R,Figure,我对R图中的文本有问题。 我的代码是 library("ggplot2") ggplot(df, aes(x = class, y = Proportion)) + geom_point(aes(color = class)) + scale_color_viridis_d() +theme_minimal()+ theme(text=element_text(size=16,face = "plain")) 但是,图中的文本为斜体。我添加了“f

我对R图中的文本有问题。 我的代码是

    library("ggplot2")
ggplot(df, aes(x = class, y = Proportion)) +
geom_point(aes(color = class)) +
scale_color_viridis_d() +theme_minimal()+
theme(text=element_text(size=16,face = "plain"))
但是,图中的文本为斜体。我添加了“face=”plain“, 但它不起作用。 我不知道是什么原因,
我将非常感谢您的回答。

面部参数有4个选项:普通、斜体、粗体和粗体。斜体。
如果您不希望图形为斜体,可以删除元素_文本中的面参数或使用另一个值“bold”。

面参数有4个选项:普通、斜体、粗体和粗体.italic。 如果您不希望图形为斜体,可以删除元素文本中的face参数,或者使用另一个值“bold”。

class
class(df$class)
可以认为是一个因素吗

 mtcars$cyl <- factor(mtcars$cyl)
    library("ggplot2")
    ggplot(mtcars, aes(x = cyl, y =mpg)) +
      geom_point(aes(color = cyl)) +
      scale_color_viridis_d() +theme_minimal()+
      theme(text=element_text(size=16,face = "plain"))
mtcars$cylclass
class(df$class)
可能是一个因素

 mtcars$cyl <- factor(mtcars$cyl)
    library("ggplot2")
    ggplot(mtcars, aes(x = cyl, y =mpg)) +
      geom_point(aes(color = cyl)) +
      scale_color_viridis_d() +theme_minimal()+
      theme(text=element_text(size=16,face = "plain"))

mtcars$cyl Try
face=“bold”
非常感谢,是的,face=“bold”有效,但我需要常规文本。Try
face=“bold”
非常感谢,是的,face=“bold”有效,但我需要常规文本。谢谢,是的,类(df$class)是一个因素。谢谢,是的,类(df$class)是一个因素。谢谢,是的,我删除了元素\文本中的面参数,但当我更改为粗体时,它仍然是“斜体”,变为“粗体”。只有纯文本不起作用,但我需要“纯”文本。谢谢,是的,我删除了元素\文本中的面参数,但当我更改为粗体时,它仍然是“斜体”,变为“粗体”“。只有纯文本不起作用,但我需要纯文本。”。