Re: gsn_csm_contour

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Feb 03 2012 - 12:09:38 MST

Do your variables have coordinate arrays? This kind of labeling should happen automatically if you have coordinate arrays.

If var doesn't have coordinate arrays, you will have to provide the array values yourself via:

   res@sfXArray = lat
   res@sfYArray = height

where "lat" equals an array of latitude values that is either the same length as the latitude dimension of "var", or a 2D array the same size as var. For "height", this needs to be the same length as the "height" dimension of "var", or a 2D array of the same size as var.

--Mary

On Feb 3, 2012, at 10:09 PM, Xiaoyan Ma wrote:

> Mary,
> Thanks. I already reordered the array and created the plot.
> I now have the number of lat shown on the horizontal (in this case from 1 to 85), and number of height (from 1 to 200) on the vertical. I actually want the real height (km) and lat shown on the horizontal and vertical. How to do that?
>
> Thanks,
> Xiaoyan
>
> On 02/03/12, Mary Haley <haley@ucar.edu> wrote:
>> Xiaoyan,
>>
>> I don't know which dimensions of your data are lat and time, but if you mean that you are seeing lat on the vertical, and height on the horizontal, then you need to reorder your array.
>>
>> If your array has named dimensions, which you can verify with:
>>
>> printVarSummary(f->A)
>>
>> then you can use syntax like this:
>>
>> var = f->A(height | :, lon | 50, lat | :)
>>
>> --Mary
>>
>> On Feb 3, 2012, at 8:24 PM, Xiaoyan Ma wrote:
>>
>> > Dear NCL community,
>> >
>> > I use "gsn_csm_contour" to do the plotting. The variable A is in 3D, i.e. A(lat,lon,height)
>> >
>> > I used the following to make a lat-height contour for the fixed lon.
>> >
>> > var = f->A(:,50,:)
>> >
>> > plot = gsn_csm_contour(wks,var, res)
>> >
>> > As the example on the website, I should see a contour with lat on horizontal, and height on vertical. But my plot is opposite, so how to make a plot like the example.
>> >
>> > Thanks,
>> > Xiaoyan
>> > _______________________________________________
>> > ncl-talk mailing list
>> > List instructions, subscriber options, unsubscribe:
>> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Feb 3 12:09:55 2012

This archive was generated by hypermail 2.1.8 : Mon Feb 06 2012 - 14:24:56 MST