This looks good, but remember we want to use this on a poster. # I'm explicitly calling the device functions so you can see the dimensions # used agg_png( pngfile, width = 20, height = 12, units = "cm", res = 300) Pngfile <- fs:: path( knitr:: fig_path(), "basis.png") ) + labs(x = "Flipper Length ", y = "Body Mass ", colour = "Species", # plot adapted from p <- ggplot( na.omit( penguins), aes(x = flipper_length_mm, y = body_mass_g)) + geom_point(ĭescription = "Gentoo penguins are generally bigger in size") This is the plot, and how it looks on a computer: In the remainder of the text we will assume that we sit in front of a computer developing a plot that should end up on a poster. Once we are content with it we will save it to the correct absolute size required by wherever we intend to publish the plot. When we develop a graphic we will generally sit in front of a computer and fine tune it while continuously getting previews on the screen. At its core, this is about ensuring the correct scaling of a plot as we develop it for varying absolute sizes. With formalities out of the way, we can describe the problem more clearly. Since points is an absolute unit, the resolution of the output will determine the number of pixels it correspond to. Varied throughout history, the general consensus now is that 1pt = 1/72 inch (this is also adopted by R). When we set a font to size 12, it is given in points. Pointsize: This is a measure tied to text sizing. A resolution of 72 ppi means that an inch is considered 72 pixels long. It is usually given in ppi (pixels per inch), though dpi (dots per inch) is used interchangeably. Resolution: This number ties absolute and pixel size together. Pixels does not have any inherent physical size. The pixel size is the number of rows and columns in the matrix. Pixel size: For raster output, the graphic is encoded as a matrix of color values. This is measured in centimeters or inches or another absolute length unit. Some definitionsīefore we delve into the problem we should clarify a few concepts related to graphics and sizing:Ībsolute size: This is the physical dimensions of the graphic (or, more precisely, the intended physical dimensions). The latest release of ragg contains a new functionality that will hopefully make this issue a thing of the past. By a very large margin the most “popular” response revolved around making sure that output had the correct scaling of text, lines, etc. Some time ago, while working on the new edition of the ggplot2 book, I asked out to the R twitterverse what part of using ggplot2 was the most incomprehensible for seasoned users.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |