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

Home » Public Forums » archive » Re: Missing fill colours in contour plot
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: Missing fill colours in contour plot [message #82817 is a reply to message #82812] Tue, 15 January 2013 16:11 Go to previous messageGo to previous message
tortoisesaregreat is currently offline  tortoisesaregreat
Messages: 2
Registered: January 2013
Junior Member
On Tuesday, 15 January 2013 22:14:04 UTC, Coyote wrote:
> On Tuesday, January 15, 2013 1:56:23 PM UTC-7, lj...@fsmail.net wrote:
>
>> I am trying to do a contour plot of a latitude-longitude array, but I keep getting gaps in my plot, as shown in the following image: http://www.physics.open.ac.uk/~lsteele/contour.png. I'm stumped as to the reason, as it's not as if it's missing contours at the very end ranges of the contour values - it's somewhere in between. Anyhow, I'm sure the knowledgable folks on here will know!
>
>>
>
>>
>
>>
>
>> I have defined a blue-white-red colour scheme and loaded it in with tvlct, but the problem occurs with other colour schemes too. I am calculating my contour levels and colours as follows (with ncont the number of contours I'm plotting):
>
>>
>
>>
>
>>
>
>> minv = floor(min(array))
>
>>
>
>> maxv = ceil(max(array))
>
>>
>
>> maxval = max([abs(array),abs(array)])
>
>>
>
>> clevels = -maxval + findgen(ncont)/(ncont-1)*2*maxval
>
>>
>
>> ccol = floor(findgen(ncont)/(ncont-1)*250)
>
>>
>
>>
>
>>
>
>> I am then plotting my contour plot as:
>
>>
>
>>
>
>>
>
>> device, decomposed=0
>
>>
>
>> bwr_colour, red_vec, grn_vec, blu_vec
>
>>
>
>> tvlct, red_vec, grn_vec, blu_vec
>
>>
>
>> contour, array, lon, lat, $
>
>>
>
>> levels=clevels, c_colors=ccol, /fill, $
>
>>
>
>> background=cgColor('white'), color=cgColor('black'), $
>
>>
>
>> xrange=[-180,180], yrange=[-90,90], xstyle=1, ystyle=1, $
>
>>
>
>> yticks=6, ytickv=[-90,-60,-30,0,30,60,90], $
>
>>
>
>> xticks=6, xtickv=[-180,-120,-60,0,60,120,180], $
>
>>
>
>> xtitle='Longitude', ytitle='Latitude', charsize=1.5, $
>
>>
>
>> title=plotsym+' (all motions) / g m!u-1!n s!u-1!n'
>
>>
>
>>
>
>>
>
>> If anyone can offer any suggestions then I'll be very grateful, as it's bugging me now!
>
>
>
> Just seeing "lon", "lat", and "contour" causes me to think that one of your problems is that you should be using the CELL_FILL keyword, rather than the FILL keyword.
>
>
>
> http://www.idlcoyote.com/color_tips/fill_colors.html
>
>
>
> If that doesn't work, I'd try cgCONTOUR. That routine will fill up the "normal" hole Contour creates.
>
>
>
> http://www.idlcoyote.com/tips/contour_hole.php
>
>
>
> Cheers,
>
>
>
> David

Thanks David - I'll give both a try tomorrow and see what happens!
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CgWindow and multiple plots
Next Topic: Matrices

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

Current Time: Sun Oct 12 17:13:15 PDT 2025

Total time taken to generate the page: 2.00051 seconds