14.5 Interface to the Gnuplot interpreter

Module: sage.interfaces.gnuplot

Interface to the Gnuplot interpreter.

Module-level Functions

gnuplot_console( )

Class: Gnuplot

class Gnuplot
Interface to the Gnuplot interpreter.

Functions: console,$ \,$ gnuplot,$ \,$ interact,$ \,$ plot,$ \,$ plot3d,$ \,$ plot3d_parametric

plot( self, cmd, [file=None], [verbose=True], [reset=True])

Draw the plot described by cmd, and possibly also save to an eps or png file.

Input:

cmd
- string
file
- string (default: None), if specified save plot to given file, which may be either an eps (default) or png file.
verbose
- print some info
reset
- True: reset gnuplot before making graph

Output: displays graph

Note: ^'s are replaced by **'s before being passed to gnuplot.

plot3d_parametric( self, [f=cos(u)*(3 + v*cos(u/2)), sin(u)*(3 + v*cos(u/2)), v*sin(u/2)], [range1=[u=-pi:pi]], [range2=[v=-0.2:0.2]], [samples=50], [title=None], [interact=True])

Draw a parametric 3d surface and rotate it interactively.

Input:

f
- (string) a function of two variables, e.g., 'cos(u)*(3 + v*cos(u/2)), sin(u)*(3 + v*cos(u/2)), v*sin(u/2)'
range1
- (string) range of values for one variable, e.g., '[u=-pi:pi]'
range2
- (string) range of values for another variable, e.g., '[v=-0.2:0.2]'
samples
- (int) number of sample points to use
title
- (string) title of the graph.

sage: gnuplot.plot3d_parametric('v^2*sin(u), v*cos(u), v*(1-v)')   # optional -- requires gnuplot  (not tested, since something pops up).

Special Functions: __call__,$ \,$ __repr__,$ \,$ _eval_line,$ \,$ _quit_string

See About this document... for information on suggesting changes.