Re: CellFill: specify cell width?

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Wed Mar 27 2013 - 13:03:45 MDT

On Mar 27, 2013, at 12:54 PM, David Brown <dbrown@ucar.edu> wrote:

> Hi Phillip,
>
> This should be possible. However, you will need a coordinate array that specifies the bounds of each cell. Bounding coordinates cannot be attached as regular coordinate variables to the data. It also may be that the gsn_csm_contour routine would not like them. If that is the case you can try using gsn_contour instead.
>
> I notice that there are gaps between the end of each leg and the beginning of the next leg. I assume you don't really want to see them in the plot. That means your coordinate array should not represent actual time, but should be thought of as seconds of air time with 0 representing the beginning of the first leg.
>
> There should be 1 more bounding coordinate than legs (8 values). I am not going to calculate the whole scenario, but there would be 3 values to represent the beginning of the first leg to the end of the second:
>
> 0, 918, 1998, ; air time in seconds accumulated from the start of first leg.
>
> If you want the tick marks in the center of each leg then the tmXBValues should have one less values than the coordinate array and be in the center of each interval, starting with 459, 2458.
Whoops typo: that should have been 459, 1458 I think.
> Hopefully my arithmetic is correct.
>
> The tmXBLabels can remain as is.
>
> Set the coordinate array using the resource sfXArray.
> Finally set gsnXAxisIrregular2Linear to True and set trXMinF and trXMaxF to the beginning and end values of your coordinate array.
>
> If that doesn't work, send me your complete script and the data offline and I will try to take a look.
> -dave
>
> On Mar 27, 2013, at 10:28 AM, Phil Stauffer <philstau@ucar.edu> wrote:
>
>> Hello All,
>>
>> I have a contour plot of maximum vorticity, vmax(/height,flight leg/). There are 7 flight legs. What I want is to have the cell width be representative of the duration of the flight leg, since each flight leg is not the same time interval. Any I ideas on how to accomplish this?
>> Or a different approach?
>>
>> <fihghihi.png>
>>
>> Here are my plot resources:
>>
>> res = True
>> res@gsnMaximize = True
>> res@cnFillOn = True
>> res@cnFillMode = "CellFill"
>> res@cnLineLabelsOn = True
>> res@gsnSpreadColors = True
>> res@gsnFrame = False
>> res@gsnDraw = False
>> res@sfYArray = f->z
>> res@tiXAxisString = "Time (UTC)"
>> res@tiYAxisString = "Height (km)"
>> res@tiXAxisFontHeightF = 0.01
>> res@tiYAxisFontHeightF = 0.01
>> res@gsnStringFont = "helvetica"
>> res@tmYLLabelFontHeightF = 0.0095
>> res@tmXBLabelFontHeightF = 0.009
>> res@lbOrientation = "Vertical"
>> res@tmXBMajorOutwardLengthF = 0.0
>> res@tmYLMajorOutwardLengthF = 0.0
>> res@tmXBMinorOutwardLengthF = 0.0
>> res@tmYLMinorOutwardLengthF = 0.0
>> res@cnLabelMasking = True
>> res@cnLineLabelBackgroundColor = "transparent"
>> res@lbLabelFontHeightF = 0.0075
>> res@gsnLeftString = "Vertical Vorticity 10~S~-3~N~ s~S~-1~N~"
>>
>>
>> res@tmYLMode = "Explicit"
>> res@tmYLValues = fspan(0.45,11.25,19)
>> res@tmYLLabels = fspan(0.45,11.25,19)+ " "
>>
>> res@tmXBMode = "Explicit"
>> res@tmXBValues = ispan(0,6,1)
>> ;res@tmXBLabels = (/"Leg0","Leg1","Leg2","Leg3","Leg4","Leg5","Leg6"/)
>> res@tmXBLabels = (/"2214:18 -~C~2229:00", \
>> "2230:00 -~C~2248:00", \
>> "2250:00 -~C~2305:05", \
>> "2306:00 -~C~2325:00", \
>> "2326:00 -~C~2342:30", \
>> "2344:30 -~C~0001:30", \
>> "0002:45 -~C~0017:30"/)
>>
>>
>> res@tiMainString = "Maximum Bookend Vorticity"
>> res@gsnSpreadColorStart = 129
>> res@gsnSpreadColorEnd = -1
>> plot = gsn_csm_contour(wks,vmax,res)
>> draw(plot)
>> frame(wks)
>>
>>
>> Thanks,
>>
>> Phillip
>> _______________________________________________
>> 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 Wed Mar 27 13:03:59 2013

This archive was generated by hypermail 2.1.8 : Tue Apr 02 2013 - 21:23:48 MDT