Re: [R] Tweaking my plot of matrix as image

2007-04-12 Thread Petr PIKAL
Hi

Did you by chance look at the help page of image? If you did, you could 
read


x,y
locations of grid lines at which the values in z are measured. These must 
be finite, non-missing and in (strictly) ascending order. By default, 
equally spaced values from 0 to 1 are used. If x is a list, its components 
x$x and x$y are used for x and y, respectively. If the list has component 
z this is used for z.
z
a matrix containing the values to be plotted (NAs are allowed). Note that 
x can be used instead of z for convenience.

and therefore

image(1:20, 1:20, your.matrix)

shall do what you probably want. And if you have different matrix size 
then

1:dim(your.matrix)[1]

can give you suitable sequence.

Regards

Petr Pikal
[EMAIL PROTECTED]

[EMAIL PROTECTED] napsal dne 12.04.2007 10:55:21:

> Greetings list,
> 
> I have a rectangular 20 x 20 matrix with values in the range of [0 , 
> 1]. I'd like to plot it as an image. To that end, I have used the 
> image() function that seems to do what I want. Now, I just want to 
> tweak it to look perfect. So here is my question:
> 
> At the moment, the values of the axis range from [0, 1]. I want it to 
> show the row and column of the matrix. How do I do that?
> 
>   Thanks in advance.
> 
> Wee-Jin
> 
> __
> [EMAIL PROTECTED] 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.

__
[EMAIL PROTECTED] 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] Tweaking my plot of matrix as image

2007-04-12 Thread Jim Lemon
Wee-Jin Goh wrote:
> Greetings list,
> 
> I have a rectangular 20 x 20 matrix with values in the range of [0 ,  
> 1]. I'd like to plot it as an image. To that end, I have used the  
> image() function that seems to do what I want. Now, I just want to  
> tweak it to look perfect. So here is my question:
> 
> At the moment, the values of the axis range from [0, 1]. I want it to  
> show the row and column of the matrix. How do I do that?
> 
Perhaps color2D.matplot will suit you. It automatically shows the row 
and column indices on the plot in the same order as conventional matrix 
displays.

Jim

__
[EMAIL PROTECTED] 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.