Re: [R] Help with continuous color plot

2014-09-25 Thread Jim Lemon
On Wed, 24 Sep 2014 02:36:58 PM m...@considine.net wrote: No, I don't think so. And I've wondered if I described the problem clearly, so I put together the following hack, which seems to be what I want : #create a matrix to hold the values corresponding to various percentiles

[R] Help with continuous color plot

2014-09-24 Thread matt
Hi, I have a matrix of data, with the rows representing observations and the columns representing various values that the observation can take on. In other words, each row can be thought of as a sampling of the density function/histogram associated with the range of values for that

Re: [R] Help with continuous color plot

2014-09-24 Thread Federico Lasa
Does this resemble what you're after? library(reshape2) tst - melt(testdataset) library(ggplot2) ggplot(tst, aes(x=Var1, y=Var2, fill=value)) + geom_tile() + scale_fill_gradient2(low=white, high=white, mid=scales::muted(blue), midpoint=0.6148377) On Wed, Sep 24, 2014 at 10:26

Re: [R] Help with continuous color plot

2014-09-24 Thread Federico Lasa
You missed a few things when copying the example, try ggplot(testdataset2, aes(y=factor(Var2),x=value)) + stat_density(aes(fill=..density..), position=identity, geom=tile) + scale_fill_gradientn(colours=brewer.pal(n=8, name=PuBuGn)) needed to add tile geom, and factor the correct variable.

Re: [R] Help with continuous color plot

2014-09-24 Thread matt
No, I don't think so. And I've wondered if I described the problem clearly, so I put together the following hack, which seems to be what I want : #create a matrix to hold the values corresponding to various percentiles vals-matrix(0,32,21) #for each row in the data, collect info on the