MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ListLinePlot with null value

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107910] Re: ListLinePlot with null value
  • From: dh <dh at metrohm.com>
  • Date: Tue, 2 Mar 2010 07:54:38 -0500 (EST)
  • References: <hm831b$1cr$1@smc.vnet.net>

Hello Helen,
if you add x values to your data, you will get the interpolation for 
free. We first add x values. The we eliminate the null entries and we 
are ready to plot. E.g.:
daty = {1.31332399, 0.33851347, 2.36370295, 2.38889243,
    0.41408191, -0.56072862,
    3.46446086, -2.51034966, -2.48516018, -2.4599707,
    1.56521878, -1.40959175, -2.38440227, null, -2.33402331,
    0.69116617, null, 2.74154512, -2.2332654, -1.20807592, -2.18288644,
     1.84230304, -1.13250748, -0.10731801, -0.08212853, -1.05693905, \
-2.03174957, -2.00656009, 0.01862939, 9.04381887};
dat = Transpose[{Range[Length[daty]], daty}];
dat = DeleteCases[dat, {_, null}];
ListLinePlot[dat, InterpolationOrder -> 2, Mesh -> Full]

Daniel

On 26.02.2010 10:07, helena wrote:
> Hi, all,
>
> I'm new to Mathematica and would really appreciate it if you can help.
>
> I want a plot with quadratic spline interpolation. But I have missing
> data indicated by "null" and the output turns out to be straight lines
> joining the dots. Is it possible to have quadratic spline
> interpolation with missing values?
>
> Many thanks,
> Helena
>
> Here's my program:
>
> ListLinePlot[{{1.31332399, 0.33851347, 2.36370295, 2.38889243,
>     0.41408191, -0.56072862,
>     3.46446086, -2.51034966, -2.48516018, -2.4599707,
>     1.56521878, -1.40959175, -2.38440227, null, -2.33402331,
>     0.69116617, null, 2.74154512, -2.2332654, -1.20807592, -2.18288644,
>      1.84230304, -1.13250748, -0.10731801, -0.08212853, -1.05693905,
> -2.03174957, -2.00656009, 0.01862939, 9.04381887
>     }}, InterpolationOrder ->  2, Mesh ->  Full]
>
>


-- 

Daniel Huber
Metrohm Ltd.
Oberdorfstr. 68
CH-9100 Herisau
Tel. +41 71 353 8585, Fax +41 71 353 8907
E-Mail:<mailto:dh at metrohm.com>
Internet:<http://www.metrohm.com>



  • Prev by Date: Re: Efficient representation of many different primitives
  • Next by Date: Re: Re: CONDITION/DATA ANALYSIS/PLOTS
  • Previous by thread: Re: Behavior of Longest
  • Next by thread: Developing C code with Workbench