How about using the asp option?  For example,

A <- matrix(rnorm(200),20)
image(A, asp=ncol(A)/nrow(A))

-tgs


On Tue, Nov 19, 2013 at 3:56 AM, Mercutio Florid
<floridmercu...@yahoo.com>wrote:

>
> Today at 10:03 AM
> 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 had hoped that par()$pin would be the answer, but I can't seem to set it
> properly.  For example:
> > par()$pin
> [1] 4.416111 1.685556
> > source('~/.active-rstudio-document')
> > par()$pin<-c(4,4)
> Error in par()$pin <- c(4, 4) : invalid (NULL) left side of assignment
> > str(par()$pin)
>  num [1:2] 4.46 2.82
> > par()$pin[2]<-par()$pin[1]
> Error in par()$pin[2] <- par()$pin[1] :
>   invalid (NULL) left side of assignment
>
> 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.
>
>

        [[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.

Reply via email to