Skip to content
Back to formatted view

Raw Message

Message-ID: <003001d4bda2$1e8b8a40$5ba29ec0$@sbcglobal.net>
Date: 2019-02-05T22:28:28Z
From: reichm@@j m@iii@g oii sbcgiob@i@@et
Subject: Calendar Heat Map

r-Help Form

 

I'm working on a "Time-Series Calendar Heatmap" using the following code.

 

ggplot(myData, aes(monthweek, weekdayf, fill = myData $adjusted)) + 

geom_tile(colour = "white") + facet_grid(year(myData $date)~monthf) + 

scale_fill_gradient(low="red", high="green") + 

xlab("Week of Month") + ylab("") + 

ggtitle("Time-Series Calendar Heatmap ") + labs(fill = "Price")

 

While the ggplot commands do (almost) what I want I can't figure out how to
change my color scaling. While scale_fill_gradient(low="red", high="green")
does what I ask, that is create a color gradient from red to green it not
what I thought it would be. What I need is discreet colors something like 0
- grey; 1:5 - blue; 6:10 - green etc.  How to I set discrete colors for
groups of values. A color ramp would work but I need to separately color
those cells with 0 counts.

 

Jeff Reichman


	[[alternative HTML version deleted]]