Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima



Hello, All:
Years ago, I had some limited exposure to Maxima, and recently have re-started using it. I have found many issues/oddities concerning plotting. Some may be caused by my misunderstanding or inability to find relevant information, perhaps others may be (missing) features, or bugs. ?Please, see below for a few items, and thanks in advance for any helpful comment.

1) It seems that getting several plot windows?simultaneously?displayed is problematic, buggy, undocumented or impossible depending upon the specific environment.

On Xmaxima (Ubuntu) it seems Options--> Plot Windows --> Multiple only *may* work with the openmath plotting interface... having no effect when gnuplot is utilised. ?Even then, it seems to work inconsistently. For example:
block(n:3, plot2d(sin(n*x),[x,0,2*%pi]));
block(n:3, plot2d(sin(n*x),[x,0,2*%pi]));
show each plot in its own separate window, and both are kept simultaneously open until closed by the user.?

However, inexplicably?
block(for n in [2,3] do plot2d(sin(n*x),[x,0,%pi]));
results in only one window showing the last plot, sin(3x). Probably only one window is open and the first plot is overwritten. ?I can see no logical reason why calling the plot2d function twice from inside a loop would somehow affect the ability for each plot to appear on its own window.

Again, the above applies to openmath. If gnuplot is chosen, it appears that the multiple plot windows option is always ignored regardless of the loop.

As for wxMaxima, it appears that the equivalent menu choice, plot windows, is not offered at all. As far as I can see, it is not possible (or documented) how to get simultaneous multiple plot windows from wxMaxima.

This situation is very unfortunate because some math software makes this functionality extremely easy for the usert. For example, in matlab the command figure (possibly with options) opens a new plot window (from a script or in interactive mode)

1.5) According to:
?http://www.linuxquestions.org/questions/linux-software-2/gnuplot-how-to-plot-individual-plots-in-separate-windows-799327/
gnuplot does support several simultaneous windows through??
set term x11 #?where # is a positive integer... example:
set term x11 0
plot sin(x)
set term x11 1
plot cos(x) , presumably results in each function plotted in its own window.
However, I tried to put set term x11 # inside a gnuplot?preamble, and did not seem to work.

2) A related functionality is the ability to plot several functions on the same axis?sequentially, possibly within a loop. In matlab, this is easily implemented (inside or outside loops) through the binary variable hold. Hold on makes matlab keep on plotting on the same axis (window), until hold off or figure is invoked. ?As of 2006, according to http://www.math.utexas.edu/pipermail/maxima/2006/002796.html?such functionality was impossible in Maxima because gnuplot was (is) "restarted?every time?you enter a plot command". The offered workaround was to construct a list of functions to be plotted, say curves, ?and eventually call plot2d(curves, [x,x1,x2])
While the workaround seems ingenious and easy to implement once known, it seems difficult for a new user to think of it, and manuals/tutorials seem to omit mentioning.
It would seem that the "hold on" functionality could be implemented in Maxima, by holding the current plot data (what is sent to gnuplot) in memory, and when the next plot command is invoked, Maxima could combine the new plot data with the one in memory and pass the combined data to gnuplot. For gnuplot it would be like a brand new call, but Maxima would give the user the illusion that the new plot is being added on top of the previous one.

3) One workaround for the lack of a multiple plot windows functionality is to save the file corresponding to each plot, from within a loop. Here, besides convenience considerations, a main issue is to dynamically generate appropriate file names. The best I have come up with so far is something like:
pname:sconcat("plot_",a[ind1],"_",b[ind2],".eps");

plot2d(foo(x,-------),[x,0,100],[gnuplot_term,ps],[gnuplot_out_file,pname]);

ind1 and ind2 are loop variables, a[], b[] are list with parameter values, and foo(x,-------) is a function to be plotted, which depends on the a and b values. A pname would look like plot_2_3.eps .
Perhaps there is a much better way to do this. Anyhow, the above seem minimally or no documented, and is something a new user may need relatively soon in its Maxima journey.


Thanks for your attention.


Virgil