R 如何调整使用ggplot2制作的图形中的所有、绝对所有线宽?
我正试图用R 如何调整使用ggplot2制作的图形中的所有、绝对所有线宽?,r,ggplot2,themes,width,line,R,Ggplot2,Themes,Width,Line,我正试图用ggplot2标准化我的图形美学。我为此使用了theme\u set()函数。但是,当仔细观察图形时,并非所有线条都具有所需的宽度。在以下MWE中,观察到箱子和水平线不符合标准。这种情况也会在geom_smooth()行中重复出现。我怎样才能解决这个问题 library(ggplot2) theme_set( theme_bw() + theme(text = element_text(size = 8), line = element_line(col
ggplot2
标准化我的图形美学。我为此使用了theme\u set()
函数。但是,当仔细观察图形时,并非所有线条都具有所需的宽度。在以下MWE中,观察到箱子和水平线不符合标准。这种情况也会在geom_smooth()
行中重复出现。我怎样才能解决这个问题
library(ggplot2)
theme_set(
theme_bw() +
theme(text = element_text(size = 8),
line = element_line(colour = 1, size = 0.12),
rect = element_rect(colour = 1, size = 0.12))
)
ggplot(data = ToothGrowth) +
geom_boxplot(aes(x = supp, y = len)) +
facet_grid(~dose) +
geom_hline(yintercept = 20,
color = "red")
缩放
在调用
ggplot
之前添加以下内容:
update_geom_defaults("boxplot", list(size = 0.12))
update_geom_defaults("hline", list(size = 0.12))
在调用
ggplot
之前添加以下内容:
update_geom_defaults("boxplot", list(size = 0.12))
update_geom_defaults("hline", list(size = 0.12))
主题中的第一句话:主题是定制应用程序的非数据组件的强大方式plots@Henrik知道了。您知道自定义数据组件的方法吗?
?主题中的第一句话:主题是自定义数据组件的强大方法plots@Henrik知道了。你知道定制数据组件的方法吗?