Menu

#2314 same fit a table works in 5.0 and not in 5.2

None
closed-fixed
nobody
None
2020-09-11
2020-09-10
No

The same instruction fit aB*x+bB $tab via aB,bB
works fine with the Version 5.0 patchlevel 0 last modified 2015-01-01
but does not wit the Version 5.2 patchlevel 2 last modified 2017-11-01.
yielding:
input and output datablock are the same
Thank you

Discussion

  • Ethan Merritt

    Ethan Merritt - 2020-09-10

    Not enough information. Please show a complete set of commands.

    That error message normally indicates that you are trying to read from and write to the same place, as would happen for instance if the commands were:

     set table $temp
     plot $temp
    

    So far as I know it should not be possible to trigger than message from "fit" rather than "plot", but you may have found a bug. Possible adding an "unset table" command will work around this, but it would be nice to have a reproducible example so that we can see if more recent versions of gnuplot still have this same bug.

     
  • Anglès d'Auriac

    Thank you for the fast answer

    dfBulk = 'set table $tab;\
           plot "< closest.py  Result_*_2_0.5_R1_NP 0.5843" usi (log($2)):(log($10*$2*$2));\
           fit aB*x+bB $tab via aB,bB ; \
           unset table;\
           set logs; \
           unset logs cb;\
           set xlabel "L";set ylabel "bulk(L)";\
           set title sprintf("Mass largest cluster, n=2, p=0.5, non periodic p_c=0.5843") ;\
           set label 1 at 16,screen 0.8 left sprintf("regression slope= %f (exact value= %f, prec= %.2f%%) ",aB,d
    f2d,abs(aB-df2d)*100/df2d) ;\
           plot "< closest.py  Result_*_2_0.5_R1_NP 0.5843" usi ($2):($10*$2*$2) ti "",x**aB*exp(bB) ti "";\
           '
    

    the problem arises when I call the macro
    @dfBulk
    if you want I can send also the python script closest.py and the files. Basically this script print lines of 12 numbers (%lf) each.

     
  • Ethan Merritt

    Ethan Merritt - 2020-09-10

    I am guessing that your script will work if you move the line "unset table" to come before the fit command rather than after the fit command.

     
  • Ethan Merritt

    Ethan Merritt - 2020-09-11

    Ticket moved from /p/gnuplot/support-requests/253/

    Can't be converted:

    • _milestone:
    • _priority: 5
     
  • Anglès d'Auriac

    Thanks a lot, the script works fine now with the two version 5.0 and 5.2 !

     
  • Ethan Merritt

    Ethan Merritt - 2020-09-11
    • status: open --> closed-fixed
    • Group: -->
    • Priority: 5 -->
     

Log in to post a comment.