Re: [R] equal horizontal and vertical proportions in graphics

2013-11-19 Thread Jim Lemon

On 11/19/2013 01:03 PM, Mercutio Florid wrote:

I use several different versions of R, including RGui on Windows and rstudio on 
Linux.  In all cases, I use graphical commands, such as image().

image() displays rectangles, but I want to be able to guarantee that the 
heights of those rectangles will always equal the widths.  Typically, the 
rectangles come out with notable asymmetries.

Thus, if I need to draw a perfect circle with square pixels, I usually get a 
squashed ellipse with oblong pixels.

I have experimented with other commands, and I don't need to continue to use 
image() if some other command would be more suitable.


Hi Mercutio,
If you have matrices with equal numbers of rows and columns, try:

par(pty=s)

to get a square plot. If the number of rows and columns differ you will 
have to adjust the width and height of the graphic device and the 
margins to get squares. For getting circles regardless of plot 
dimensions, try draw.circle in the plotrix package.


Jim

__
R-help@r-project.org mailing list
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] equal horizontal and vertical proportions in graphics

2013-11-19 Thread Carl Witthoft

 see ?par .  Use the argument  asp=TRUE.


Mercutio Florid wrote
 I use several different versions of R, including RGui on Windows and
 rstudio on Linux.  In all cases, I use graphical commands, such as
 image().  
 
 image() displays rectangles, but I want to be able to guarantee that the
 heights of those rectangles will always equal the widths.  Typically, the
 rectangles come out with notable asymmetries.
 
 Thus, if I need to draw a perfect circle with square pixels, I usually get
 a squashed ellipse with oblong pixels.
 
 I have experimented with other commands, and I don't need to continue to
 use image() if some other command would be more suitable.
 
 Thanks.
 
   [[alternative HTML version deleted]]
 
 
 __

 R-help@

  mailing list
 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.





--
View this message in context: 
http://r.789695.n4.nabble.com/equal-horizontal-and-vertical-proportions-in-graphics-tp4680716p4680727.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
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] equal horizontal and vertical proportions in graphics

2013-11-18 Thread Mercutio Florid
I use several different versions of R, including RGui on Windows and rstudio on 
Linux.  In all cases, I use graphical commands, such as image().  

image() displays rectangles, but I want to be able to guarantee that the 
heights of those rectangles will always equal the widths.  Typically, the 
rectangles come out with notable asymmetries.

Thus, if I need to draw a perfect circle with square pixels, I usually get a 
squashed ellipse with oblong pixels.

I have experimented with other commands, and I don't need to continue to use 
image() if some other command would be more suitable.

Thanks.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
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.