Image vs ggplot: how to plot color legend?
问题 Hi I have a matrix 37x73 that represent one variable (moavg) gridded with a 10x10 deg spacing (-180< LON< 180 e -90 < LAT< 90). I am able to plot it using image image(LON, LAT, moavg) but I can't display the colour bar. I would like to know if there is another function to do that (maybe ggplot) that allows me also to plot the colour legend. Many thanks 回答1: For plotting gridded spatial data, the raster and rasterVis packages are also useful. Here are a couple of examples: library(rasterVis) #