2024-04-02
Kinds of graphics
How to describe the size of a graphic
Knitted documents and separate files
Vector graphics (pdf, svg)
Bitmapped or raster graphics (png, jpeg)
Why does it matter?
File sizes
Quality when printed
Appearance on screen
Device types: png, ragg, jpeg, svg, pdf
Size: fig.height, fig.width (in inches, default 7), and fig.asp (aspect ratio: height / width)
Display size: out.width, out.height (in percentage of display area, e.g., ‘70%’)
Resolution: dpi (dots per inch; 96-250 on screen, 300-600 when printed)
Alignment: fig.align = left, right, center
R markdown:
::: {.cell layout-align=“center”}
:::
Quarto document (as above, or…)
::: {.cell layout-align=“center”}
:::
Chunk options: fig.width = 6, fig.asp = 0.65, fig.align="center", out.width = '70%', dev = 'png'
Chunk options: dev='png', dpi=150
Chunk options: dev='ragg_png', dpi = 150
Chunk options: dev='png', dpi = 150
Chunk options: dev='jpeg', dpi = 150
Chunk options: dev='svglite'
Use ggsave
: