Re: [R] Plotting proportions
Hi Nick, If you can bear using R base graphics, the plotrix package has a function named "getYmult" that allows you to adjust for the aspect ratio of any plot area. Jim On Sun, Apr 3, 2022 at 11:14 PM Nick Wray wrote: > > Hello If you plot a square in the default R studio window you see a > rectangle. Does anyone know what the proportions of the sides of this > rectangle are? Thanks Nick Wray > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Plotting proportions
... and following up on Rui's reply, assuming that the default (in R, not RStudio) "m" is being used, I would assume that the aspect ratio in the RStudio device depends on the layout of your windows. Also, you might do better asking here, https://community.rstudio.com/ , than on this list. Bert Gunter On Sun, Apr 3, 2022 at 8:26 AM Rui Barradas wrote: > > Hello, > > There's a graphics parameter for aspect ratio that you can set asp=1 on > a plot by plot basis. But you also need to change pty. From ?par: > > pty > A character specifying the type of plot region to be used; "s" generates > a square plotting region and "m" generates the maximal plotting region. > > > > old_par <- par(pty = "s") > plot(1, asp = 1) > par(old_par) > > > Hope this helps, > > Rui Barradas > > Às 14:13 de 03/04/2022, Nick Wray escreveu: > > Hello If you plot a square in the default R studio window you see a > > rectangle. Does anyone know what the proportions of the sides of this > > rectangle are? Thanks Nick Wray > > > > [[alternative HTML version deleted]] > > > > __ > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Plotting proportions
Hello, There's a graphics parameter for aspect ratio that you can set asp=1 on a plot by plot basis. But you also need to change pty. From ?par: pty A character specifying the type of plot region to be used; "s" generates a square plotting region and "m" generates the maximal plotting region. old_par <- par(pty = "s") plot(1, asp = 1) par(old_par) Hope this helps, Rui Barradas Às 14:13 de 03/04/2022, Nick Wray escreveu: Hello If you plot a square in the default R studio window you see a rectangle. Does anyone know what the proportions of the sides of this rectangle are? Thanks Nick Wray [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.