Re: how change values of x or y axis for contour

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Nov 12 2012 - 08:24:33 MST

On Nov 9, 2012, at 3:53 PM, Nikola Marjanovic wrote:

> Hi Mary,
>
> Thank you. That works quite well. I was hoping that there is a way to easily modify the x axis values before the contour gets created, but it seems like that cannot be done (or at least not in one line).

Nikola,

Using the same xaxis.ncl script I sent you, you could simply multiple your x coordinate array by 300 before you do any plotting:

data&y = ispan(10,80,10)
data&x = ispan(10,80,10)
. . .
data&x = 300*data&x
. . .
wks = gsn_open_wks(…)

If you do this, and you also have a "units" attribute attached to the x coordinate array, then you should change this as well:

data&x@units = "…new value…"

--Mary

>
> Thanks again,
> Nikola
>
> On Fri, Nov 9, 2012 at 1:51 PM, Mary Haley <haley@ucar.edu> wrote:
> Hi Nikola,
>
> If I understand your question correctly, then you can use "getvalues" to retrieve the values on the X axis, multiply these by 300, and then use these for the new values for the labels.
>
> See the attached "x
> axis.ncl" script.
>
> --Mary
>
> On Nov 9, 2012, at 2:40 PM, Nikola Marjanovic wrote:
>
>> Hello,
>>
>> I've made a contour plot in NCL and would like to modify the y and x axis labels or tick marks. I know there is a way to do this manually using tickmark (tm) resources by specifying tmXBMode, tmXBValues, and tmXBLabels. All I want to do is take the default values of the x axis and y axis and multiply them by a number like 300 and have that show in the figure. Is it possible to do this? I can't find any resources to do it, but it seems like it should be possible. I am confused as to whether tmXBDataLeftF and tmXBDataRightF can be used to do what I described.
>>
>> Thank you for any help,
>> Nikola
>> _______________________________________________
>> 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 Mon Nov 12 09:27:09 2012

This archive was generated by hypermail 2.1.8 : Tue Nov 13 2012 - 14:27:24 MST