## Maxima Plots

Double click on the examples in blue to see the result.

#### plot2d

- Plot of a function of one variable:
  plot2d (sin(x), [x, -%pi, %pi])$
- Plot of two implicit functions:
  plot2d([x^2+y^2=1, -abs(x)], [x, -1.5, 1.5], [y, -2, 2], same_xy, nolegend);
- Plot of a function and data points:
  plot2d([[discrete,[[10,.6],[20,.9],[30,1.1],[40,1.3],[50,1.4]]], 2*%pi*sqrt(l/980)], [l,0,50], [style,points,lines], [point_type, asterisk], [legend, "experiment", "theory"], [xlabel,"length"], [ylabel,"period"])$

#### plot3d

When using the "gnuplot_pipes" or "xmaxima" plot formats, you can rotate the object by dragging with the left mouse button depressed.

- To plot the function of two variables: z = 2^(-u^2+v^2) with u and v varying in [-2,2] and [-2,2] respectively, and with u on the x axis, and v on the y axis, do the following:
  plot3d(2^(-u^2+v^2),[u,-2,2],[v,-2,2]);
- A Moebius band can be plotted given 3 expressions (for the coordinates in the three axes) depending on two parameters, x and y in this example
  plot3d([cos(a)*(3+b*cos(a/2)), sin(a)*(3+b*cos(a/2)), b*sin(a/2)], [a,-%pi,%pi], [b,-1,1], [grid,40,15]);
  The additional optional option [grid,50,15] gives the grid number of rectangles in the a direction and b direction.
- A Riemann surface: Real part of z^1/3
  plot3d(r^.33*cos(th/3),[r,0,1],[th,0,6*%pi], [grid,12,80], [transform_xy,polar_to_xy]);
- A Klein bottle:
  plot3d([5*cos(x)*(cos(x/2)*cos(y)+sin(x/2)*sin(2*y)+3.0) - 10.0, -5*sin(x)*(cos(x/2)*cos(y)+sin(x/2)*sin(2*y)+3.0), 5*(-sin(x/2)*cos(y)+cos(x/2)*sin(2*y))], [x,-%pi,%pi], [y,-%pi,%pi], [grid,40,40]);
- A torus
  plot3d([cos(y)*(10.0+6*cos(x)), sin(y)*(10.0+6*cos(x)), -6*sin(x)], [x,0,2*%pi], [y,0,2*%pi], [grid,20,20]);