Skip to content
Back to formatted view

Raw Message

Message-ID: <CAC8ss31bxHyG_gt+jP1LX-fNiDwx=kw7D8JdFo=PWtdsqe4owA@mail.gmail.com>
Date: 2018-12-14T11:38:33Z
From: Ogbos Okike
Subject: Plotting Very Large lat-lon data in x-y axes graph: SOLVED
In-Reply-To: <CA+8X3fWFB6KxwmN1c0hfPpJTw15iM2X2OUAxSudnvuHK2KepOQ@mail.gmail.com>

Dear Jim,
Good news to me!! Welcome.

I am fine. The code elegantly displayed the color.

I also tried to adjust the line:
draw.circle(lonmids[lon],latmids[lat],radius=sqrt(counts[lat,lon])/100,
    border=countcol[lat,lon],col=countcol[lat,lon]) in order to reduce
the radius of the circle in order to plot the whole data.

I am really really grateful. I will immediately include the result in
a draft manuscript to Astrophysical Journal.

With the warmest regards
Ogbos

On Thu, Dec 13, 2018 at 9:04 PM Jim Lemon <drjimlemon at gmail.com> wrote:
>
> 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