Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 如何调整使用ggplot2制作的图形中的所有、绝对所有线宽?_R_Ggplot2_Themes_Width_Line - Fatal编程技术网

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知道了。你知道定制数据组件的方法吗?