lets-plot icon indicating copy to clipboard operation
lets-plot copied to clipboard

`coord_fixed`: wrong aspect ratio when using `facet_wrap` with `scales='free'`

Open ASmirnov-HORIS opened this issue 11 months ago • 0 comments

Example:

data = {
    'x': [0, 0, 2, 0, 0, 8],
    'y': [0, 1, 0, 0, 2, 0],
    'f': ['a'] * 3 + ['b'] * 3,
}

ggplot(data, aes('x', 'y')) + \
    geom_point() + \
    coord_fixed(ratio=1) + \
    facet_wrap(facets='f', scales='free', nrow=1)

Output, where the grid of coordinates is not a square grid:

Image

Note: If one tries to build a similar example in ggplot2, it gives the error:

`coord_fixed()` doesn't support free scales.

ASmirnov-HORIS avatar Feb 17 '25 14:02 ASmirnov-HORIS