The following code:
(%i1)draw2d
(
title = "fill\\_density does not work",
proportional_axes = 'xy,
grid = true,
xrange = [-4, 0],
yrange = [-3, 3],
xlabel = "Re(h λ)",
ylabel = "Im(h λ)",
key = "stability region",
transparent = false,
color = blue,
line_width = 1,
fill_color = light_pink,
fill_density = 0.1,
nticks = 80,
ellipse(-1, 0, 1, 1, 0, 360)
);
doesn't produce the right appearance using the alpha-channel on GNUplot. Error is the following:
gnuplot> plot '/var/folders/5w/f2d_lxbd6ljfpccm36g61sb0qjr9n_/T/data18376.gnuplot' index 0 t 'stability region' w filledcurves fillstyle solid 0.1 xy=-1.0,0.0 lc rgb '#FFB6C1' axis x1y1,'/var/folders/5w/f2d_lxbd6ljfpccm36g61sb0qjr9n_/T/data18376.gnuplot' index 1 t '' w l lw 1.0 lt 1 lc rgb '#0000FF' axis x1y1
^
"/var/folders/5w/f2d_lxbd6ljfpccm36g61sb0qjr9n_/T/maxout18376.gnuplot" line 41: unexpected or unrecognized token: xy
Build-info:
(%i2) build_info();
(%o2)
Maxima-version: "5.47.0"
Maxima build date: "2024-04-01 17:37:51"
Host type: "x86_64-apple-darwin21.6.0"
Lisp implementation type: "SBCL"
Lisp implementation version: "2.4.3"
User dir: "/Users/mlomonaco/.maxima"
Temp dir: "/var/folders/5w/f2d_lxbd6ljfpccm36g61sb0qjr9n_/T"
Object dir: "/Users/mlomonaco/.maxima/binary/5_47_0/sbcl/2_4_3"
Frontend: false
Image produced attached.
Tried to run manually within gnuplot its compiled line above and omitted the
xy=-1.0,0.0and it seems to work. So it's not a Gnuplot issue, rather some leftoverxytag in the lisp code.I have attached the
gnuplotfile that a pared-down MNWE creates.Before ripping out the offending code, I have asked the gnuplot developers for clarification on the history and possible meaning of
xy=. According to our git repository, the offending code has been in thedrawpackage from its original commit, 18 years ago.So, I guess
fill_densityinellipseobjects has not been checked.About
filledcurves xy=, see:https://gnuplot.sourceforge.net/docs_5.4/Gnuplot_5_4.pdf#section*.110
Therefore, next command works:
Thanks, Tomio.
With the attached patch, the user's code runs without error.
Thanks, Leo.
I saw your patch, then I noticed that your modified strings are different :)
" ~a w filledcurves xy=~a,~a ~alc ~a axis ~a"" ~a w filledcurves xy=~a,~a ~a lc ~a axis ~a"By the way, a potential problem is here:
(This patch fixes the following issue. So, were you able to append this to your patch?)
The next example reproduces the error:
I've applied the patches posted by Leo and Tomio, thanks a lot. I also added the examples shown in this bug report to share/draw/rtest_draw.mac. I pushed those changes as commit 1a034e4. Closing this ticket as fixed.
Sorry to check back on this: I brewed maxima on MacOS Sequoia and I dont see the fix being kicked in.
Brew says:
The fix will be in a post 5.47.0 release. That has not been made yet.