maxima

Print a graph to standard output in Maxima


Is there a way in Maxima to print a graph, in SVG form, or as commands for Gnuplot, to the standard output? Due to the context, in which Maxima is called, it is essential that it is achieved by Maxima commands, not a shell script.

I tried:

but in both cases, files stdout.svg or -.svg (with the expected graph) were created in the current directory.


Solution

  • You could use printfile method to print the file content to stdout, although with this approach the file still exists in local directory

    echo 'draw2d( explicit (x ^ 2, x, -1, 1), terminal  = svg, file_name = "/tmp/output_file")$ printfile ("/tmp/output_file.svg")$' | maxima --very-quiet