[R] Problems trying to place a global map with Ncdf data plot

Roy Mendelssohn - NOAA Federal roy@mende|@@ohn @end|ng |rom no@@@gov
Sun Feb 17 17:22:00 CET 2019


Hi:

> On Feb 16, 2019, at 9:33 AM, rain1290--- via R-help <r-help using r-project.org> wrote:
> 
>> ggplot()+geom_point(aes(x=nc_lon,y=nc_lat,color="onedaymax"),
> size=0.8)+borders("world",
> colour="black")+scale_color_viridis(name="onedaymax")+theme_void()+coord_quickmap()
> *Error: Aesthetics must be either length 1 or the same as the data (128): x,
> y, colour*

Maybe I am missing something (i am old and it is early on a Sunday),  but I don't see whee the dataset is defined in either ggplot or geom_point. You must have a data frame defined that contains both your expanded grid and the precipitation data and that has to be defined in either the ggplot() call or the geom_point() cal.

HTH,

-Roy

**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn using noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.



More information about the R-help mailing list