[ncl-talk] irregular (explicit) but equally-spaced axis
Adam Phillips
asphilli at ucar.edu
Thu May 31 12:41:37 MDT 2018
Hi Yanting,
If you are using gsn_csm_xy (and not gsn_csm_contour), you can get the axes
you want by setting xyYIrregularPoints and xyYStyle="Irregular". See the
documentation here:
http://www.ncl.ucar.edu/Document/Graphics/Resources/xy.shtml#xyYIrregularPoints
I've attached a (new) script showing how to use them, along with the
resulting graphic.
If you have further questions please reply to ncl-talk.
Adam
On Thu, May 31, 2018 at 10:51 AM, Yan-Ting Chen <aquarius83523 at gmail.com>
wrote:
> Hi Adam and NCL users,
>
> Thank you Adam for reply but it doesn't work for me. In your example plot
> type is gsn_csm_contour, however, I am doing it with gsn_csm_xy for scatter
> plot. Thus, I can't directly attach the data to an irregularly-spaced axis.
> With similar resource I get a warning message
> warning: gsnYAxisIrregular2Linear is not a valid resource in ******
> and a linear y-axis with explicit label. The levels are not
> equally-spaced.
>
> The following is how I set related resource:
>
> ypts = (/1.,3.,10.,30.,100./)
>
> res = True
> res at xyMarkLineModes = "Markers"
> res at xyMarkers = 16
> res at xyMarkerSizeF = 0.005
> res at trYMinF = 0.1
> res at trYMaxF = 50.
>
> res at tmYLMode = "Explicit"
> res at tmYLValues = ypts
> res at tmYLLabels = ypts
> res at gsnYAxisIrregular2Linear = True
> (gsnYAxisIrregular2Linear is not valid.)
>
>
> Sincerely,
>
> Yanting
>
> On Wed, May 30, 2018 at 11:32 PM, Adam Phillips <asphilli at ucar.edu> wrote:
>
>> Hi Yanting,
>> I believe the behavior that you are after is NCL's default behavior when
>> it comes to axes. I've modified Applications example axes_1.ncl, and
>> attached the script and resulting plot here. As you can see, the distance
>> between 0, 2, 10, 30 and 100 is equal. See other examples on the axes page
>> here:
>> http://www.ncl.ucar.edu/Applications/axes.shtml
>>
>> Hope that helps. If you have any further questions please respond to
>> ncl-talk.
>> Adam
>>
>>
>> On Mon, May 28, 2018 at 12:19 PM, Yan-Ting Chen <aquarius83523 at gmail.com>
>> wrote:
>>
>>> Hi all,
>>>
>>> I want to draw 2 variables in a single scattering plot with irregular
>>> Y-axis. I know there is gsnYAxisIrregular2Log etc. in hand. The problem is,
>>> I want a hybrid linear-logarithmic vertical scale like ypts = (/0., 2.,
>>> 10., 30., 100./) with equal space. That is, interval between 0 and 2 is
>>> identical to interval between 30 and 100.
>>>
>>> I tried example xy_30.ncl with specified ypts above and get a chart with
>>> somewhat distorted Y axis. I guess it's logarithmic but this is not what I
>>> want. (see attachment.) Is there any way to get an equally-spaced irregular
>>> (say, explicit level) axis?
>>>
>>>
>>> Sincerely,
>>> Yanting
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>>
>> --
>> Adam Phillips
>> Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
>> www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
>>
>> <http://www.cgd.ucar.edu/staff/asphilli>
>>
>
>
--
Adam Phillips
Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180531/592a7458/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tm.png
Type: image/png
Size: 16298 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180531/592a7458/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tm.ncl
Type: text/x-ncl
Size: 631 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180531/592a7458/attachment.bin>
More information about the ncl-talk
mailing list