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

Home » Public Forums » archive » Map Projected Contour plot - function graphics - how to change the contoured data....
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Map Projected Contour plot - function graphics - how to change the contoured data.... [message #92369 is a reply to message #92366] Wed, 02 December 2015 11:24 Go to previous messageGo to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Tuesday, December 1, 2015 at 3:03:56 PM UTC-7, Geo wrote:
> Hi there,
>
> OK so I have set up a map-projected contour plot by doing this:
>
> mp1 = map('Equirectangular', CENTER_LONGITUDE=0, $
> POSITION=[0.1,0.1,0.90,0.75], $
> LABEL_POSITION = 0, /BOX_AXES, $
> /box_antialias, $
> GRID_LATITUDE = 30, GRID_LONGITUDE = 45, $
> /CURRENT, ASPECT_RATIO=0, LIMIT=[-89.99, -180, 89.99, 180])
>
> etc., etc.
>
> and then the contour plot....
>
> cn = contour(data1, lon, lat, overplot = overplot, name='the_contour_plot',$ GRID_UNITS=2, MAP_PROJECTION='Equirectangular', $
> RGB_TABLE=rgb, /CURRENT, RGB_INDICES=Indgen(nlevels), $
> C_VALUE=levels, /FILL)
>
> So I'm contour plotting 'data1' on a standard equirectangular map. So far, fine.
>
> Now I want to change the contour plot to the show the next dataset in the sequence (lets call it data2 - it has the same dimensions as data1)
>
> This looks to be simple:
>
> cn.setdata, data2
>
> But this doesn't work - I get:
> % Not supported for MAPPROJECTION graphics.
> So obviously, when the contour plot is 'map projected' it won't do an update
> to the contour plot data itself.
>
> Any idea how I can get around this? In general I am wanting to do lots of contour plotting with different map projections - but I need to be able to change the data (like when you go from time T to time T+1).
>
> Thanks for any help,
>
> Geo

Hi Geo,

I just found & fixed a bug in the graphics code, where it was giving the same "name" to both the contour plot and the map projection. So the "cn" reference that was being returned was actually the map projection instead of the contour.

As a workaround, you can simply remove 'name="the_contour_plot"' and the problem should go away.

Cheers,
Chris
p.s. here's a simple reproduce:

mp1 = map('Equirectangular', CENTER_LONGITUDE=0, /DEBUG, $
POSITION=[0.1,0.1,0.90,0.75], $
LABEL_POSITION = 0, /BOX_AXES, $
/box_antialias, $
GRID_LATITUDE = 30, GRID_LONGITUDE = 45, $
/CURRENT, ASPECT_RATIO=0, LIMIT=[-89.99, -180, 89.99, 180])
data1 = dist(50)
lon = findgen(50)*3
lat = findgen(50)*2 - 50
cn = contour(data1, lon, lat, overplot = 1,$
GRID_UNITS=2, MAP_PROJECTION='Equirectangular', $
RGB_TABLE=33, /CURRENT, /FILL)
help, cn
cn.setdata, 35*hanning(50,50)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: chrome browser update
Next Topic: Globe ('satellite') map projection in New Graphics....

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

Current Time: Wed Oct 08 16:09:36 PDT 2025

Total time taken to generate the page: 0.00190 seconds