Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maxima 2D plot -- How to set axes equal

Tags:

plot

maxima

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

like image 313
weis26 Avatar asked Sep 05 '11 10:09

weis26


2 Answers

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.

like image 180
Fred Senese Avatar answered Sep 17 '22 17:09

Fred Senese


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

like image 20
Simon Avatar answered Sep 19 '22 17:09

Simon