[R] Complex plotting problem

Vladimir Eremeev wl at eimb.ru
Fri Nov 3 06:43:04 CET 2006


I did this with points by supplying the vector in the col= argument.

That is, 

 plot(x=x.vector,y=y.vector,col=col.table[y.vector*100+100],pch=16)

It is presumed, that col.table contains 200 colors, and y.vector is in (-1,1) 
range. You can write your own expression to define the color for particular 
value, depending on your task.

pch=16 - afair, it is a big solid square (may be wrong)

colors in table should be as character hexadecimal strings of the form 
"#rrggbb".

Did you define the palette?

Some cute color tables could be grabbed from here
http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml

Also, the GIMP (http://www.gimp.org) can generate palettes and even saves them 
in the text files, which can be very easily imported in R.



More information about the R-help mailing list