20.5 Coords

Example: CoordCartesian rescaling the position data

Coords takes care of rendering the axes, axis labels, and panel foreground and background and it can intercept both the layer data and facet layout and modify it, with:

  • draw_*()
  • transform()

Example

print(CoordCartesian$transform)
<ggproto method>
  <Wrapper function>
    function (...) 
transform(...)

  <Inner function (f)>
    function (data, panel_params) 
{
    data <- transform_position(data, panel_params$x$rescale, 
        panel_params$y$rescale)
    transform_position(data, squish_infinite, squish_infinite)
}
print(coord_sf)