Skip to content

Warning when combining coord_radial() and absolute theme(panel.widths) #6701

@jbengler

Description

@jbengler

Hi Teun,

is there a way to produce pie charts with absolute dimensions without triggering a warning?

library(ggplot2)

data.frame(cat = c("A", "B", "C"), value = c(25, 40, 60)) |>
  ggplot(aes(x = NA, y = value, fill = cat)) +
  geom_col(position = position_stack()) +
  coord_radial(theta = "y", expand = FALSE) +
  theme(panel.widths = unit(50, "mm"), panel.heights = unit(50, "mm"))
Warning message:
Aspect ratios are overruled by `panel.widths` and `panel.heights` theme elements. 

At the moment these warnings are spoiling my package tests 🙃

Best
Broder

Metadata

Metadata

Assignees

No one assigned

    Labels

    messagesrequests for improvements to error, warning, or feedback messages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions