Ggsave does not limit line width

I have the following example

library(ggplot2)
library(ggthemes)
ggplot(mtcars) + 
  geom_point(aes(x = wt, y = mpg, colour=factor(gear))) + 
  facet_wrap(~am) +
  ggtitle("Title") +
  theme(
    axis.line.x = element_line(colour = "black", size = 0.5, linetype = "solid"),
    axis.line.y = element_line(colour = "black", size = 0.5, linetype = "solid")
  )

ggsave(filename = "~/Desktop/test.pdf")

The function docs element_line()do not indicate which unit has the attribute size. But when I open the created pdf in Illustrator, the axis lines are shown as 1.07 pt lines.

So ... what is an attribute unit sizeand how can I get the output to have a line width of 0.5 pt?

thank

+3
source share
1 answer

The conversion factor is (72.27 / 25.4) * (72.27 / 96) = 2.141959. So, as you have noticed, it size=0.5results in a line width of 1.07pt wide. See here for more details .

0
source

Source: https://habr.com/ru/post/1689930/


All Articles