Hi;

 

I have created a geom_tile plot which does roughly what I want but I
have a small tweak I cannot sort out.

 

I have a dataframe binL, binR, HCount, HProbCount where HCount and
HProbCount have values ranging from 1-150. I plot binL and binR on the
axes respectively and create two charts with the fill being represented
by HCount and HProbCount respectively.

 

The problem is that I want HCount and HProbCount to use custom
gradients. i.e. a colour for 0-10, next shade for 10-30, next for 30-70
etc.

 

Due to some magic done on the data, one uses intervals 0,50,100,150 and
the other 0,20,40 etc. - not important but I would be interested to know
why. My plots are created by;

ggplot(DiffMod,aes(binL,binR,fill=HProbCount)) + geom_tile() +
theme_bw() + scale_fill_gradient(low="white",high="red")

ggplot(DiffMod,aes(binL,binR,fill= HCount)) + geom_tile() + theme_bw() +
scale_fill_gradient(low="white",high="red")

 

I can get the intervals right in the legend using;

ggplot(DiffMod,aes(binL,binR,fill=HProbCount)) + geom_tile() +
theme_bw() +
scale_fill_gradient(low="white",high="red",breaks=c(0,50,100,150))

 

but this has no impact on the gradients used to colour the plots;

 

Cheers

Dennis

 

 


	[[alternative HTML version deleted]]

