Re: Line thickness

From: Michel dos Santos Mesquita <Michel.Mesquita_at_nyahnyahspammersnyahnyah>
Date: Tue, 12 May 2009 08:33:23 +0200

Dear Mary, Dennis, Adam and Louis,

I would like to thank you so much for the help you gave me! Thank you
very much!!!

Have a great day!

Kindest regards,

Michel

On May 11, 2009, at 5:04 PM, Mary Haley wrote:

>
> If you know what your contour levels are in advance, then
> you can use the cnLineThicknesses resource, using an
> array of line thicknesses that is the same length as
> the number of levels you have:
>
> res_at_cnLevelSelectionMode = "ExplicitLevels"
> res_at_cnLevels = (/-2.,-1.,0.,1.,2./)
> res_at_cnLineThicknesses = (/ 2., 1.,1.,1.,1./)
>
> If you don't know the contour levels, then you will need to create the
> plot first (turning off gsnFrame and gsnDraw) retrieve the contour
> levels, loop through the levels and set the thicknesses accordingly,
> and then create and draw the plot.
>
> Untested:
>
> ;
> ; Create the plot, but don't draw it just yet.
> ;
> ...
> res_at_gsnDraw = False
> res_at_gsnFrame = False
> ...
> plot = gsn_csm_contour_map(wks,data,res)
>
> ;
> ; Retrieve the contour levels.
> ;
> getvalues plot_at_contour
> "cnLevels" : levels
> end getvalues
>
> ;
> ; Create array to hold contour line thicknesses.
> ;
> nlevels = dimsizes(levels)
> cnthck = new(levels,float)
>
> ;
> ; Loop through the levels, find the one you want, and set the
> ; thickness for that level. Default the rest to 1.0.
> ;
> conlevel = -2.0
> eps = 0.001
> do i=0,nlevels-1
> if(levels(i).gt.(conlevel-eps).and.levels(i).lt.(conlevel+eps))
> then
> cnthk(i) = 2.0
> else
> cnthk(i) = 1.0
> end if
> end do
>
> ;
> ; Set the cnLineThicknesses resource, and recreate the plot, this
> ; time drawing it.
> ;
> delete(res_at_gsnDraw)
> delete(res_at_gsnFrame)
> res_at_cnLineThicknesses = cnthck
> plot = gsn_csm_contour_map(wks,data,res)
>
> --Mary
>
>
> On Mon, 11 May 2009, Michel dos Santos Mesquita wrote:
>
>> Hi everyone,
>>
>> I know NCL has the function 'gsnContourZeroLineThicknesssF', to set
>> the thickness of the zero contour.
>>
>> How can I change the thickness of line corresponding to another
>> value?
>> For example, if I want to change the thickness of the -2C
>> Temperature?
>>
>> THanks,
>>
>> Michel
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
Received on Tue May 12 2009 - 00:33:23 MDT

This archive was generated by hypermail 2.2.0 : Wed May 13 2009 - 08:40:16 MDT