Re: contour plots

From: Marston Johnston <shejo284_at_nyahnyahspammersnyahnyah>
Date: Thu Nov 14 2013 - 08:35:11 MST

Hi Maria,

Thanks a lot! That solved the problem. I used a different method to shift
the bin limits and spacing, but the effect is the same as you suggested.

/M

On Thu, Nov 14, 2013 at 4:17 PM, Maria Gehne <mgehne@ucar.edu> wrote:

> Hi Marston,
>
> ncl puts the tickmarks in the center of the cells you are plotting. I
> think that's the default behavior. If you want the tickmarks to be between
> the cells you need to manually shift the tickmark label locations by 0.5.
>
> The grids look uneven now, because only half the cells at the bottom and
> on the left are shown in the plot. If you move the tickmark values that
> should fix it. I used
>
> res@tmYLMode = "Explicit"
> res@tmYLValues = ispan(1980,2010,5)-0.5
> res@tmYLLabels = ispan(1980,2010,5)
> res@tmYLMinorValues = years-0.5
>
> for an array that had years as the left-most dimension.
>
> Hope this helps,
> Maria
>
>
>
> On 11/14/2013 05:09 AM, Marston Johnston wrote:
>
> Hi Caspar,
>
> I've plotted the fig again and this time with the same x-axis length. It
> looks like the contour squares crossed the cell boundaries, which is ok,
> but they end in the middle of a cell, that to me seems strange. Do you see
> this happening in the fig attached?
> I've tried using "cellfill" instead of "rasterfill" and the cell fill
> shows cells smaller than the bins. Strange?
>
> /M
>
>
> On Thu, Nov 14, 2013 at 12:53 PM, Caspar Ammann <ammann@ucar.edu> wrote:
>
>> I think if you set the x-axis the same for all plots, you might see that
>> the ticks are treated equally in all plots. The only difference I see in
>> your image is between the top row and the ones below, but looking more
>> closely: all of the grids line up with the bins just fine, there are just
>> many more bins in the top figures.
>>
>> Caspar Ammann
>> National Center for Atmospheric Research
>> RAL - Climate Science and Applications Program
>>
>> On Nov 14, 2013, at 4:32 AM, Marston Johnston <shejo284@gmail.com> wrote:
>>
>> > Hi,
>> >
>> > I have an array that is time vs rain rates and the cell size of this
>> array is 1 x 1, i.e., the
>> > time axis runs from 0 to 24 at every hour and the rain rates axis runs
>> from 0 to 60 at every 1 mm/hr. When I plot this array with gsn_csm_contour
>> I get pixels that do not match up with the bins size (ticks on the axis),
>> giving the impression that the contour plots using shifted bins or
>> something like that.
>> >
>> > I've attached the image. I would appreciate some help in understanding
>> what NCL is doing.
>> >
>> > Sincerely,
>> > /M
>> > <diurnal_dc.pdf>_______________________________________________
>> > ncl-talk mailing list
>> > List instructions, subscriber options, unsubscribe:
>> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
>
> --
> Only the fruitful thing is true!
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> --
> Maria Gehne
> Postdoctoral Fellow
> NCAR/CGD/CAS
> P.O. Box 3000
> Boulder, CO 80307
>
>

-- 
Only the fruitful thing is true!

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 14 08:35:24 2013

This archive was generated by hypermail 2.1.8 : Fri Nov 22 2013 - 09:36:32 MST