[英]How can I make y-axis lines that match the x-axis lines from theme_clean()?
I'm going to be producing a lot of visuals for a report.我将为报告制作大量视觉效果。 My boss really likes the
theme_clean()
horizontal lines but wants me to add the same lines to the x-axis.我的老板真的很喜欢
theme_clean()
水平线,但希望我在 x 轴上添加相同的线。 Is there an easy way to do this?是否有捷径可寻?
Here is my code这是我的代码
library(ggplot2)
library(ggthemes)
ggplot(mtcars, aes(x = mpg)) +
geom_point(aes(y = hp)) +
theme_clean(base_size=18)
How can I get the same style for my x-axis ticks (going vertical).如何为我的 x 轴刻度(垂直)获得相同的样式。
Best.最好的。
Try this.尝试这个。 Simply typing
theme_clean
into the console shows you the default values used by theme_clean
for panel.grid.major.y
which we then can use to set the values for panel.grid.major.x
accordingly using theme()
:只需在控制台中输入
theme_clean
显示theme_clean
为panel.grid.major.y
使用的默认值,然后我们可以使用theme()
相应地设置panel.grid.major.x
的值:
library(ggplot2)
library(ggthemes)
ggplot(mtcars, aes(x = mpg)) +
geom_point(aes(y = hp)) +
theme_clean(base_size=18) +
theme(panel.grid.major.x = element_line(colour = "gray", linetype = "dotted"))
Created on 2020-04-07 by the reprex package (v0.3.0)由代表 package (v0.3.0) 于 2020 年 4 月 7 日创建
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.