Skip to content

Instantly share code, notes, and snippets.

@avallecam
Last active May 4, 2021 22:28
Show Gist options
  • Save avallecam/46f6bcb2d0e5a622ef135589d0088e10 to your computer and use it in GitHub Desktop.
Save avallecam/46f6bcb2d0e5a622ef135589d0088e10 to your computer and use it in GitHub Desktop.
set 1:1 ratio between axis
``` r
library(tidyverse)
#> Warning: package 'tidyverse' was built under R version 4.0.4
ggplot(mtcars, aes(disp, hp)) +
geom_point() +
#fijar el ratio de escala entre los ejes X y Y
coord_fixed(ratio = 1) +
#definir cortes en cada eje
scale_y_continuous(breaks = seq(50,500,by=50)) +
scale_x_continuous(breaks = seq(50,500,by=50))
```
![](https://i.imgur.com/YhCjaxq.png)
<sup>Created on 2021-05-04 by the [reprex package](https://reprex.tidyverse.org) (v0.3.0)</sup>
@avallecam
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment