我对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",但它不起作用。我不知道是什么原因,我将感谢您的答复。
发布于 2020-08-11 21:57:19
face参数有4个选项:普通、斜体、粗体和bold.italic。如果你不希望这个数字是斜体的,你可以在element_text中删除face参数,或者你可以使用另一个值“粗体”。
发布于 2020-08-11 22:06:13
类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"))https://stackoverflow.com/questions/63359524
复制相似问题