[R] Plotting Very Large lat-lon data in x-y axes graph

Jim Lemon drjimlemon @ending from gm@il@com
Thu Dec 13 22:03:50 CET 2018


Hi Ogbos,
Back on the air after a few days off. I don't have your data ("QUERY
2"), but I think this will fix your problem.

library(maps)
map("world")
box()
library(plotrix)
color.legend(-180,-150,100,-130,legend=c(0,25000,50000,75000,100000),
 rect.col=color.scale(1:5,extremes=c("blue","red")),gradient="x")

Notice that I have swapped the "yb" and "yt" values so that they are
in increasing order. If they are reversed, the numbers will appear
within the color bar. Also you don't need to call color.gradient, just
pass the output of a five increment color scale from blue to red (or
whatever you like) to the rect.col argument.

Jim



More information about the R-help mailing list