Re: trigrid + triangulate -> zero values -> ignore zeros on cgcontour [message #87301 is a reply to message #87300] |
Thu, 23 January 2014 07:47   |
jkobori19
Messages: 8 Registered: January 2014
|
Junior Member |
|
|
On Thursday, January 23, 2014 3:31:24 PM UTC+1, Matthew Argall wrote:
>> it gives an error: CONTOUR: Invalid value specified for keyword LEVELS: No finite elements.
>
>
>
>>> userLevels = IndGen(levels) * step + Min(mx)
>
>
>
> Your "userLevels" do not have any finite elements. Check to see what they are. Perhaps set the /NAN keyword in the Min function.
>
>
>
> IDL> data = dist(256)
>
> IDL> userlevels = indgen(10)
>
> IDL> userlevels = cgscalevector(userlevels, min(data), max(data))
>
> IDL> print, userlevels
>
> 0.00000 20.1133 40.2265 60.3398 80.4530
>
> 100.566 120.680 140.793 160.906 181.019
>
> IDL> cgcontour, data, /fill, LEVELS=userlevels
>
>
>
> IDL> userlevels[3] = !values.f_nan
>
> IDL> cgcontour, data, /fill, LEVELS=userlevels
>
> IDL> userlevels += !values.f_nan
>
> IDL> print, finite(userlevels)
>
> 0 0 0 0 0 0 0 0 0 0
>
> IDL> cgcontour, data, /fill, LEVELS=userlevels
>
> % CONTOUR: Invalid value specified for keyword LEVELS: No
>
> finite elements.
>
> % CONTOUR: Invalid value specified for keyword LEVELS: No
>
> finite elements.
>
> % CONTOUR: Invalid value specified for keyword LEVELS: No
>
> finite elements.
Hi,
actually, for some reason now it doesn't give an error when using missingvalue... And it works fine! I don't know what did I do wrong so far,
but the plot seems to be OK now. I just change the elements of matrix to zero, where the particular value is greater then, let's say, 27,
then applying the missingvalue keyword, and everything looks good!
Thank You very much guys!
Actually, one more thing: when I ignore zeros, there will be less color levels on the plot, since the color corresponding to zero disappears. Is there a solution for this?
|
|
|