[ncl-talk] Setting X-axis for proper data plotting

Adam Phillips asphilli at ucar.edu
Thu Dec 3 18:12:48 MST 2020


Hi Jason,
Thank you for sending an easy-to-run script. I have attached a modified
script along with the resulting graphic.
Two things to note:
1 - I altered your asciiread statement to read in the data as a double,
that way you can see the correct time. I then manually created my own
yyyymmddhh array from the original time. Note that I assumed that the data
is regular and that there are not any missing timesteps from
20061221-20191231.95833. Once I passed the yyyymmddhh array into
yyyymmddhh_to_yyyyfrac I now have a regular time coordinate to pass into
gsn_csm_xy. This alleviates the jumping you were getting in your plot.
Please look at the print statement output and coding and make sure the
assumptions I made are correct.

2 - To get better control of the tick mark labels, I recommend setting
tmXBMode = "Explicit", and setting tmXBValues/tmXBLabels. See the
tickmarks application
page <http://www.ncl.ucar.edu/Applications/tickmarks.shtml> for other
examples of using these resources.

Hope that helps!
Adam

On Wed, Dec 2, 2020 at 2:39 PM Herb, Jason via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Hello All,
>
> I have been working with a continuous data set from late 2006 to end of
> 2019. I have been able to force the X-axis labeling as close as I can to
> get year to whole numbers, but I keep getting ".0" at the end of the year.
> Also, I have a plotting error in the actual data with the space containing
> "flat lines" between the end or one year to the start of the next. I
> attempted to setup another array for the year but get the following error
> message :
>
> fatal:Illegal subscript. Subscripts must be integer when not using
> coordinate indexing
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 36 in
> file Basiclineplot.ncl
>
> I have attached the plot, script and input file.
> Does anyone have any suggestions to assist with this plotting issue?
>
> Thanks,
> Jason
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201203/6db121df/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.png
Type: image/png
Size: 75791 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201203/6db121df/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Basiclineplot.ncl
Type: application/octet-stream
Size: 1663 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201203/6db121df/attachment.obj>


More information about the ncl-talk mailing list