[Rd] Re: RFC: package pixmap

Friedrich Leisch Friedrich.Leisch@ci.tuwien.ac.at
Thu, 4 Oct 2001 14:02:30 +0200


>>>>> On Thu, 4 Oct 2001 14:04:53 +0200 (MET DST),
>>>>> Agustin Lobo (AL) wrote:

  > Hi! I'm testing pixmap. I've found the following:

  >> dim(lissN543)
  > [1] 270 900   3
  >> a <- pixmap(lissN543/255,ncol=900,nrow=270,type="rgb")
  >> dim(a)
  > [1] 270 900   3
  >> 
  >> plot.pixmap(a)

  > ...and I get the image as a vertical rectangle (I was expecting an
  > horizontal rectangle). Is this an error or am I doing something 
  > wrong?

You have 900 columns and only 270 rows, hence you should have a
vertical rectangle that is approx. 3 times as wide as high.

The difference to calling image() on a matrix is deliberate: if you
store a picture as a matrix (as usual), then you'd expect element 1,1
of that matrix to correspond to the upper left corner. That is
different from what image() does, because it was designed for doing
the right thing for matrices produced by, e.g., outer() ... [at least
I think that's the reason for image() rotating the matrix].

Best,
Fritz

-- 
-------------------------------------------------------------------
                        Friedrich  Leisch 
Institut für Statistik                     Tel: (+43 1) 58801 10715
Technische Universität Wien                Fax: (+43 1) 58801 10798
Wiedner Hauptstraße 8-10/1071      Friedrich.Leisch@ci.tuwien.ac.at
A-1040 Wien, Austria             http://www.ci.tuwien.ac.at/~leisch
-------------------------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._