Forum: help
Monitor Forum | | RE: different colors for rows [ Reply ] By: Daniela S on 2012-07-13 12:42 | [forum:36690] |
|
Perfect, and big fat thanks to you for so much help. |
|
| RE: different colors for rows [ Reply ] By: Julien Moeys on 2012-07-13 11:56 | [forum:7182] |
|
Hi Daniela, in fact points, won't work here, because the x-y coordinates are not compatible with the clay-silt-sand one. "soiltexture" transform the data from clay-silt-sand into x-y coordinates that can be plotted inside the traingle. So you have to use TT.points there. Here is an example: ### library( "soiltexture" ) USATex <- data.frame( "CLAY" = c(38.77,41.85,39.35,38.95,45.58,44.76), "SILT" = c(3.48,3.4,4.18,5.32,1.89,1.35), "SAND" = c(57.75,54.75,56.46,55.72,52.53,53.89), stringsAsFactors = TRUE) # #plot the USDA-triangle geo <- TT.plot( class.sys = "USDA.TT",cex.lab= 1,cex.axis=1) # Prepare the vector of colors colz <- rep( "red", time = nrow( USATex ) ) colz[1:4] <- "blue" pchz <- rep( 16, time = nrow( USATex ) ) pchz[1:4] <- 17 # put points over it TT.points( geo = geo, tri.data = USATex, pch=pchz, col=colz) ### Hope it helps With best Julien |
|
| different colors for rows [ Reply ] By: Daniela S on 2012-07-13 09:05 | [forum:7180] |
|
Hi, its me again. Everything worked very well, but now I'd like to plot the data into the USDA-triangle and want that some rows get one color and the next another one. What I tried: #conclude rows to 1name UIGVI5 <- USATex[1:4,] UIGVI20 <- USATex[5:6,] #plot the USDA-triangle TT.plot( class.sys = "USDA.TT",cex.lab= 1,cex.axis=1) # put points over it points(UREI5, pch=17, col=1) points(UREI20, pch=16, col=1) The problem is that the points are on the false position. So I think I have to work with tri.data: TT.plot( class.sys = "USDA.TT",cex.lab= 1,cex.axis=1, tri.data = UREI5, pch=17, col=1) But how can I put in more than 1name with different color into this plot? Thanks for helping me again. best grets |
|

