Closed grwhumphries closed 5 years ago
Ahahahaha. Yes, you are right. The plotting code uses the bathy
layer to set up a new plot in the graphics device. If the bathy
layer is missing BUT there is an existing plot, then it just plots over the top. If there was no existing plot, it'd throw an error.
I've updated the explanation and added an example of plotting without showing any bathymetry, just by setting the raster values to NA
(thanks to @Maschette for pointing that one out). https://github.com/SCAR/EGABIcourse19/commit/6d47789bf7af1372ae3adf2649fedd8b3cdbe802
Actually upon playing with this there is actually a better way. If you do as I suggested you get a constant warning:
Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
A better (and easier) option would be to set to color scale to NA:
temp$bathy[[1]]$plotargs$col<-NA
Describe the bug When trying to get an SOmap() object to NOT plot (as an example in a course) by nullifying the bathymetry field, if there is an existing plot in the plot window, it will still plot.
To Reproduce Steps to reproduce the behavior:
The above produces
If you continue with that object in the plot window and type in the console:
Instead of getting an expected error, you get:
Seems like if there's an existing plot in the plotting window, it just plots anyways.