iconEuler Reference

Basic Plot Functions

Help functions for 2D and 3D plots.

It should not be necessary to call these functions directly, unless a special effect is needed. You can use plot2d or plot3d instead. Have a look at the following notebook.

There are also some core functions, which are not explained here. Look at the following documenation, if you need those.

Moreover, some of the following functions link to core functions for further details.

Ultility Functions

function window 

  window(c1,r1,c2,r2) sets a plotting window.
  The coordinates must be screen coordinates.
  window() returns the active window coordinates.
  
  See: 
coordinates (Euler Core)
function fullwindow 

  Takes the full size (besides a title) for the plots
  Should only be used for plotRGB
  
  See: 
shrinkwindow (Basic Plot Functions),
reset (Basic Utilities),
reset (Maxima Documentation)
function shrinkwindow 

  shrinkwindow() shrinks the window to allow labels.
  Should only be used for plotRGB after fullwindow
  
  See: 
fullwindow (Basic Plot Functions),
reset (Basic Utilities),
reset (Maxima Documentation)
function setplot 

  setplot(xmin xmax ymin ymax) sets the plot coordinates and holds the plot
  Also setplot([xmin,xmax,ymin,ymax]).
  setplot() resets it.
function unclip 

  Clips to the complete graphics screen
function clip 

  clip(c1,r1,c2,r2) sets the clipping window.
  The coordinates must be screen coordinates.
  clip() returns the active clipping window coordinates.
function clipmore (x,more=0)

  Sets the clipping window.
  The coordinates must be screen coordinates.
  There is some extra space around the area x
  clip() returns the active clipping window coordinates.
function toscreen (x,y=none)

  Convert the x-y-coordinates screen coordinates,
  from 0..1024. Useful for Labels.
function fromscreen (c,r=none)

  Convert the screen coordinates v[1],v[2] to x-y-coordinates,
  Returns {x,y}
function label (t:string, x:number, y:number, offset:number=10, ..
    color:number=none)

  Label the x-y-value with the text t.
  offset is in screen coordinates 0..1024.
function labelbox (labels, styles="-", colors:real=1,
    x=0.98, y=0.02,	w=none, points=0, tcolor=red)

  Plot a box with labels and line styles for the functions.
  
  A label box is a list of labels for each function in the plot. The
  box shows a string and a line in the style and color of the
  function for each function. For point plots the box can show point
  styles.
  
  labels : string, or vector of strings
  styles : string or string of vector, styles of the functions
  colors : real vector, colors of the functions
  w : width of the box (fraction of plot window)
  x, y : upper right corner of label box (fractions)
  points : flag or vector of flags.
  
  Example:
  >plot2d("x+x^3",-1,1); plot2d("x^4",color=blue,style="--",>add);
  >labelbox(["x+x^3","x^4"],colors=[black,blue],styles=["-","--"]):
  
  See: 
label (Maxima Documentation)
function textbox (text, x=0.98, y=0.02, tcolor=red, w=none)

  Plot a box with text.
  
  x,y : An anchor for the upper left corner of the box (fractions of
  plot area)
  text : A string or a vector of strings, one for each line of text
  tcolor : a color or an array of colors for the text lines
  w : an optional width of the box (fraction of plot area)
  
  See: 
label (Basic Plot Functions),
label (Maxima Documentation)

Bars

function plotbar1 (x:number,y:number,w:number,h:number)

  Plots a single bar with x,y,w,h in plot coordinates.
  use barstyle and barcolor to modify the bar.
  The parameters may be vectors.
function plotbar (x,y,w,h)

  Plots a bars with x,y,w,h in plot coordinates.
  use barstyle and barcolor to modify the bar.
  The parameters may be vectors.
function xplotbar (x,y,w,h,st:string="#O")

  Plots a bar with x,y,w,h in plot coordinates.
  Uses the plot coordinates from the last plot!
  Use setplot to set new plot coordinates.
  Draws coordinates below the bar.
  use barstyle and barcolor to modify the bar.
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function xplotrange (r:real vector, v:real vector)

  Plots a barplot of the multiplicities v[i] in the ranges r[i],r[i+1].
  
  Obsolete. Use plot2d with the histogram=1 option.
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function scalematrix (A)

  Scales a matrix A, so that its value are in the range from 0 to 1.
function select 

  Coordinates {x,y} of mouse clicks, stops if user clicks above the window.
  until the user clicked above the plot window.
  
  See: 
mouse (Euler Core)

Text

function settitle (text:string)

  settitle(text) plots a title to the grafik window.
function textheight 

  Height of a letter.
function textwidth 

  Width of a letter.
function ticks (aa=0,bb=0)

  Returns the proper ticks to be used for intervals [a,b]
  and the factor f of the ticks.
  
  See: 
xplot (Basic Plot Functions)
function xplot (x=0,y=0,grid=2,ticks=1,frame=1)

  Works like plot, but shows axis ticks.
  xplot() shows only axis ticks and the grid.
  
  See: 
plot (Euler Core),
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function xmark (x=0,y=0,grid=2,ticks=1)

  Works like mark, but shows axis ticks.
  xmark() shows only axis ticks and the grid.
  
  See: 
mark (Euler Core),
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)

Mouse

function setplotm 

  The user can choose the plotting coordinates with the mouse
  Returns plot coordinates.
function niceform (x,n=10)

  Return a string, containing a nicely formatted of x
function gridstyle (st1:string="--", st2:string=".", color=3)

  Set the grid styles and color.
  Returns both styles and the old color.
  
  See: 
linestyle (Euler Core),
rgb (Basic Plot Functions)
function gridcolor (c:integer=3)

  Set the grid color.
  Returns the current color
  See plot2d,rgb
function xgrid (xx, f=1, grid=2, ticks=1, color=none, ..
    xt=none, ylevel=none)

  Draws vertical grid lines on the plot window at x0,x1,...
  xgrid([x0,x1,...],f) additionally writes x0/f to the axis.
  
  f : factor (like 10^5)
  grid : 2 for normal grid (see plot2d)
  ticks : write labels below the axis
  color : tick color
  xt : use these numbers for the grid
  ylevel : draw the grid at this y level
  
  The default values for the gridstyles are defaultgrid1,
  defaultgrid2,defaultgridcolor
  
  See: 
ygrid (Basic Plot Functions),
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function ygrid (yy, f=1, grid=2, ticks=1, color=none, ..
    yt=none, xlevel=none)

  Draws horizontal grid lines on the plot window at y0,y1,...
  ygrid([x0,x1,...],f) additionally writes x0/f to the axis.
  
  Parameters similar to xgrid
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function xrange ()

  Writes the range of x below the x axis
function xlabel (text,l=1)

  Puts the label text at the x-axis at point l in [0,1]
function yrange ()

  Writes the range of y besides the y axis.
function ylabel (text,l=1)

  Puts the label text at the x-axis at point l in [0,1]
function plotwindow 

  Sets the plot window to the screen coordinates.

Windows

function upperwindow (title="")

  Select the upper half of the plot window for a plot
  
  See: 
figure (Basic Plot Functions)
function lowerwindow (title="")

  Select the lower half of the plot window for a plot
  
  See: 
figure (Basic Plot Functions)

Adaptive Functions

function adaptiveeval (f,g,a,b,eps=0.01,amin=0.00001,amax=0.1)

  Compute f(x), g(x) for t in [a,b] with adaptive step size.
  eps is the target accuracy.
  amin and amax are the minimal and maximal step size.
  amax is also the initial step size.
  f and g can be expressions in x or user defined functions.
  Returns {x,y}
  
  Used by plot2d with the adaptive=1 parameter.
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function adaptiveevalone (g:string, a:number, b:number, ..
    eps=0.01, amin=0.00001, amax=0.01, square=1)

  Compute g(x) for t in [a,b] with adaptive step size.
  eps is the target accuracy.
  amin and amax are the minimal and maximal step size (rel to b-a).
  amax is also the initial step size.
  f and g can be expressions in x or user defined functions.
  Returns {x,y}
  
  Used by plot2d with the adaptive=1 parameter.
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)

Color

function rgb (r,g,b)

  Computes a RGB color from [0,1]-values
  
  Returns an integer encryption of the color.
  Use to set rgb colors instead of a color index,
  and to define an image to be saved on disk.
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation),
putred (Euler Core),
putgreen (Euler Core),
putblue (Euler Core),
savergb (Euler Core)
function getrgb (x)

  Computes the red, green and blue parts from an rgb color.
  
  Used to decompose image pixels into colors.
  Returns {r,g,b}
  
  See: 
getred (Euler Core),
getblue (Euler Core),
getgreen (Euler Core),
loadrgb (Euler Core)
function computehue (x,y,z,L=[0,0,1],amb=0.1,max=0.9,hue=1)

  Computes the hue value for the vector.
  
  This is used in various plot functions

Image Files

function savepng (filename:string, w:integer=0, h:integer=0, ..
    antialias:integer=1)

  Save the current graphics as PNG file in current directory.
  
  Saves the current graphics in PNG format. If antialias=1, then
  the function takes more time, and needs more memory, but the output
  looks smoother. If w=0, "savepng" uses the screen width. If h=0,
  the current aspect ratio with the current width is used.
  
  The current directory is set by the "cd" command, or, if a
  notebook is saved or opened.
  
  See: 
savesvg (Basic Plot Functions),
saveps (Basic Plot Functions)
function savesvg (filename:string, w:integer=0, h:integer=0)

  Save the current graphics as SVG file in current directory.
  
  Saves the current graphics in the format SVG (scalable vector
  format). If h=0, the current aspect ratio with the current width is
  used.
  
  The current directory is set by the "cd" command, or, if a
  notebook is saved or opened.
  
  See: 
savepng (Basic Plot Functions),
saveps (Basic Plot Functions)
function saveps (filename:string)

  Save the current graphics as EPS file in current directory.
  
  Saves the current graphics in EPS (encapsulated postscript) format.
  
  The current directory is set by the "cd" command, or, if a
  notebook is saved or opened.
  
  See: 
savepng (Basic Plot Functions),
savesvg (Basic Plot Functions)

Obsolete

function fcd (f,xmin=-1,xmax=1,ymin=-1,ymax=1,n=50,nc=50,maps=0)

  Plots a function of two variables or expression of x and y
  
  This function uses density and contour.
  fcd uses map for the evaluation of the function "f".
  
  Obsolete, since plot2d should be used now.
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function fcontour (f,xmin=-1,xmax=1,ymin=-1,ymax=1, ..
    n=50,nc=50,hue=0,niveau="auto", ..
    grid=2,title="",add=0,color=1,hcolor=0,maps=0, ..
    contourcolor=none, contourwidth=1)

  Draw contour lines of a function or expression in x and y
  
  2n is the spacing.
  
  Obsolete. Use plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function datacontour (Z,a=0,b=1,c=0,d=1, ..
    nc=50,hue=0,niveau="auto",grid=2,title="",add=0,color=1,hcolor=0, ..
    contourcolor=none, contourwidth=1)

  Draw contour lines of a data matrix.
  
  fcontour uses map for the evaluation of the function "f".
  
  Obsolete. Use plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function fniveau (f,niveau=0,xmin=-1,xmax=1,ymin=-1,ymax=1,n=50,maps=0)

  Draw contour lines of a function or expression in x and y
  
  Obsolete, since plot3d should be used now.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function frotate (f,a,b,n=40,nt=40,scale=1,frame=1, ..
    xlabel="x",ylabel="y",zlabel="z")

  Show a rotated plot of a function
  
  Obsolete, since plot3d with user=1 should be used now.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function triangle 

  Obsolete function
function triangles 

  Obsolete Function.
function f3dimplicit (f:string, x:real vector, y:real vector, z:real vector, ..
    fr:integer=1, xlabel:string="x", ylabel:string="y", zlabel:string="z", ..
    scale:real=1, direction:integer=4, maps=0, ..
    contourcolor=8, contourwidth=1)

  Implicit 3D plot contours at z-values.
function solidhue (x:real, y:real, z:real, h:real, ..
    f:number=1, niveau=none, nc:index=40, values=none, ..
    contourcolor=8, contourwidth=1)

  Makes a shaded solid 3D-plot of x,y,z
  h is the shading and should run between 0 and 1.
  f determines, if h is scaled to fit in between 0 and f.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function drawbutton (text:string, x:real scalar, y:real scalar, w:real scalar)

  Draw a button with the text at x,y with w character width. x
  centered and y top of the label. Return the button rectangle. This
  function can be used to program user interaction with clicks onto
  the screen.
  
  See: 
inbutton (Basic Plot Functions)
function inbutton (b:real vector, s:real vector)

  Test if the screen coordinates s are with in the button rectangle b.
  Get s with toscreen(mouse()) to ask the user for a click.
  
  See: 
drawbutton (Basic Plot Functions),
mouse (Euler Core)
function aspect (w:positive number=none, h:positive number=none)

  Set the window aspect to w times h.
  
  This function reduces the plot window to a new window with
  proportions w times h. The font size remains the same as in the
  full window. To export such a plot, use the crop feature.
  
  If an aspect with larger width is active, insimg will insert only
  the active portion of the window.
  
  Without parameters, the function resets to the default window.
  
  Returns the current window ratio.
  
  See: 
insimg (Euler Core),
insimg (Basic Plot Functions)
function fplot (f,a=0,b=0,n=200,grid=2)

  Plots the function f in [a,b]
  
  fplot("f") or fplot("f",,,n,...) plots f in the old interval.
  fplot uses map for the evaluation of the function "f".
  ffunction may be an expression in x.
  
  Deprecated!
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function f3dplotlight (f,xmin=-1,xmax=1,ymin=-1,ymax=1,n=40, ..
    scale=1,fscale=1,light=[0,0,1],amb=0.1,max=0.9,fr=1, ..
    xlabel="x",ylabel="y",zlabel="z",niveau=none,hue=1, ..
    maps=0,contourcolor=8,contourwidth=1)

  Plots a function f(x,y,...) in a square.
  
  Also f3dplot("f",xmin,xmax,ymin,ymax,n;...).
  f3dplot uses map for the evaluation of the function "f".
  "f" may be an expression in x and y.
  
  Obsolete. Use plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function f3dplotpolarh (f,rmax=1,n=20,scale=1,fscale=1,frame=1, ..
    xlabel="x",ylabel="y",zlabel="z",niveau=none,hue=1, ..
    maps=0)

  Draw a function defined on the circle with radius rmax.
  
  f3d uses map for the evaluation of the function "f".
  n is the spacing.
  
  Obsolete. Use plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function f3dplotpolar (f,rmax=1,n=20,scale=1,fscale=1, ..
    frame=1,wire=0,xlabel="x",ylabel="y",zlabel="z",maps=0)

  Draw a function defined on the circle with radius rmax.
  
  f3d uses map for the evaluation of the function "f".
  n is the spacing.
  
  Obsolete. Use plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function f3dplotpolarl (f,rmax=1,n=20,scale=1,fscale=1, ..
    light=[0,0,1],amb=0.2,max=0.8,frame=1,xlabel="x",ylabel="y",zlabel="z", ..
    niveau="auto",hue=1,maps=0)

  Draw a function defined on the circle with radius rmax.
  
  f3d uses map for the evaluation of the function "f".
  n is the spacing.
  
  Obsolete. Use plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function fillcolor (c1=11,c2=3)

  Set the fillcolor for the fore- and background of 3D plots.
  
  fillcolor(c1,c2) or fillcolor() returns the colors [c1,c2].
  
  See: 
rgb (Basic Plot Functions)
function mark3 (x,y,z)

  Plots points in three dimensions.
  
  x,y,z must be 1xn vectors.
  
  Obsolete. Use plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function clipping (flag:integer=true)

  Sets clipping off or on globally for 2D plot functions.
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function plot (x=0, y=0)

  Plots the values (x(i),y(i)) with the current style.
  If x is a matrix, y must be a matrix of the same size.
  The plot is then drawn for all rows of x and y.
  The plot is scaled automatically, unless hold is on.
  plot(x,y) and plot() return [x1,x2,y1,y2], where [x1,x2] is the range
  of the x-values and [y1,y2] of the y-values.
  plot(x) is the same as plot(1:cols(x),x).
  
  To turn off the clipping set defaultclipping=false
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function mark (x=0,y=0,c=1)

  Plots markers at (x(i),y(i)) according the the actual marker style.
  Works like plot.
  Obsolete. Use plot2d instead.
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function cplot (z)

  Plots a grid of complex numbers.
  Obsolete. Use plot2d instead.
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function scalez (z,scale)

  Scale the matrix z to [-scale,scale].
  
  This is a function used by plot3d with parameter scale=1.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function scalez0 (z:real, scale:number, center:integer=1)

  Scale the matrix z to [-scale,scale].
  
  This is a function used by plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function f3d (f,m=40)

function f3dplot (f,xmin=-1,xmax=1,ymin=-1,ymax=1,n=40, ..
    scale=1,fscale=1,frame=1,wire=0,xlabel="x",ylabel="y",zlabel="z", ..
    sliced=0,maps=0,wirecolor=1)

  f3dplot("f") plots a function f(x,y,...) in a square.
  
  Obsolete function. Use plot3d instead.
  
  f3dplot uses map for the evaluation of the function "f".
  "f" may be an expression in x and y.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function f3dplothue (f,xmin=-1,xmax=1,ymin=-1,ymax=1,n=40, ..
    scale=1,fscale=1,frame=1,xlabel="x",ylabel="y",zlabel="z",niveau=none, ..
    maps=0)

  Plots a function f(x,y,...) in a square.
  
  Also f3dplot("f",xmin,xmax,ymin,ymax,n;...).
  f3dplot uses map for the evaluation of the function "f".
  "f" may be an expression in x and y.
  
  Obsolete. Use plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function density (x,f=0.9,amb=0.1)

  Makes density plot of the values in the matrix x
  scaled to fit into [0,f].
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation)
function plot3dbars (x : real vector, y : real vector, z : real, ..
    z0 : real scalar)

  Plot bars at x[i],y[j] with height z[i,j].
  
  The bars have limits x[i],x[i+1] and y[j],y[j+1] and use
  the values z[i,j]. z must be at least (n-1)x(m-1), if
  x is 1xn and y is 1xm. The bars are sorted correctly before
  they are plotted by plotcubes.
  
  A comfortable way to use is is via plot3d and bar=true.
  
  See: 
plotcubes (Euler Core),
plotcubes (Basic Plot Functions),
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function plotcubes (M, color=none)

  Plot cubes (parallel to the axes)
  
  See: 
plotcubes (Euler Core)
function insimg (lines:index=25, name:string="", ..
    antialias=1, crop=none)

  Insert a file image (PNG) with default size and name. The image
  appears in the notebook with the given height in lines. If the name
  is not empty, the image will be saved under this name when the
  notebook is saved.
  
  antialiased : looks good for most plots, but not for all.
  
  crop : inserts only a top portion of the graphics. The crop can be
  a vector [top,bottom,left,right] of numbers from 0 to 1, or it can
  be [top,bottom], or only bottom. The defaults are [0,1,0,1].
  
  The crop works well with the aspect function. In fact, if an aspect
  is active with larger width than height, only the active portion of
  the image is inserted automatically.
  
  See: 
insimg (Euler Core),
aspect (Basic Plot Functions)
function insrgb (x:real, lines:integer=25, name:string="")

  Insert an rgb image with default size and name.
  The image appears in the notebook with the given height
  in lines. If the name is not empty, the image will
  be saved under this name when the notebook is saved.
  
  See: 
insimg (Euler Core),
insimg (Basic Plot Functions)
function plotrgb (x:real, window:real vector=none)

  Plot an rgb image into the plot window.
  The window can be a vector with screen coordinates.
function loadimg 

  loadimg("filename"), loadimg(n,"filename")
  
  Insert an image from file with default maximal size.
  
  The image appears in the notebook with the given height
  in lines.
  
  n : maximal number of lines to be used (default is 40)
  
  See: 
insimg (Euler Core),
insimg (Basic Plot Functions),
loadimg (Euler Core)
function loadanaglyph 

  loadanaglyph("left","right") or loadanaglyph(n,"left","right")
  
  Loads two images, combines them to one anaglyph, and inserts the
  images into the notebook.
  
  n : maximal number of lines to be used (default is 40)
  
  See: 
loadanaglyph (Euler Core),
loadimg (Euler Core),
loadimg (Basic Plot Functions)
function figure (n:natural, m:index=none)

  figure(nr,nc) divides the graph window into nr rows x nc columns of subplots
  figure(n) sets the current drawing window to the nth subplot counting
  by rows.
  figure(0) sets the plot back to the normal window
function title (text:string)

  Plots a title to the grafik window.
  
  See: 
plot2d (Plot Functions plot2d and plot3d),
plot2d (Maxima Documentation),
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function fwebplot (fff:string, a:real scalar, b: real scalar, ..
    xstart: real scalar, n: index, color=9)

  Plots an iteration of fff on [a,b] starting from xstart, n steps
  This function can be used to study, demontrate or understand
  fixed point iteteration of the type x(n+1) = f(x(n)).
  
  See: 
iterate (Numerical Algorithms),
sequence (Numerical Algorithms)
function vectorfield (expr:string, x1: real scalar, x2: real scalar, ..
    y1: real scalar, y2: real scalar, nx:index=20, ny:index=20)

  Draw the vector field of a differential equation in x and y.
  expr must be the expression "f(x,y)", which computes the
  derivative of y(x) at x.
function vectorfield2 (expr1:string, expr2:string, ..
    x1: real scalar,x2: real scalar,y1: real scalar,y2: real scalar, ..
    nx:index=20, ny:index=20)

  Draw the vector field of a differential equation in x and y.
  expr1 and expr2 must be expressions "f(x,y)", which compute the
  x- and y-value of the derivative of y(x) at x.
function view 

  view(distance, tele, angle1, angle2) sets the perspective for solid and view.
  distance is the eye distance, tele a zooming factor.
  angle1 is the angle from the negativ y-axis to the positive x-axis.
  angle2 is the angle to the positive z-axis (the height of the eye).
  view() returns the current value of view in a vector.
  view is used in plot3d as the default view.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation),
zoom (Basic Plot Functions)
function zoom (f:positive=2.5)

  Set the zoom distance to d.
  
  See: 
view (Euler Core),
view (Basic Plot Functions),
view (Maxima Documentation)
function viewangle (a:real scalar=0.4)

  Set the view angle to a.
  
  See: 
view (Euler Core),
view (Maxima Documentation)
function viewheight (a:real scalar=0.4)

  Set the view height angle to a.
  
  See: 
view (Euler Core),
view (Maxima Documentation)
function viewdistance (d:positive=5)

  Set the view distance to d.
  
  See: 
view (Euler Core),
view (Maxima Documentation)
function f3daxis (f:string, n:index=25)

  Draw a function defined on [-1,1]^2 with x-, y- and z-axis.
  f3daxis uses map for the evaluation of the function "f".
  2n is the spacing.
  Fixed view, cannot be rotated.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function f3daxispolar (f:string, n:index=20)

  Draw a function defined on [-1,1]^2 with x-, y- and z-axis.
  2n is the spacing.
  f3daxispolar uses map for the evaluation of the function "f".
  Fixed view, cannot be rotated.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function stereo (f:string, a:number=-0.05, s:index=500, ..
    d:number=1, parallel:natural=0)

  Stereo plot of the function f from two viewpoints
  Calls the function f, which must be the name of
  a 3D plot command, and does it twice in two different
  windows. Many people are able to view a 3D picture.
  
  There are two ways: parallel view and squint view.
  Most people find the latter easier. It is the default
  for this function.
function parameterplot (f:string, a:number, d:number, ..
    display=1, c=800, r=100, ..
    amax=1e30, amin=-1e30)

  Call the plot function f with parameter a adjustable by user.
  
  Animate a paramter with the up/down keys, and show a plot depending
  on that parameter. The space key resets the default parameter, and
  the return key ends the function.
  
  f : function of a (and additional semicolon parameters)
  a : starting value parameter a
  d : increment with one keystroke
  display : flag for the display of the parameter value
  c,r : coordinates for the display
  amax,amin : limits for the display
  
  See: 
twoparameterplot (Basic Plot Functions)
function twoparameterplot (f:string, a:number, b:number, d:number, ..
    display=1, c=800, r=100, ..
    amax=1e30, amin=-1e30)

  Call the plot function f with parameter a adjustable by user.
  
  Animate a parameter a with the up/down keys, and a parameter b with
  left/right keys, and show a plot depending on that parameter. The
  space key resets the default parameter, and the return key ends the
  function.
  
  f : function of a,b (and additional semicolon parameters)
  a : starting value of parameter a
  b : second parameter b
  d : increment with one keystroke
  display : flag for the display of the parameter values
  c,r : coordinates for the display
  amax,amin : limits for the display
  
function makeimpulse (x:real vector,y:real vector,d=0.1)

  Compute {x1,y1} for impulse bar plots.
  
  Computes the correct input for an impulse bar plot
  at points x with values y.
  
  x : sorted x parameters
  y : values
  d : radius of the plot intervals

Animation

function dragpoints (f : string, x : real, y : real,
    status="Drag one of the points!")

  Lets the user drag points on a user defined plot.
  
  This function calls a function f(x,y), which draws some plot
  depending on the points at coordinates x[i] and y[i]. Then it lets
  the user drag one of the points with the mouse.
  
  f : f(x,y[,select]) a plot function. select is the index of the
  selected point, if not select==0.
  
  Additional arguments are passed to f.
  
  Returns {x,y}
  
  Example:
  >function f(x,y) := plot2d(x,y,>points,a=0,b=1,c=0,d=1);
  >{x,y}=dragpoints("f",random(1,10),random(1,10));
function dragvalues (f, names, values, ranges, stops=100,
    x=0.98, y=0.02, w=0.4, tcolor=red, digits=none,
    heading=none, hcolor=red, status="")

  Let the user drag parameters for a plot.
  
  This function lets the user drag values for plots. A box with
  values appears, by default in the upper right, with an optional
  heading. The values can be dragged to the right or left, and change
  within given ranges and steps.
  
  f : A plot function depending on a vector of parameters.
  names : The names of the parameters for the display.
  values : Initial values of the parameters (string vector of length
  n or string)
  ranges : A nx2 vector of ranges for the values
  stops : A vector with the number of subintervals for each range
  x,y,w : Position anchored in the top right (fraction of plot window)
  tcolor : A vector with colors for the values or one scalar color
  digits : A vector of digits for rounding the values or a scalar
  heading : An optional heading string
  hcolor : The color of the heading
  status : An optional string for the status line
  
  Example:
  >function f([a,b]) := plot2d("a*x^2+b*x";a,b,r=1);
  >dragvalues("f",["a","b"],[0,0],[-1,1;-1,1],digits=2, ...
  >  heading="a*x^2+b*x");

The following functions in this section are obsolete, since plot3d can now animate 3D graphics under user control. E.g. plot2d and plot3d have the parameter >user.

function animate (d:real scalar=0.1)

  Animate pre-defined pages with delay d.
  
  The pages should be generated with calls to addpage, as in the
  following example
  
  deletepages();
  title("Creating Animation");
  addpage();
  showpage(1);
  loop ...
  ... // graph something
  addpage();
  end;
  
  See: 
rotate (Basic Plot Functions)
function rotate (fff:string, d:real scalar=0.01, n:integer=120)

  Shows a rotating animation of the plot fff, which must be a 3D plot
  command.
  
  Obsolete, since the plot can now be rotated with plot3d under user
  control.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function view3d (fff:string, d:real scalar=0.1)

  Calls the plot fff, which must be a 3D plot command, waits for key
  strokes to rotate it.
  
  Use the cursor keys for rotation, del and backspace, or space, to
  reset, return to abort. Returns the current view.
  
  Obsolete, use plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function fanimate (fff:string, t:vector, d:real scalar=0.01)

  Animate the function fff
  
  fff should display some graphics depending on t. Additional
  parameters are passed to f.
  

Framed Plots

Most of these functions need never be used, since 3D graphics should be done with plot3d.

function getframe (x,y,z)

  Gets a box around all points in (x,y,z).
  
  Returns [xmin,xmax,ymin,ymax,zmin,zmax]
function framedplot (f:string, frame:real vector,
    sframe:real vector=none,
    xl:string="x", yl:string="y", zl:string="z",
    ticks:integer=1,
    view=none, zoom=none, distance=none, angle=none, height=none,
    center=none)

  General function for framed plots.
  
  This function does the same as the functions called by plot3d. It
  draws a frame around a plot. The frame is drawn in two parts, one
  in the back and one in the front. It can display ticks, which may
  have nothing to do with the frame itself (sframe parameter).
  
  A function using this function can be used in plot3d with parameter
  >own to allow anaglyphs or turning.
  
  f : A 3D plot function. This can also be plot3d with parameter
  <frame. Semicolon parameters are passed to f.
  
  frame : The frame. take care that the plot fits into the frame. The
  frame is a vector of the form [xmin,xmax,ymin,ymax,zmin,zmax]
  
  sframe : The tick values for the frame. If sframe=none then frame
  is used.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function framedsolid (x:real, y:real, z:real,
    scale:real vector=1, fr:integer=1, hf:number=1,
    disconnect=none,
    xlabel:string="x", ylabel:string="y", zlabel:string="z",
    sliced:integer=0, bar:integer=0, z0:real=0,
    frame:real vector=none, sframe:real vector=none)

  3D plot with frame.
  
  x, y, and z must be compatible matrices. The determine the
  coordinates of the 3D images of a parameter matrix.
  
  If scale is specified, then the plot is scaled to fit into a cube
  of side length 2*scale centered at 0.
  
  If fr=0 then no frame will be drawn around the plot.
  
  disconnect is a vector of indices containing the rows of the
  matrix, which should not be connected.
  
  sliced is a parameter, which produces sliced plots into the x, or
  the y direction. Should only be used for regular x,y grids.
  
  bar is a parameter, which makes the plot into steps. Should only be
  used for regular x,y grids.
  
  This function should only be used via plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function framedsolidhue (x:real, y:real, z:real, hue, ..
    scale:real vector=1, f:number=1, fr:integer=1, hf:number=1, ..
    xlabel:string="x", ylabel:string="y", zlabel:string="z", ..
    niveau=none, values=none, ..
    light=[0.5,0.5,1], amb=0.1, max=0.9, huecolor=0, ..
    contourcolor=8, contourwidth=1, z0=0,
    frame=none, sframe=none)

  3D plot with hue, and optional niveau lines.
  
  x, y, and z must be compatible matrices. They determine the
  coordinates of the 3D images of a parameter matrix. hue is an
  additional compatible matrix, which determines the color shade of
  the matrix at each point. E.g., plot3d computes the hue using a
  light source.
  
  niveau is a row vector of niveaus levels, which are to be drawn.
  values is a matrix of the same size as x, y, and z which contains
  the values, which determine the niveau. By default, the value will
  be z.
  
  If scale is specified, then the plot is scaled to fit into a cube
  of side length 2*scale centered at 0.
  
  If fr=0 then no frame will be drawn around the plot.
  
  disconnect is a vector of indices containing the rows of the
  matrix, which should not be connected.
  
  This function should only be used via plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation)
function framedwire (x:real, y:real, z:real,
    scale:real vector=1, fr:integer=1, hf:number=1,
    xlabel:string="x", ylabel:string="y", zlabel:string="z",
    wirecolor:number=1, rowsonly:integer=0, z0:real=0,
    frame:real vector=none, sframe:real vector=none)

  3D wire plot with frame.
  
  x, y, and z must be compatible matrices. They determine the
  coordinates of the 3D images of a parameter matrix.
  
  If scale is specified, then the plot is scaled to fit into a cube
  of side length 2*scale centered at 0.
  
  If fr=0 then no frame will be drawn around the plot.
  
  With rowsonly=1 the wire will be drawn only in one direction.
  
  The wirecolor can be specified with the variable wirecolor. Use any
  of the 16 predefined colors, or an rgb value.
  
  This function should only be used via plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation),
rgb (Basic Plot Functions)
function framedmark3 (x:real, y:real, z:real,
    scale:real vector=1, fr:integer=1, hf:number=1,
    xlabel:string="x", ylabel:string="y", zlabel:string="z",
    color=1, z0:number=0,
    frame:real vector=none, sframe:real vector=none)

  3D point plot with frame.
  
  x, y, and z must be row vectors. They determine the coordinates of
  the 3D images of the points.
  
  This function should only be used via plot3d.
  
  See: 
plot3d (Plot Functions plot2d and plot3d),
plot3d (Maxima Documentation),
rgb (Basic Plot Functions)

Documentation Homepage