This function will open your plot in a new window with the aspect ratio of the chart type selected. For fullslide chart types (fullslide, fullslide_narrow, fullslide_half), this will show the complete slide with the grey header, Grattan logo, and properly positioned title/subtitle/caption.

check_chart_aspect_ratio(object = ggplot2::last_plot(), type = "normal")

Arguments

object

The ggplot2 graph object to be saved. Defaults to last_plot(), which will save the last plot that was displayed in your session.

type

Sets height and width to Grattan defaults. The following chart types are available:

normal

The default. Use for normal Grattan report charts, or to paste into a 4:3 Powerpoint slide. Width: 22.2cm, height: 14.5cm.

wholecolumn

Takes up a whole column in a Grattan report. Width: 22.2cm, height: 22.2cm.

fullpage

Fills a whole page of a Grattan report. Width: 44.3cm, height: 22.2cm.

fullslide

A 16:9 Grattan Powerpoint slide, complete with logo. Use this to drop into standard presentations. Total slide size: 33.9cm x 19.0cm. Chart size: 31.5cm x 11.9cm.

fullslide_narrow

A Grattan Powerpoint slide with logo, but a narrower chart. Use this to allow space for annotations in powerpoint Chart size: 23cm x 11.9cm.

fullslide_half

A Grattan Powerpoint slide with logo, but a half-width chart. Use this to manually create side-by-side charts or allow space for a half-slide of text in powerpoint. Chart size: 15.3cm x 11.9cm.

blog

Deprecated. Creates a 4:3 image that looks like a Grattan Powerpoint slide, but with less border whitespace than `fullslide`.

normal_169

Deprecated. Useful for pasting into a 16:9 format Grattan Powerpoint slide. Width: 30cm, height: 14.5cm.

tiny

Deprecated. Fills the width of a column in a Grattan report, but is shorter than usual. Width: 22.2cm, height: 11.1cm.

Set type = "all" to save your chart in all available sizes or use `grattan_save_all()`.

Examples

if (FALSE) { # \dontrun{
ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point()
check_chart_aspect_ratio()

# Check fullslide appearance with title and subtitle
ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_point() +
  labs(title = "My title", subtitle = "My subtitle") +
  theme_grattan()
check_chart_aspect_ratio(type = "fullslide")
} # }