Skip to content

2d plotting and colours

3 messages · Mulholland, Tom, Asha Jayanthi

#
And getting back to your question about the palette

there are a lot of ways to do this

assuming you have just started a session 

palette() 
# will give 
#[1] "black"   "red"     "green3"  "blue"    "cyan"   
#[6] "magenta" "yellow"  "gray"  

palette(rainbow(24))  # There's also 'heat.colors' & 'topo.colors'
palette()

# [1] "red"         "#FF4000"     "#FF8000"    
# [4] "#FFBF00"     "yellow"      "#BFFF00"    
# [7] "#80FF00"     "#40FF00"     "green"      
#[10] "#00FF40"     "#00FF80"     "#00FFBF"    
#[13] "cyan"        "deepskyblue" "#0080FF"    
#[16] "#0040FF"     "blue"        "#4000FF"    
#[19] "#8000FF"     "#BF00FF"     "magenta"    
#[22] "#FF00BF"     "#FF0080"     "#FF0040"   

palette(rgb((0:15)/15, g=0,b=0, names=paste("red",0:15,sep=".")))
palette()
# [1] "black"   "#110000" "#220000" "#330000" "#440000"
# [6] "#550000" "#660000" "#770000" "#880000" "#990000"
#[11] "#AA0000" "#BB0000" "#CC0000" "#DD0000" "red2"   
#[16] "red" 

If you are looking to use colours that take account of colour blindness
you could try the package dichromat. (I think 2.1 will have some of this inbuilt)

Once you look through the help files associated with some of these options you 
will find the way that best suits your method of working.

Tom
http://www.R-project.org/posting-guide.html

______________________________________________
R-help at 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
#
Thank you very much.

the code
plot(x, col = s)
points(cl$centers, col = s, pch = 8, cex=2)

does not plot the points according to the group colors. The plots are used 
to identify the groups by colors

That could be done by

plot(x, col = cl$cluster)

This means that we need to set the default colours , say col = cl$cluster = 
a set of group numbers say 1...10 should produce 10 distinct colours points 
grouped by colour.

how to do this when you have more than 8 group colours to plot
#
I have a large matrix of data .

The size of the matrix ranges from 100 x 100 to 1000 x 1000

Now i have to do computations on that. And should not consider the diagonal 
elements.

I tried setting diag(M) = NA  and M = na.omit(M).

But this omits all the rows. I only want to omit that diagonal elements only 
but consider the whole row.

diag(M) = 0 seems like a good option but this will affect my result.

How to proceed with this. How to just ignore some specific values. what if i 
want to consider only the upper / lower triangular matrix

Asha


http://adfarm.mediaplex.com/ad/ck/4686-26272-10936-31?ck=RegSell Start your 
business.