Legend Position in Maxima Plots

Here’s something I just learned and want to share with others and record for my use the next time I need to do this and have already forgotten!

The position and appearance of the figure legend in Maxima plots drawn with plot() (by setting gnuplot_preamble) and in draw() (by setting user_preamble),  can be manipulated to any of the gnuplot options listed here.

Here are some examples:





Two y axes in Maxima 2D plots

In MATLAB, I occasionally have need for the plotyy() command for making a plot of two different functions with widely varying scales.

Turns out Maxima draw has an equivalent functionality by setting the option yaxis_secondary:


Here’s the documentation.