Hi Jatin,
My basic approach would be
load("ALL_HOURLY_NOX_Processed")
data_plot <- max_conc
dimnames(data_plot) <- list(lon = lon, lat = lat)
data_plot <- reshape2::melt(data_plot,
value.name = "max_conc")
ggplot(data_plot, aes(lon, lat, color = max_conc, z = max_conc)) +
stat_contour(aes(color = ..level.., fill = ..level..), geom =
"contour", bins = 10)
But here we hit a dead end, because stat_contour doesn't generate
lines that work with geom_polygon, and we need geom_polygon for fill.
ggplot(data_plot, aes(lon, lat, color = max_conc, z = max_conc)) +
stat_contour(aes(color = ..level.., fill = ..level..), geom =
"polygon", bins = 10)
is tantalizingly close, but not good enough. Making it work correctly
will be hard I'm afraid. See
https://github.com/tidyverse/ggplot2/issues/1066 and despair.
Something along the lines of
ggplot(data_plot, aes(lon, lat, z = max_conc)) +
geom_raster(aes(fill = max_conc)) +
geom_contour(bins = 10)
might be good enough.
Best,
Ista
> --
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example:
>
https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email
ggp...@googlegroups.com
> To unsubscribe: email
ggplot2+u...@googlegroups.com
> More options:
http://groups.google.com/group/ggplot2
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
ggplot2+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.