|
From: <pl...@pi...> - 2011-10-04 09:20:57
|
Hi, I have found what appears to be a defect in variable assignments in plot. gauss0(x)=a0*exp(-(x-pk0)**2/b0)+c0 a1=a0;b1=b0;c1=c0;pk0=-141; add_one(x)=area0=1; plot area0=0\ , datafile using 1:(add_one($2)) w l\ , datafile using 1:(($2)) w l\ , gauss0(x) tit 'fitted peak0'\ print "area0=",area0; I was expecting this to do the assignment area0=0 once and once only before any of the lines were plotted. It is only assigned once for the datafile plots but adding the function plot causes this snippet to print a value of zero , not one. I am inferring that using a mix of data and function plots is causing the initial assignment to be done twice. Bug or feature? best regards, Peter. |
|
From: Ethan M. <merritt@u.washington.edu> - 2011-10-04 15:30:58
|
On Tuesday, 04 October 2011, pl...@pi... wrote:
> Hi,
>
> I have found what appears to be a defect in variable assignments in plot.
>
> gauss0(x)=a0*exp(-(x-pk0)**2/b0)+c0
> a1=a0;b1=b0;c1=c0;pk0=-141;
> add_one(x)=area0=1;
This defines the function add_one(x)
to be add_one(x) = value of (area0=1)
= 1
So add_one(x) = 1 for all x
Any later changes to the value of area0 are not relevant.
Ethan
> plot area0=0\
> , datafile using 1:(add_one($2)) w l\
> , datafile using 1:(($2)) w l\
> , gauss0(x) tit 'fitted peak0'\
>
> print "area0=",area0;
>
> I was expecting this to do the assignment area0=0 once and once only
> before any of the lines were plotted.
>
> It is only assigned once for the datafile plots but adding the function
> plot causes this snippet to print a value of zero , not one.
>
> I am inferring that using a mix of data and function plots is causing
> the initial assignment to be done twice. Bug or feature?
>
> best regards, Peter.
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
|
|
From: <pl...@pi...> - 2011-10-04 15:42:35
|
On 10/04/11 17:28, Ethan Merritt wrote: > On Tuesday, 04 October 2011, pl...@pi... wrote: >> Hi, >> >> I have found what appears to be a defect in variable assignments in plot. >> >> gauss0(x)=a0*exp(-(x-pk0)**2/b0)+c0 >> a1=a0;b1=b0;c1=c0;pk0=-141; >> add_one(x)=area0=1; > > This defines the function add_one(x) > to be add_one(x) = value of (area0=1) > = 1 > So add_one(x) = 1 for all x Exactly, so why is area still 0 after having been assigned the value 1 about 512 times?! I reiterate that if I remove the function plot I do get areas=1 after plotting. This indicates that plot is re-executing area0=0 after the second data plot and before plotting the function. /Peter. > Any later changes to the value of area0 are not relevant. > > Ethan > >> plot area0=0\ >> , datafile using 1:(add_one($2)) w l\ >> , datafile using 1:(($2)) w l\ >> , gauss0(x) tit 'fitted peak0'\ >> >> print "area0=",area0; >> >> I was expecting this to do the assignment area0=0 once and once only >> before any of the lines were plotted. >> >> It is only assigned once for the datafile plots but adding the function >> plot causes this snippet to print a value of zero , not one. >> >> I am inferring that using a mix of data and function plots is causing >> the initial assignment to be done twice. Bug or feature? >> >> best regards, Peter. >> >> ------------------------------------------------------------------------------ >> All the data continuously generated in your IT infrastructure contains a >> definitive record of customers, application performance, security >> threats, fraudulent activity and more. Splunk takes this data and makes >> sense of it. Business sense. IT sense. Common sense. >> http://p.sf.net/sfu/splunk-d2dcopy1 >> _______________________________________________ >> gnuplot-beta mailing list >> gnu...@li... >> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta >> > > |
|
From: Daniel J S. <dan...@ie...> - 2011-10-04 16:00:57
|
On 10/04/2011 10:43 AM, pl...@pi... wrote: > On 10/04/11 17:28, Ethan Merritt wrote: >> On Tuesday, 04 October 2011, pl...@pi... wrote: >>> Hi, >>> >>> I have found what appears to be a defect in variable assignments in plot. >>> >>> gauss0(x)=a0*exp(-(x-pk0)**2/b0)+c0 >>> a1=a0;b1=b0;c1=c0;pk0=-141; >>> add_one(x)=area0=1; >> >> This defines the function add_one(x) >> to be add_one(x) = value of (area0=1) >> = 1 >> So add_one(x) = 1 for all x > > Exactly, so why is area still 0 after having been assigned the value 1 > about 512 times?! Where is the value of area0 used in this set of instructions? I'm wondering if it is used as a value somewhere in the plots what its value is when utilized (0 or 1)? There is some ambiguity here in this statement: add_one(x)=area0=1; Does it mean add_one(x)=(area0=1)? Or (add_one(x)=area0)=1? It could also be that every time there is a set of data for a new plot inside of "datafile", area0 is reset to 0. And possibly that gnuplot is programmed so that area0 is set to zero, THEN check whether there is more data to plot. (And one could argue that is unintended, but again it has to be defined in documentation to remove ambiguity.) Could you explore things a little more by using the value of area0 inside the plots and figure out from the plots what value of area0 is being used? Dan > I reiterate that if I remove the function plot I do get areas=1 after > plotting. This indicates that plot is re-executing area0=0 after the > second data plot and before plotting the function. > > /Peter. > > >> Any later changes to the value of area0 are not relevant. >> >> Ethan >> >>> plot area0=0\ >>> , datafile using 1:(add_one($2)) w l\ >>> , datafile using 1:(($2)) w l\ >>> , gauss0(x) tit 'fitted peak0'\ >>> >>> print "area0=",area0; >>> >>> I was expecting this to do the assignment area0=0 once and once only >>> before any of the lines were plotted. >>> >>> It is only assigned once for the datafile plots but adding the function >>> plot causes this snippet to print a value of zero , not one. >>> >>> I am inferring that using a mix of data and function plots is causing >>> the initial assignment to be done twice. Bug or feature? >>> >>> best regards, Peter. >>> >>> ------------------------------------------------------------------------------ >>> All the data continuously generated in your IT infrastructure contains a >>> definitive record of customers, application performance, security >>> threats, fraudulent activity and more. Splunk takes this data and makes >>> sense of it. Business sense. IT sense. Common sense. >>> http://p.sf.net/sfu/splunk-d2dcopy1 >>> _______________________________________________ >>> gnuplot-beta mailing list >>> gnu...@li... >>> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta >>> >> >> > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > -- Dan Sebald email: daniel(DOT)sebald(AT)ieee(DOT)org URL: http://www(DOT)dansebald(DOT)com |
|
From: Ethan M. <merritt@u.washington.edu> - 2011-10-04 16:24:29
|
On Tuesday, October 04, 2011 08:43:02 am pl...@pi... wrote: > On 10/04/11 17:28, Ethan Merritt wrote: > > On Tuesday, 04 October 2011, pl...@pi... wrote: > >> Hi, > >> > >> I have found what appears to be a defect in variable assignments in plot. > >> > >> gauss0(x)=a0*exp(-(x-pk0)**2/b0)+c0 > >> a1=a0;b1=b0;c1=c0;pk0=-141; > >> add_one(x)=area0=1; > > > > This defines the function add_one(x) > > to be add_one(x) = value of (area0=1) > > = 1 > > So add_one(x) = 1 for all x > > Exactly, so why is area still 0 after having been assigned the value 1 > about 512 times?! Ah. I thought you were asking about the behaviour of add_one(), since its name implies that it performs an addition but in fact it is defined to always equal 1. I wondered if you didn't simply have a typo for "add_one_x = area0 +1". Anyhow... > I reiterate that if I remove the function plot I do get areas=1 after > plotting. This indicates that plot is re-executing area0=0 after the > second data plot and before plotting the function. I don't say this is good/bad, expected/unexpected, bug/feature, or simply confusing, but this is the way it has always worked. Each plot command is evaluated once to detect functions, read in data, and determine plot ranges; then it is evaluated again to fill in function values over the now-determined range; then it is plotted. If there are no functions then the second of those three operations is skipped. See also https://sourceforge.net/tracker/index.php?func=detail&aid=2907028&group_id=2055&atid=102055 Ethan > /Peter. > > > > Any later changes to the value of area0 are not relevant. > > > > Ethan > > > >> plot area0=0\ > >> , datafile using 1:(add_one($2)) w l\ > >> , datafile using 1:(($2)) w l\ > >> , gauss0(x) tit 'fitted peak0'\ > >> > >> print "area0=",area0; > >> > >> I was expecting this to do the assignment area0=0 once and once only > >> before any of the lines were plotted. > >> > >> It is only assigned once for the datafile plots but adding the function > >> plot causes this snippet to print a value of zero , not one. > >> > >> I am inferring that using a mix of data and function plots is causing > >> the initial assignment to be done twice. Bug or feature? > >> > >> best regards, Peter. > >> > >> ------------------------------------------------------------------------------ > >> All the data continuously generated in your IT infrastructure contains a > >> definitive record of customers, application performance, security > >> threats, fraudulent activity and more. Splunk takes this data and makes > >> sense of it. Business sense. IT sense. Common sense. > >> http://p.sf.net/sfu/splunk-d2dcopy1 > >> _______________________________________________ > >> gnuplot-beta mailing list > >> gnu...@li... > >> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > >> > > > > > > -- Ethan A Merritt Biomolecular Structure Center, K-428 Health Sciences Bldg University of Washington, Seattle 98195-7742 |
|
From: <pl...@pi...> - 2011-10-04 17:09:59
|
On 10/04/11 18:22, Ethan Merritt wrote: > On Tuesday, October 04, 2011 08:43:02 am pl...@pi... wrote: >> On 10/04/11 17:28, Ethan Merritt wrote: >>> On Tuesday, 04 October 2011, pl...@pi... wrote: >>>> Hi, >>>> >>>> I have found what appears to be a defect in variable assignments in plot. >>>> >>>> gauss0(x)=a0*exp(-(x-pk0)**2/b0)+c0 >>>> a1=a0;b1=b0;c1=c0;pk0=-141; >>>> add_one(x)=area0=1; >>> >>> This defines the function add_one(x) >>> to be add_one(x) = value of (area0=1) >>> = 1 >>> So add_one(x) = 1 for all x >> >> Exactly, so why is area still 0 after having been assigned the value 1 >> about 512 times?! > > Ah. I thought you were asking about the behaviour of add_one(), > since its name implies that it performs an addition but in fact it > is defined to always equal 1. I wondered if you didn't simply have > a typo for "add_one_x = area0 +1". > Anyhow... > >> I reiterate that if I remove the function plot I do get areas=1 after >> plotting. This indicates that plot is re-executing area0=0 after the >> second data plot and before plotting the function. > > I don't say this is good/bad, expected/unexpected, bug/feature, or simply > confusing, but this is the way it has always worked. Each plot command > is evaluated once to detect functions, read in data, and determine plot > ranges; then it is evaluated again to fill in function values over the > now-determined range; then it is plotted. If there are no functions then > the second of those three operations is skipped. > > See also > https://sourceforge.net/tracker/index.php?func=detail&aid=2907028&group_id=2055&atid=102055 > > Ethan > # Thanks , I can understand that bug report and how your explanation above accounts for what was reported. However, it does not seem to explain what I'm seeing. Is the order perhaps: evaluate plot data evaluate plot functions ? regards. >> /Peter. >> >> >>> Any later changes to the value of area0 are not relevant. >>> >>> Ethan >>> >>>> plot area0=0\ >>>> , datafile using 1:(add_one($2)) w l\ >>>> , datafile using 1:(($2)) w l\ >>>> , gauss0(x) tit 'fitted peak0'\ >>>> >>>> print "area0=",area0; >>>> >>>> I was expecting this to do the assignment area0=0 once and once only >>>> before any of the lines were plotted. >>>> >>>> It is only assigned once for the datafile plots but adding the function >>>> plot causes this snippet to print a value of zero , not one. >>>> >>>> I am inferring that using a mix of data and function plots is causing >>>> the initial assignment to be done twice. Bug or feature? >>>> >>>> best regards, Peter. >>>> >>>> ------------------------------------------------------------------------------ >>>> All the data continuously generated in your IT infrastructure contains a >>>> definitive record of customers, application performance, security >>>> threats, fraudulent activity and more. Splunk takes this data and makes >>>> sense of it. Business sense. IT sense. Common sense. >>>> http://p.sf.net/sfu/splunk-d2dcopy1 >>>> _______________________________________________ >>>> gnuplot-beta mailing list >>>> gnu...@li... >>>> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta >>>> >>> >>> >> >> > |
|
From: Ethan M. <merritt@u.washington.edu> - 2011-10-04 17:20:10
|
On Tuesday, October 04, 2011 10:03:10 am pl...@pi... wrote: > On 10/04/11 18:22, Ethan Merritt wrote: > > On Tuesday, October 04, 2011 08:43:02 am pl...@pi... wrote: > >> On 10/04/11 17:28, Ethan Merritt wrote: > >>> On Tuesday, 04 October 2011, pl...@pi... wrote: > >>>> Hi, > >>>> > >>>> I have found what appears to be a defect in variable assignments in plot. > >>>> > >>>> gauss0(x)=a0*exp(-(x-pk0)**2/b0)+c0 > >>>> a1=a0;b1=b0;c1=c0;pk0=-141; > >>>> add_one(x)=area0=1; > >>> > >>> This defines the function add_one(x) > >>> to be add_one(x) = value of (area0=1) > >>> = 1 > >>> So add_one(x) = 1 for all x > >> > >> Exactly, so why is area still 0 after having been assigned the value 1 > >> about 512 times?! > > > > Ah. I thought you were asking about the behaviour of add_one(), > > since its name implies that it performs an addition but in fact it > > is defined to always equal 1. I wondered if you didn't simply have > > a typo for "add_one_x = area0 +1". > > Anyhow... > > > >> I reiterate that if I remove the function plot I do get areas=1 after > >> plotting. This indicates that plot is re-executing area0=0 after the > >> second data plot and before plotting the function. > > > > I don't say this is good/bad, expected/unexpected, bug/feature, or simply > > confusing, but this is the way it has always worked. Each plot command > > is evaluated once to detect functions, read in data, and determine plot > > ranges; then it is evaluated again to fill in function values over the > > now-determined range; then it is plotted. If there are no functions then > > the second of those three operations is skipped. > > > > See also > > https://sourceforge.net/tracker/index.php?func=detail&aid=2907028&group_id=2055&atid=102055 > > > > Ethan > > # > Thanks , I can understand that bug report and how your explanation > above accounts for what was reported. However, it does not seem to > explain what I'm seeing. > > Is the order perhaps: > evaluate > plot data > evaluate > plot functions > ? Nope. Code snippetes from plot2d.c /* ** First Pass: Read through data files *** * This pass serves to set the xrange and to parse the command, as well * as filling in every thing except the function data. That is done after * the xrange is defined. */ [...] /*** Second Pass: Evaluate the functions ***/ /* * Everything is defined now, except the function data. We expect * no syntax errors, etc, since the above parsed it all. This * makes the code below simpler. If y is autoscaled, the yrange * may still change. we stored last token of each plot, so we * dont need to do everything again */ [...] if (some_functions) { [...] } /* some_functions */ [...] if (table_mode) { print_table(first_plot, plot_num); } else { /* do_plot now uses axis_array[] */ do_plot(first_plot, plot_num); } -- Ethan A Merritt Biomolecular Structure Center, K-428 Health Sciences Bldg University of Washington, Seattle 98195-7742 |