Within the base package collection, see
?colorRamp and ?colorRampPalette
Then
or.to.blue<-colorRampPalette(c("orange","green","blue")) #green
included to avoid muddy blues
plot(df$X, df$Y,type="n")
text(df$X, df$Y, labels=df$Z,
col=or.to.blue(length(df$Z))[rank(df$Z)])
You don't need to order by
Juan Pablo Fededa wrote:
> Dear Contributors:
>
> I have the next matrix:
>
> "X" "Y" "Z"
>
> 1 2 526
> 2 5 723
> 310 110
> 4 7 1110
> 5 9 34
> 6 8 778
> 7 1 614
> 8 4 876
> 9 6 249
> 10 3 14
>
> I want
Hi Juan,
Assuming that your data frame is named df, something like the
following should work:
library(ggplot)
qplot(X, Y, data = df, colour = Z, label = Z, geom = "text") +
scale_colour_continuous(low="orange", high = "blue")
You can find out more about ggplot2 at http://had.co.nz/ggplot2.
Had
One way to do this may be to create the right image
and show it. I have never user R for image processing
so I can not provide any details, but I would have
done the following:
Create a 100x100 (or 1000x1000) white image. Then
(assuming that it is a 100x1000 image), for each pair
of your (x,y) you
Dear Contributors:
I have the next matrix:
"X" "Y" "Z"
1 2 526
2 5 723
310 110
4 7 1110
5 9 34
6 8 778
7 1 614
8 4 876
9 6 249
10 3 14
I want to order the matrix from bigest Z (1110) to lower Z (14).
The
5 matches
Mail list logo