How to make the scale of x and y the same?

32 views
Skip to first unread message

Peng Yu

unread,
Aug 2, 2021, 5:59:36 PM8/2/21
to ggplot2

I see the above set the aspect ratio of a plot. But I need the scale of x and y be the same. That is, a unit in x should be of the same length as a unit in y. Is there a way to control this with ggplot2? Thanks.

Ron Crump

unread,
Aug 3, 2021, 3:04:01 AM8/3/21
to ggp...@googlegroups.com
Hi Peng Yu,

> I see the above set the aspect ratio of a plot. But I need the scale of
> x and y be the same. That is, a unit in x should be of the same length
> as a unit in y. Is there a way to control this with ggplot2? Thanks.

From ?coord_fixed
"The default, ‘ratio = 1’, ensures that one unit on the x-axis is the
same length as one unit on the y-axis."

Isn't that what you're after?

Best wishes,
Ron.
Reply all
Reply to author
Forward
0 new messages