This bug was discovered by Claude Opus 5.5 and reproduced on Maxima Git commit c62924c (2026-09-26) with SBCL 2.2.9.
Where: src/plot.lisp, DRAW2D
With logy, DRAW2D compares the logarithm of each y value against the linear bounds of the y range, and only afterwards applies EXP. So values inside the range are counted as clipped.
src/plot.lisp as described under "Fix".tests/rtest_plotoptions.mac, at the end of the file.make check, or run_testsuite(share_tests=true); in ./maxima-local), and check that the change breaks no test. Failures that also occur without the change (a run on the unchanged build shows which) are pre-existing and can be ignored.* \#5482 plot2d with logy warns that values will be clipped when none are to ChangeLog, under "Bug fixes for numbered bugs:".Fixed by commit [1a2b3c]., with the first six characters of the commit's SHA in the brackets (git rev-parse HEAD | cut -c1-6 prints them). SourceForge links this to the commit.plot2d(x^2,[x,1,10],[y,0.5,200],logy,[plot_format,gnuplot],[run_viewer,false],[gnuplot_script_file,"/tmp/b28.gp"]);
Before the fix:
plot2d: some values will be clipped.
Correct result:
no clipping message
In src/plot.lisp (DRAW2D, loop "Fix up out-of-range values", line "(if (numberp (car y))"), replace
((null y))
(if (numberp (car y))
with
((null y))
(when (and (getf plot-options '$logy)
(numberp (car y)))
(setf (car y) (exp (car y))))
(if (numberp (car y))
In src/plot.lisp (DRAW2D, same loop, block "(when (and (getf plot-options '$logy)" at its end), replace
(setf (car x) (exp (car x))))
(when (and (getf plot-options '$logy)
(numberp (car y)))
(setf (car y) (exp (car y)))))
with
(setf (car x) (exp (car x)))))
Add these lines to tests/rtest_plotoptions.mac, separated from the tests before them by two empty lines:
/* Bug #5482: "plot2d with logy warns that values will be clipped when none are" */
block ([gpfile: sconcat ("rtest_plotoptions_", ?getpid (), ".gnuplot"),
s1: make_string_output_stream (), s2: make_string_output_stream (),
r],
reset_plot_options (),
with_stdout (s1, plot2d (x^2, [x, 1, 10], [y, 0.5, 200], logy,
[plot_format, gnuplot], [run_viewer, false],
[gnuplot_script_file, gpfile])),
with_stdout (s2, plot2d (x^2, [x, 1, 10], [y, 1, 5], logy,
[plot_format, gnuplot], [run_viewer, false],
[gnuplot_script_file, gpfile])),
r: [ssearch ("clipped", get_output_stream_string (s1)),
integerp (ssearch ("clipped", get_output_stream_string (s2)))],
reset_plot_options (),
r);
[false, true]$
plot2d: fix spurious clipping message with logy
With logy, DRAW2D compared the logarithm of each y value with the linear
bounds of the y range and applied EXP only afterwards, so values inside
the range were reported as clipped. Apply EXP before the comparison.
This fixes bug #5482.
Found and fixed by Claude Opus 5.5.
Diff: