Re: ListPlot with missing values
- To: mathgroup at smc.vnet.net
- Subject: [mg22342] Re: ListPlot with missing values
- From: aram at sirius.com (Aram Schiffman)
- Date: Fri, 25 Feb 2000 21:13:36 -0500 (EST)
- References: <892pd1$pj6@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
>Does anyone have a Mathematica routine that behaves like ListPlot with
>PlotJoined->True, where the data have missing values (given by a set
>number, or if preferred by being out of range) and only joins
>non-missing values. Assume the listis long (500-600 points) and there
>may be quite a few (100-200) missing values. Such a routine wouldbe a
>big help.
>
I'm not sure what constitutes a "missing value". I assume you mean x
values with no corresponding y values. Here's one way, if I understand
your question:
===================
alist = {{1, 1}, {2, 3}, {4,}, {5, 6}, {7,}, {9, 12}}
ListPlot[Complement[alist, Cases[alist, {x_, Null}]], PlotJoined ->
True]
===================
In this example, the missing values are just plain missing. If the
missing y values are instead indicated by a particular value,
substitute that value for "Null" above.
The length of the list won't matter.
Aram Schiffman '99 VFR800