Chris,
Thanks for replying. Yes, I was wondering why the object reference for cn was that is was a 'map projection' rather than a contour plot.
When you say "fixed a bug in the graphics code" - are you talking about a bug in my code snippet - or in IDL ?
Cheers
George.
On Wednesday, December 2, 2015 at 12:24:55 PM UTC-7, Chris Torrence wrote:
> 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)
|