Menu

#3238 plot fails with small x-range (1E-14) due to rounding

None
closed
7
2024-05-07
2016-11-10
ukkoo
No

Following simple line fails to create a plottable file in gnuplot with wxMaxima 15.08.1+git, Windows7.:

plot2d(t,[t,0,1E-14]);

Obvious reason are line 8 and 11 in the maxout.gnuplot file, which both define a zero x-range for plotting:

set xrange [0.00000000 : 0.00000000]
...
plot [0.00000000 : 0.00000000] '-' notitle with lines lt rgb "#0000ff"

Maxima seems to write rounded numbers (zero instead of 1E-14), which is not sufficient here.

Sorry, in case I should be wrong in this group, just let me know.

Discussion

  • ukkoo

    ukkoo - 2016-11-11

    Same problem in version 16.04.02:
    "Message from maxima's stderr stream: "C:/Users/Hi/maxout3384.gnuplot", line 128: Can't plot with an empty x range!"

     
  • ukkoo

    ukkoo - 2016-11-11

    Probably wrong here. Transferred to:
    https://github.com/andrejv/wxmaxima/issues/805

     
  • Jaime E. Villate

    Thanks for reporting this bug. It was correct to report it here! It is definitely a bug in plot2d, which Maxima (and not Wxmaxima) is responsible for. In fact, I think I might be responsible for having introduced this bug a long time ago. Changing the format used to output the x and y intervals in the file passed to Gnuplot fixes this, but I'd first like to investigate the side effects of that change before jumping into a quick fix that may break down other plots.

     
    • ukkoo

      ukkoo - 2016-11-17

      Meanwhile the problem was discussed and a solution was found, as stated on the other list:
      https://github.com/andrejv/wxmaxima/issues/805
      Thank you all very much for your help!

       

      Last edit: ukkoo 2016-11-17
  • Jaime E. Villate

    • status: open --> closed
    • assigned_to: Jaime E. Villate
     
  • Jaime E. Villate

    This bug has been fixed with commit [c760aa]. Notice that gnuplot's option 'set zero', introduced in commit [e2a6f5], doesn't solve the problem and it looks to me that it doesn't do anything with respect to plots obtained with Maxima. However, I will leave that option there because it seems harmless.

     

    Related

    Commit: [c760aa]
    Commit: [e2a6f5]

  • Robert Dodier

    Robert Dodier - 2024-05-07
    • labels: plot, gnuplot --> gnuplot, plotting, plot2d
     

Log in to post a comment.

MongoDB Logo MongoDB