|
From: Dave H. <da...@ho...> - 2021-08-30 22:58:16
|
Gnuplot (on a Mac), 5.4p2 I have some missing data which I indicate with "x" (set datafile missing "x"), yet Gnuplot seems to be drawing a straight line between the valid data. Shouldn't it be blank instead? -- Dave |
|
From: Dave H. <da...@ho...> - 2021-09-20 22:45:15
|
Anyone? -- Dave ---------- Forwarded message ---------- Date: Tue, 31 Aug 2021 08:37:08 +1000 (EST) From: Dave Horsfall <da...@ho...> To: Gnuplot Mailing List <gnu...@li...> Subject: Gnuplot is interpolating between missing data Gnuplot (on a Mac), 5.4p2 I have some missing data which I indicate with "x" (set datafile missing "x"), yet Gnuplot seems to be drawing a straight line between the valid data. Shouldn't it be blank instead? -- Dave |
|
From: Gabriel D. <gab...@gm...> - 2021-09-20 23:05:19
|
Hello, If you type "help missing" in an interactive gnuplot session, you'll see the following: Gnuplot makes a distinction between missing data and invalid data (e.g. "NaN", 1/0.). For example invalid data causes a gap in a line drawn through sequential data points; missing data does not. So you should *not* set "x" as the string for missing data. Instead, try this: $DATA << END 1 1 2 2 3 x 4 4 5 5 6 x 7 7 8 8 END plot $DATA u 1:($2) w linespoints You'll get a straight line with a two gaps. I hope this helps. Gabriel Le 2021-09-20 à 18 h 45, Dave Horsfall a écrit : > Anyone? > > -- Dave > > ---------- Forwarded message ---------- > Date: Tue, 31 Aug 2021 08:37:08 +1000 (EST) > From: Dave Horsfall <da...@ho...> > To: Gnuplot Mailing List <gnu...@li...> > Subject: Gnuplot is interpolating between missing data > > Gnuplot (on a Mac), 5.4p2 > > I have some missing data which I indicate with "x" (set datafile > missing "x"), yet Gnuplot seems to be drawing a straight line between > the valid data. Shouldn't it be blank instead? > > -- Dave > > > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > Membership management via: > https://lists.sourceforge.net/lists/listinfo/gnuplot-info |
|
From: Dave H. <da...@ho...> - 2021-09-22 03:00:41
|
On Mon, 20 Sep 2021, Gabriel Dupras wrote: [...] > Gnuplot makes a distinction between missing data and invalid data (e.g. > "NaN", 1/0.). For example invalid data causes a gap in a line drawn > through sequential data points; missing data does not. I'd forgotten that; thanks. On reflection, interpolating missing data is indeed the right thing to do (and to think that I gained a Distinction in statistics way back in my university days). > So you should *not* set "x" as the string for missing data. Instead, try > this: [...] Perfect; that's exactly what I want! Thanks; I'm not as familiar with Gnuplot as I used to be (I really must buy the book). -- Dave |
|
From: Kevin O. <rko...@gm...> - 2021-09-22 00:15:58
|
On Mon, Sep 20, 2021 at 3:45 PM Dave Horsfall <da...@ho...> wrote: > Anyone? > > -- Dave > > ---------- Forwarded message ---------- > Date: Tue, 31 Aug 2021 08:37:08 +1000 (EST) > From: Dave Horsfall <da...@ho...> > To: Gnuplot Mailing List <gnu...@li...> > Subject: Gnuplot is interpolating between missing data > > Gnuplot (on a Mac), 5.4p2 > > I have some missing data which I indicate with "x" (set datafile missing > "x"), > yet Gnuplot seems to be drawing a straight line between the valid data. > Shouldn't it be blank instead? > > -- Dave > Not having seen an answer, I'll give it a shot. I believe that this is the default for gnuplot and that having a missing datapoint entered with a '?' should do what you want. I've not tried this, but I think that does the trick. -- Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rko...@gm... PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683 |
|
From: Norwid B. <nb...@ya...> - 2021-08-31 05:45:17
|
Dave, based on an entry on stack overflow[1], an input like the following might fit your needs. Save it as file ```test.dat```, then run ```gnuplot test.dat``` (in my case, it is gnuplot 5.4.1 which was good enough, the plot includes the tick for x = 3 but discontinues the line). The MWE: ``` set style data lines set terminal png set output "see.png" i=2 plot '-' using (column(i)):xticlabels(1) title columnheader(i) A B 1 10 2 20 3 ? 4 40 5 50 e ``` credit: [1] https://stackoverflow.com/questions/22738353/gnuplot-skip-missing-data-points-and-xticlabels Norwid |