From: Dan T. <dan...@gm...> - 2009-02-02 01:07:28
Attachments:
gnuplot-fit-bug.tgz
|
Hi, 1: This bug report describes how gnuplot's (x,y,z)-fit may erroneously fail on "undefined variable" when fitting it against a certain data file, and how the problem may go away if changing the name of this file. (I'm only able to make the problem go away on gnuplot version 4.2.2; conversely, on 4.2.4 the problem persists.) As data file names are involved, I'm afraid you'd be unable to reproduce the above if I not supply data files. I'm therefore attaching a gzipped tar containing what's required. The tar contains two identical data files with different names (carefully chosen through experimentation), and two gnuplot scripts (inlined below) that respectively use them, such that one triggers the problem and the other works-around it: - identical data file (containing x y z triplets): 123456789012345.dat 1234567890123456.dat - associated gnuplot scripts (differ on only one character): fit-bug.gp fit-bug-goes-away-on-4.2.2.gp 2: The following is the content of fit-bug.gp (the seemingly unnecessary lines like defining unused variables will be shortly addressed; the script is in fact "minimal", despite appearances): set terminal postscript eps set output '1.eps' xsiz=0;ysiz=0;xoff=0;yoff=0;xnum=0;ynum=0;xall=0;yall=0 set size 2,1 set multiplot set size 1,1 kb(n) = (n/1024.0) w=4; i=1; j=0; set style line 1 lt 1 set style line 2 lt 2 set style line 3 lt 3 set origin 0,0 splot '1234567890123456.dat' u 1:2:(kb($3)) t 'r', \ '123456789012345.dat' u 1:2:(kb($3)) t 'o' set origin 1,0 g(x,y) = d*x*y fit g(x,y) '123456789012345.dat' using 1:2:3:(1) via d splot '123456789012345.dat' u 1:2:(kb($3)) t 'o', \ kb(g(x,y)) t 'm' Running this generates the error "line 17: undefined variable: d". But if instead of using '1234567890123456.dat' (ends with a "6") we use '123456789012345.dat' (ends with "5"), then the problem goes away and a reasonable fit is generated. As noted, this trick only works on gnuplot 4.2.2, not on 4.2.4. 3: The suggested fix stops working if you introduce even negligible changes to the above script. This includes: (a) deleting the unneeded definitions of any of the unused variables or styles; (b) changing the order of the lines (e.g., trying to put the line that starts with "w=4" right below the line that starts with "xsiz=0"); (c) removing any of the 'o' / 'r' / 'm' curve titles; (d) not using the kb() functions; etc. 4: "Show version long" on the (Debian) machine where the workaround works: G N U P L O T Version 4.2 patchlevel 2 last modified 31 Aug 2007 System: Linux 2.6.20-1-686-bigmem Copyright (C) 1986 - 1993, 1998, 2004, 2007 Thomas Williams, Colin Kelley and many others Compile options: +READLINE -LIBREADLINE +HISTORY +BACKWARDS_COMPATIBILITY +BINARY_DATA +GD_PNG +GD_JPEG +GD_TTF +GD_GIF +ANIMATION +NOCWDRC +X11 +X11_POLYGON +MULTIBYTE +USE_MOUSE +HIDDEN3D_QUADTREE +DATASTRINGS +HISTOGRAMS +OBJECTS +STRINGVARS +MACROS +IMAGE DRIVER_DIR = "/usr/lib/gnuplot" GNUPLOT_PS_DIR = "/usr/share/gnuplot/gnuplot/4.2/PostScript" HELPFILE = "/usr/share/gnuplot/gnuplot.gih" gnuplot's show version long where the fix works: 5: The workaround doesn't work on an identical machine on which Debian's latest gnuplot package was installed: G N U P L O T Version 4.2 patchlevel 4 last modified Sep 2008 System: Linux 2.6.20-1-686-bigmem Copyright (C) 1986 - 1993, 1998, 2004, 2007, 2008 Thomas Williams, Colin Kelley and many others Compile options: -READLINE +LIBREADLINE +HISTORY +BACKWARDS_COMPATIBILITY +BINARY_DATA +GD_PNG +GD_JPEG +GD_TTF +GD_GIF +ANIMATION +NOCWDRC +X11 +X11_POLYGON +MULTIBYTE +USE_MOUSE +HIDDEN3D_QUADTREE +DATASTRINGS +HISTOGRAMS +OBJECTS +STRINGVARS +MACROS +IMAGE DRIVER_DIR = "/usr/lib/gnuplot" GNUPLOT_PS_DIR = "/usr/share/gnuplot/gnuplot/4.2/PostScript" HELPFILE = "/usr/share/gnuplot/gnuplot.gih" A fix would be appreciated. Thanks, --Dan |
From: Hans-Bernhard B. <HBB...@t-...> - 2009-02-02 22:23:03
|
Dan Tsafrir wrote: > 1: > This bug report describes how gnuplot's (x,y,z)-fit may erroneously > fail on "undefined variable" when fitting it against a certain data > file, and how the problem may go away if changing the name of this > file. (I'm only able to make the problem go away on gnuplot version > 4.2.2; conversely, on 4.2.4 the problem persists.) Actually, you seem to only have changed a file name in an splot command a couple of lines before the 'fit'. And FWIW the bug doesn't reproduce on version 4.2.3 in Windows. Which, to me, suggests this might be something particular to the Debian release package. Could you build your own gnuplot from our official source tarball and see if this still triggers? Oh, and you may want to lose the bigger-than-one size settings. Please see "help set size". |
From: Dan T. <dan...@gm...> - 2009-02-03 01:17:19
|
On Mon, Feb 2, 2009 at 5:22 PM, Hans-Bernhard Bröker <HBB...@t-...> wrote: > Dan Tsafrir wrote: > >> 1: >> This bug report describes how gnuplot's (x,y,z)-fit may erroneously >> fail on "undefined variable" when fitting it against a certain data >> file, and how the problem may go away if changing the name of this >> file. (I'm only able to make the problem go away on gnuplot version >> 4.2.2; conversely, on 4.2.4 the problem persists.) > > Actually, you seem to only have changed a file name in an splot command a > couple of lines before the 'fit'. This is exactly why I used the term "strange" to describe the bug. > And FWIW the bug doesn't reproduce on version 4.2.3 in Windows. > > Which, to me, suggests this might be something particular to the Debian > release package. Could you build your own gnuplot from our official source > tarball and see if this still triggers? I've download and compiled 4.2.4, and confirmed that gnuplot still erroneously fails with the message "undefined variable: d". > > Oh, and you may want to lose the bigger-than-one size settings. Please see > "help set size". Modifying the size to 1 didn't change anything: the bug persists. FYI, I've opened a bug report in: https://sourceforge.net/tracker/?func=detail&atid=102055&aid=2556225&group_id=2055 Dan. |
From: Thomas S. <t.s...@fz...> - 2009-02-04 09:59:30
|
seems to be a timing problem. the following script triggers the error on (all self-compiled on opensuse 10.2) 4.2.2, 4.2.3 and 4.3-cvs: set term x11 kb(n) = (n/1024.0) splot '1234567890123456.dat' u 1:2:(kb($3)) t 'r', \ '123456789012345.dat' u 1:2:(kb($3)) t 'o' g(x,y) = d*x*y pause 1 fit g(x,y) '123456789012345.dat' using 1:2:3:(1) via d other terminals (i tried postscript and dumb) don't show this behaviour. moving the function definition to the top of the script or defining the variable 'd' there makes the error go away. moving 'pause 1' one line up does the same. any ideas what i should test next? Hans-Bernhard Bröker-2 wrote: > > Dan Tsafrir wrote: > >> 1: >> This bug report describes how gnuplot's (x,y,z)-fit may erroneously >> fail on "undefined variable" when fitting it against a certain data >> file, and how the problem may go away if changing the name of this >> file. (I'm only able to make the problem go away on gnuplot version >> 4.2.2; conversely, on 4.2.4 the problem persists.) > > Actually, you seem to only have changed a file name in an splot command > a couple of lines before the 'fit'. > > And FWIW the bug doesn't reproduce on version 4.2.3 in Windows. > > Which, to me, suggests this might be something particular to the Debian > release package. Could you build your own gnuplot from our official > source tarball and see if this still triggers? > > Oh, and you may want to lose the bigger-than-one size settings. Please > see "help set size". > > ------------------------------------------------------------------------------ > Create and Deploy Rich Internet Apps outside the browser with > Adobe(R)AIR(TM) > software. With Adobe AIR, Ajax developers can use existing skills and code > to > build responsive, highly engaging applications that combine the power of > local > resources and data with the reach of the web. Download the Adobe AIR SDK > and > Ajax docs to start building applications > today-http://p.sf.net/sfu/adobe-com > _______________________________________________ > gnuplot-bugs mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-bugs > > -- View this message in context: http://www.nabble.com/-Gnuplot-bugs--strange-bug-involving-gnuplot%27s-x%2C-y%2C-z-fit-and-data-file-names-tp21782645p21827469.html Sent from the Gnuplot - Bugs mailing list archive at Nabble.com. |