Skip to content
Prev 21994 / 29559 Next

Question on histograms from Raster and RasterVIS packages

Nuno,

Does rasterVIS use base or grid graphics?

The place I usually see the error that plot.new has not been called yet is
when trying to use a base graphics function to augment a plot created using
grid graphics.  I suspect that the plot created used grid graphics and that
is why abline is not working for you.

There is a 'grid.abline' function in the grid package, though it does not
look like it would work easily for a vertical line, so you may need to dive
into the details of using grid in more detail, probably using the
grid.lines function.  There is also the gridBase package which helps grid
and base graphics play nicely together, though it could be a bit of
overkill for just adding a vertical line.
On Tue, Nov 18, 2014 at 11:21 AM, Nuno S? <nunocesardesa at gmail.com> wrote: