comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Fast Filled Contour Plots
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Fast Filled Contour Plots [message #79877] Wed, 18 April 2012 05:30
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> I've figured out how to retrieve the grid from the map
> object, and I can change its color and presumably other
> properties, but this also changes the color of the
> labels, which I *don't* want to do. Is there a way
> to have my cake and eat it too, without creating
> a second grid, perhaps without labels, that I stack
> on top of the first?

Ah, never mind. I've found the LABEL_COLOR property,
as well as others. This is beginning to look like
what I intend it to look like.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Fast Filled Contour Plots [message #79878 is a reply to message #79877] Wed, 18 April 2012 05:24 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
alx writes:

> I cannot experiment by myself today, but here is my guess:
> The MAP function already creates an object grid. The LABEL_POSITION=0
> puts it "outside". You can suppress it by doing LABEL_SHOW=0 and,
> likely, you can adjust it (step, labels, etc...) by using (poorly
> documented) keywords... You added to my code a MAPGRID call, producing
> the additional grid with default properties ("inside" labels, etc...);
> I think that you can merely suppress it.

Ah, ok, sorry. I didn't realize I put that there. So, now
I have removed the second grid, and I have a single grid.
But, I want the grid lines to recede into the background
of the plot. I don't want them to be the strongest visual
element in the plot. I want people to concentrate on the
data!

I've figured out how to retrieve the grid from the map
object, and I can change its color and presumably other
properties, but this also changes the color of the
labels, which I *don't* want to do. Is there a way
to have my cake and eat it too, without creating
a second grid, perhaps without labels, that I stack
on top of the first?

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Fast Filled Contour Plots [message #79880 is a reply to message #79878] Wed, 18 April 2012 02:06 Go to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
On 18 avr, 06:32, David Fanning <n...@idlcoyote.com> wrote:
> Folks (and Alain in particular),
>
>> Thanks, that works great! I've updated the page with this
>> useful information.
>
>>   http://www.idlcoyote.com/graphics_tips/fastfill.php
>
> I had to run off to play tennis this afternoon, so just
> managed to get this updated article on the web page before
> I left.
>
> I've just come back to understand it a little better,
> and I notice there is a sort of "shadow" grid under the
> outside grid. In fact, if you look carefully, you can
> see two grids seemingly being rendered. I think the
> "outside grid" is the one with the labels on the edge
> of the map, and the "inside" grid is the gray values
> on the interior of the map.
>
> Any ideas for how to deal with the inner grid?
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
>

I cannot experiment by myself today, but here is my guess:
The MAP function already creates an object grid. The LABEL_POSITION=0
puts it "outside". You can suppress it by doing LABEL_SHOW=0 and,
likely, you can adjust it (step, labels, etc...) by using (poorly
documented) keywords... You added to my code a MAPGRID call, producing
the additional grid with default properties ("inside" labels, etc...);
I think that you can merely suppress it.
alx.
Re: Fast Filled Contour Plots [message #79883 is a reply to message #79880] Tue, 17 April 2012 21:32 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks (and Alain in particular),

> Thanks, that works great! I've updated the page with this
> useful information.
>
> http://www.idlcoyote.com/graphics_tips/fastfill.php

I had to run off to play tennis this afternoon, so just
managed to get this updated article on the web page before
I left.

I've just come back to understand it a little better,
and I notice there is a sort of "shadow" grid under the
outside grid. In fact, if you look carefully, you can
see two grids seemingly being rendered. I think the
"outside grid" is the one with the labels on the edge
of the map, and the "inside" grid is the gray values
on the interior of the map.

Any ideas for how to deal with the inner grid?

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Fast Filled Contour Plots [message #79885 is a reply to message #79883] Tue, 17 April 2012 15:52 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Alain writes:

> The problem in Chris Torrence's code comes from the fact that the
> longitude range in MAP_CONTINENTS is -180°,180° by default, while you
> are using 0°,360° in your example. The trick would be to overplot a
> suitable map over your image:
> im = IMAGE(scaledData, x, y, RGB_TABLE=rgb, XRANGE=xrange,
> YRANGE=yrange, GRID_UNITS='degrees', POSITION=[0.1,0.1,0.9,0.9])
> mp = map('EQUIRECTANGULAR', LIMIT=limit, LABEL_POSITION=0,
> POSITION=[0.1,0.1,0.9,0.9], /CURRENT)
> mc = MapContinents(FILL_COLOR=!COLOR.DARK_GRAY, LIMIT=limit)
> Everything is now correctly clipped and displayed, including the grid
> overlay.
> Note the use of FILL_COLOR instead of COLOR to get continents of the
> right color.
> There is no bug here, just tricky usage of partly (un)documented
> keywords...

Thanks, that works great! I've updated the page with this
useful information.

http://www.idlcoyote.com/graphics_tips/fastfill.php

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Fast Filled Contour Plots [message #79886 is a reply to message #79885] Tue, 17 April 2012 15:18 Go to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
On 17 avr, 21:33, David Fanning <n...@idlcoyote.com> wrote:
> As I was working on this, Chris Torrence graciously supplied
> some IDL 8.x code to do the same thing. I've included the
> code Chris sent me in the article. Unfortunately, it
> probably does more to expose the limitations of the new
> function graphics system than it does to illuminate the
> features. But, perhaps I have done something wrong. If
> anyone has suggestions (Alain?) for how I can fix this,
> I am all ears.

Your welcome, David.
The problem in Chris Torrence's code comes from the fact that the
longitude range in MAP_CONTINENTS is -180°,180° by default, while you
are using 0°,360° in your example. The trick would be to overplot a
suitable map over your image:
im = IMAGE(scaledData, x, y, RGB_TABLE=rgb, XRANGE=xrange,
YRANGE=yrange, GRID_UNITS='degrees', POSITION=[0.1,0.1,0.9,0.9])
mp = map('EQUIRECTANGULAR', LIMIT=limit, LABEL_POSITION=0,
POSITION=[0.1,0.1,0.9,0.9], /CURRENT)
mc = MapContinents(FILL_COLOR=!COLOR.DARK_GRAY, LIMIT=limit)
Everything is now correctly clipped and displayed, including the grid
overlay.
Note the use of FILL_COLOR instead of COLOR to get continents of the
right color.
There is no bug here, just tricky usage of partly (un)documented
keywords...
alx.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: speed-up computation of kernel-based "statistics"
Next Topic: Map Function Question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:44:04 PDT 2025

Total time taken to generate the page: 0.00494 seconds