Currently, turning clip = "on" has little effect for coord_radial() with out-of-bounds values. In the example below, I'd like it to be possible to clip points to the pacman-shape and not display any data in the upper quarter of the plot.
Clipping currently is a property of the grob added to the gtable, and thus the clipping is enforced by a rectangular gtable cell. While the clipping is setup by the coord, it ultimately under controlled by the facets, e.g. here:
The coord currently has no option to intervene in the clipping, which would ideally occur before panels are handed off to the Facet$draw_panels() method. I think the best option will be to move the responsibility of the following piece of code from the Layout to the Coord, which can then intervene as it sees fit.
Currently, turning
clip = "on"
has little effect forcoord_radial()
with out-of-bounds values. In the example below, I'd like it to be possible to clip points to the pacman-shape and not display any data in the upper quarter of the plot.Created on 2024-06-20 with reprex v2.1.0
Clipping currently is a property of the grob added to the gtable, and thus the clipping is enforced by a rectangular gtable cell. While the clipping is setup by the coord, it ultimately under controlled by the facets, e.g. here:
https://github.com/tidyverse/ggplot2/blob/ba0b18ab7bcc37e86b971e382710ce2cac6ed60e/R/facet-null.R#L66
The coord currently has no option to intervene in the clipping, which would ideally occur before panels are handed off to the
Facet$draw_panels()
method. I think the best option will be to move the responsibility of the following piece of code from theLayout
to theCoord
, which can then intervene as it sees fit.https://github.com/tidyverse/ggplot2/blob/ba0b18ab7bcc37e86b971e382710ce2cac6ed60e/R/layout.R#L79-L96