[ncl-talk] xy plot line connecting non-missing points

Mary Haley haley at ucar.edu
Fri Dec 4 09:50:02 MST 2015


Jared,

You can remove the missing points before doing an XY plot.

Assuming that you have a 1D array for the Y axis (I'll call it "y"), and a
1D array of the same length for the X axis (I'll call it "x"), then
something like this:

index_no_msg = ind(.not.ismissing(y))

plot = gsn_csm_xy(wks,x(index_no_msg),y(index_no_msg),res)


--Mary



On Thu, Dec 3, 2015 at 12:58 PM, Jared Lee <jaredlee at ucar.edu> wrote:

> Hi,
>
> I have a series of plots where each point on the x-axis is 15 minutes. My
> xy plot connects those data points with lines nicely as expected. But on
> some plots, non-missing data points only exist every 30 minutes, which
> results in isolated points, and no line segments connecting them because of
> the missing data in between. I would like to be able to connect a data
> point with a line to the next non-missing data point in the series. Is
> there a simple or straightforward way, short of redefining new data arrays
> and x-axis arrays that omit the missing data points, that can accomplish
> that task?
>
> Jared
>
> --
> ===============================
> Jared A. Lee, Ph.D.
> Project Scientist I
> Research Applications Laboratory
> National Center for Atmospheric Research
> Boulder, Colorado, USA
>
> Email: jaredlee at ucar.edu (w)
> Phone: 303.497.8485 (w)
> Web: https://staff.ucar.edu/users/jaredlee
> ===============================
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151204/9d5d600a/attachment.html 


More information about the ncl-talk mailing list