Closed
1 of 1 issue completedClosed
1 of 1 issue completed
Description
Awesome new feature re theme panel.widths and panel.heights!
Could ggplot2 provide get_plot_height
and get_plot_width
functions to support saving plots where the panel.widths and panel.heights have been set.
Basically, it'd be super useful, if I could do something like this:
library(tidyverse)
library(palmerpenguins)
p <- penguins |>
drop_na(sex) |>
ggplot() +
geom_point(
aes(x = bill_depth_mm,
y = body_mass_g,
colour = species),
) +
theme(panel.widths = rep(unit(50, "mm"), times = 100)) +
theme(panel.heights = rep(unit(50, "mm"), times = 100))
ggsave(
plot = p,
filename = "temp.png",
height = get_plot_height(p),
width = get_plot_width(p),
)
Sub-issues
Metadata
Metadata
Assignees
Labels
No labels