Question

For example, what is a code for plotting y = x so that y- and x-axis have the same scale ?

Was it helpful?

Solution

Maxima, by default, uses gnuplot to produce 2d graphics.

If you're using this default, then you need to set the gnuplot_preamble, e.g.

plot2d(x, [x,-1,1], [gnuplot_preamble, "set size ratio -1"])$

Note the -1 means that gnuplot tries to set the scales so that the unit has the same length on both axes, while +1 sets the aspect ratio ignoring the axis scales. To make this the default, type

set_plot_option ([gnuplot_preamble, "set size ratio -1"])$

If you want to find out more about the gnuplot size options, run gnuplot from your terminal and type help set size into the console.


n.b. Most basic questions you can have about Maxima can be found somewhere in their mailing list archive: http://maxima.sourceforge.net/maximalist.html

OTHER TIPS

The axes can be made the same size using the same_xy option:

plot2d(x, [x,-1,1], [same_xy]);

or

plot2d(x, [x,-1,1], [same_xy, true]);

There is a same_xyz option for three dimensional plots.

If you're using the draw or draw3d function (or animated versions of those), then you have to pass the proportional_axes graphic option as an argument.

For example proportional_axes = xy in 2D.

See more:
http://maxima.sourceforge.net/docs/manual/de/maxima_42.html
(Search for "proportional_axes".)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top