Re: [R] axis in an image() plot

2006-11-26 Thread Jim Lemon
Ricardo Rodríguez - Your XEN ICT Team wrote:
 Hi all,
 
 I've found quite usefull colored-grid created by image() but I'm facing a 
 doubt I am not able to solve.
 
 Given the following data rectangle...
 
  1  2  3  4  5  6  7  8  9 10 11 12 13 14
   1 12 22  0  7  2  1  0  2  0  2  6 -3  0  3
   2  0 -1  0  9  3 -4  0  0  0  0  3  0  0  0
   3 29 45  6 12 16 85 -2  0 -3 -4 89 -1 -1  1
   4  2  9  3  6 17  3 -2 -9 -2  8 -1  0  0  0
   5 44 16 -3 21 23  3  2  1  0 -2 13 18 -5  2
 
 I am not able to draw x and y axis labeled 1 to 14 and 1 to 5 by 1. I've 
 tried a number of options by using axis() to no avail.
 
 It will be also very helpfull to be able to draw the value of each x,y 
 combination within its position in the grid. Text() seems to be the answer, 
 but I am not able yet to get the correct position for each label.
 
 Please, could you point me in the right direction or offer some example?
 
Hi Ricardo,

This might be what you want (say your data frame is called my.df):

library(plotrix)
color2D.matplot(my.df,c(1,0),c(0,0),c(0,1))
text(rep(0.5:13.5,5),rep(seq(4.5,0.5,by=-1),14),
  unlist(my.df),col=white)

and in fact it looks so neat that I might add it as an option.

Jim

__
R-help@stat.math.ethz.ch 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] axis in an image () plot

2006-11-26 Thread Ricardo Rodríguez - Your XEN ICT Team
 jim holtman[EMAIL PROTECTED] 24/11/2006 23:21 
If you data is a matrix, then try:

image(1:5, 1:14, data.rect)
text(row(data.rect), col(data.rect), data.rect)
 
Thanks, Jim. It works great and perfectly fill my requirements. I better 
understand now how text() works.
 
By the way, there is a line at the bottom of your message reading What is the 
problem you are trying to solve?, is this a kind of motto or are you asking me 
what I am trying to solve? :-) Thanks!
 
Cheers,
 
Ricardo

--
Ricardo Rodríguez
Your XEN ICT Team

__
R-help@stat.math.ethz.ch 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] axis in an image () plot

2006-11-26 Thread Ricardo Rodríguez - Your XEN ICT Team
 Jim Lemon[EMAIL PROTECTED] 26/11/2006 12:05 
Hi Ricardo,

This might be what you want (say your data frame is called my.df):

library(plotrix)
color2D.matplot(my.df,c(1,0),c(0,0),c(0,1))
text(rep(0.5:13.5,5),rep(seq(4.5,0.5,by=-1),14),
unlist(my.df),col=white)
and in fact it looks so neat that I might add it as an option.

Jim

Thanks, Jim! Once the original problem was solved by using image(), your 
plotrix() package is of major interest to keep improving this kind of graphics!
 
Thanks for your contribution,
 
Ricardo

--
Ricardo Rodríguez
Your XEN ICT Team

__
R-help@stat.math.ethz.ch 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] axis in an image () plot

2006-11-26 Thread Ricardo Rodríguez - Your EPEC ICT Team

On Nov 26, 2006, at 5:23 PM, jim holtman wrote:

 The phrase at the bottom (what is the problem that you are trying to
 solve) is one that I have used for the last 20 years at work and I
 have it as part of my signature line since a lot of people know me
 from that phrase.  It is one of the first questions that I ask a
 project when I am doing a review for them.  Another way of say it is
 tell me what you want to do, not how you want to do it.

Thanks again, Jim. Please, allow me to try to use this method from  
now on!

Best,

Ricardo

__
R-help@stat.math.ethz.ch 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] axis in an image() plot

2006-11-24 Thread Ricardo Rodríguez - Your XEN ICT Team
Hi all,

I've found quite usefull colored-grid created by image() but I'm facing a doubt 
I am not able to solve.

Given the following data rectangle...

 1  2  3  4  5  6  7  8  9 10 11 12 13 14
  1 12 22  0  7  2  1  0  2  0  2  6 -3  0  3
  2  0 -1  0  9  3 -4  0  0  0  0  3  0  0  0
  3 29 45  6 12 16 85 -2  0 -3 -4 89 -1 -1  1
  4  2  9  3  6 17  3 -2 -9 -2  8 -1  0  0  0
  5 44 16 -3 21 23  3  2  1  0 -2 13 18 -5  2

I am not able to draw x and y axis labeled 1 to 14 and 1 to 5 by 1. I've tried 
a number of options by using axis() to no avail.

It will be also very helpfull to be able to draw the value of each x,y 
combination within its position in the grid. Text() seems to be the answer, but 
I am not able yet to get the correct position for each label.

Please, could you point me in the right direction or offer some example?

Thank you in advance,

--
Ricardo Rodríguez
Your XEN ICT Team

__
R-help@stat.math.ethz.ch 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] axis in an image() plot

2006-11-24 Thread jim holtman
If you data is a matrix, then try:

image(1:5, 1:14, data.rect)
text(row(data.rect), col(data.rect), data.rect)


On 11/24/06, Ricardo Rodríguez - Your XEN ICT Team [EMAIL PROTECTED] wrote:
 Hi all,

 I've found quite usefull colored-grid created by image() but I'm facing a 
 doubt I am not able to solve.

 Given the following data rectangle...

 1  2  3  4  5  6  7  8  9 10 11 12 13 14
  1 12 22  0  7  2  1  0  2  0  2  6 -3  0  3
  2  0 -1  0  9  3 -4  0  0  0  0  3  0  0  0
  3 29 45  6 12 16 85 -2  0 -3 -4 89 -1 -1  1
  4  2  9  3  6 17  3 -2 -9 -2  8 -1  0  0  0
  5 44 16 -3 21 23  3  2  1  0 -2 13 18 -5  2

 I am not able to draw x and y axis labeled 1 to 14 and 1 to 5 by 1. I've 
 tried a number of options by using axis() to no avail.

 It will be also very helpfull to be able to draw the value of each x,y 
 combination within its position in the grid. Text() seems to be the answer, 
 but I am not able yet to get the correct position for each label.

 Please, could you point me in the right direction or offer some example?

 Thank you in advance,

 --
 Ricardo Rodríguez
 Your XEN ICT Team

 __
 R-help@stat.math.ethz.ch 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.



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

__
R-help@stat.math.ethz.ch 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.