On 2/8/2015 7:41 PM, Evan Cooch wrote:
> Greetings --
>
> Graphics newbie (I generally don't use R for graphics, so if the 
> question is 'obvious', point that out gently ;-)
>
> I'm trying to use levelplot in the lattice package, to generate what 
> I'll call a 'decision table', where optimal decisions (discrete, on 
> the interval [0.0,0.5] by increments of 0.1) from a dynamic 
> programming problem are plotted as a function of time since the time 
> horizon. The 'matrix' I'm trying to plot is 100 rows x 10 columns. 
> While using the following works, more or less...
>
> rgb.palette <- colorRampPalette(c("red", "green"), space = "rgb")
> levelplot(t(results$policy), main="optimal harvest", xlab="time from 
> end", ylab="state (N)", col.regions=rgb.palette(6), cuts=6, 
> at=seq(0,0.5,0.1))
>
>

Sufficient solution to the problem for now -- adding the option 
aspect="fill" fills the window, and if I specify the size of the window, 
then this amounts to the same thing, more or less.

Seems kind of a backward way to do it. I'd have thought setting size of 
the graphic, and then having the window size change dynamically around 
said graphic, would have been more intuitive.




        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to