I have a question in relation to 'lattice' graphics contour plots. I have been trying to create a contourplot using the code below, and am running into an issue with the display ranges. Basically, the contourpplot function uses the ranges for my response(z) variable, ABSerror.
However, the plotted data does not ever reach these 'min,max' limits as they are averaged by the predictor variables (hour, weekday). Is it possible to calculate the display range for lattice graphs and set these as the new limits for the colour legend? I don't want to set absolute limits for the z vector as this would make the code less robust, and would need to change every time I run it.
contourplot(ABSerror ~ hour * weekday,
data = SummaryData,
cuts = 20,
labels=TRUE,
contour=FALSE,
region = TRUE,
xlab = "Hour of Day",
ylab = "Day of Week",
col.regions=colorRampPalette(c("blue","yellow","red")),
main = "ABS error")
If necessary, I can try to make the data available online to better explain what I am trying to achieve.
EDIT: More Information
I've now made my code available online here: http://danielcoakley.com/projects/energy-simulation/
The dataset I am using can be found here: SummaryData
Here is the graph I'm getting. As you can see, the data does not reach the ranges shown in the legend. I'm still not sure how this can be fixed.
ABSerror http://danielcoakley.com/project/Model/Current%20Model/Results/ABSerror.png