Bookmark and Share FiPy: A Finite Volume PDE Solver Using Python
Version 3.0.1-dev139-ge5d2233

Previous topic

gnuplotViewer Package

Next topic

mayaviViewer Package

This Page

Contact

FiPy developers
Jonathan Guyer
Daniel Wheeler
James Warren

Join our mailing list

100 Bureau Drive, M/S 6555
Gaithersburg, MD 20899

301-975-5329 Telephone
301-975-4553 Facsimile

matplotlibViewer Package

matplotlibViewer Package

fipy.viewers.matplotlibViewer.MatplotlibViewer(vars, title=None, limits={}, cmap=None, colorbar='vertical', axes=None, **kwlimits)

Generic function for creating a MatplotlibViewer.

The MatplotlibViewer factory will search the module tree and return an instance of the first MatplotlibViewer it finds of the correct dimension and rank.

Parameters :
vars

a CellVariable or tuple of CellVariable objects to plot

title

displayed at the top of the Viewer window

limits : dict

a (deprecated) alternative to limit keyword arguments

xmin, xmax, ymin, ymax, datamin, datamax

displayed range of data. A 1D Viewer will only use xmin and xmax, a 2D viewer will also use ymin and ymax. All viewers will use datamin and datamax. Any limit set to a (default) value of None will autoscale.

cmap

the colormap. Defaults to matplotlib.cm.jet

colorbar

plot a colorbar in specified orientation if not None

axes

if not None, vars will be plotted into this Matplotlib Axes object

It is possible to view different Variables against different Matplotlib Axes

>>> from matplotlib import pylab
>>> from fipy import *
>>> pylab.ion()
>>> fig = pylab.figure()
>>> ax1 = pylab.subplot((221))
>>> ax2 = pylab.subplot((223))
>>> ax3 = pylab.subplot((224))
>>> k = Variable(name="k", value=0.)
>>> mesh1 = Grid1D(nx=100)
>>> x, = mesh1.cellCenters
>>> xVar = CellVariable(mesh=mesh1, name="x", value=x)
>>> viewer1 = MatplotlibViewer(vars=(numerix.sin(0.1 * k * xVar), numerix.cos(0.1 * k * xVar / numerix.pi)), 
...                            limits={'xmin': 10, 'xmax': 90}, 
...                            datamin=-0.9, datamax=2.0,
...                            title="Grid1D test",
...                            axes=ax1,
...                            legend=None)
>>> mesh2 = Grid2D(nx=50, ny=100, dx=0.1, dy=0.01)
>>> x, y = mesh2.cellCenters
>>> xyVar = CellVariable(mesh=mesh2, name="x y", value=x * y)
>>> viewer2 = MatplotlibViewer(vars=numerix.sin(k * xyVar), 
...                            limits={'ymin': 0.1, 'ymax': 0.9}, 
...                            datamin=-0.9, datamax=2.0,
...                            title="Grid2D test",
...                            axes=ax2,
...                            colorbar=None)
>>> mesh3 = (Grid2D(nx=5, ny=10, dx=0.1, dy=0.1)
...          + (Tri2D(nx=5, ny=5, dx=0.1, dy=0.1) 
...             + ((0.5,), (0.2,))))
>>> x, y = mesh3.cellCenters
>>> xyVar = CellVariable(mesh=mesh3, name="x y", value=x * y)
>>> viewer3 = MatplotlibViewer(vars=numerix.sin(k * xyVar), 
...                            limits={'ymin': 0.1, 'ymax': 0.9}, 
...                            datamin=-0.9, datamax=2.0,
...                            title="Irregular 2D test",
...                            axes=ax3,
...                            cmap = pylab.cm.OrRd)
>>> viewer = MultiViewer(viewers=(viewer1, viewer2, viewer3))
>>> for kval in range(10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()
class fipy.viewers.matplotlibViewer.Matplotlib1DViewer(vars, title=None, xlog=False, ylog=False, limits={}, legend='upper left', axes=None, **kwlimits)

Bases: fipy.viewers.matplotlibViewer.matplotlibViewer.AbstractMatplotlibViewer

Displays a y vs. x plot of one or more 1D CellVariable objects using Matplotlib.

>>> from fipy import *
>>> mesh = Grid1D(nx=100)
>>> x, = mesh.cellCenters
>>> xVar = CellVariable(mesh=mesh, name="x", value=x)
>>> k = Variable(name="k", value=0.)
>>> viewer = Matplotlib1DViewer(vars=(numerix.sin(k * xVar), numerix.cos(k * xVar / numerix.pi)), 
...                 limits={'xmin': 10, 'xmax': 90}, 
...                 datamin=-0.9, datamax=2.0,
...                 title="Matplotlib1DViewer test")
>>> for kval in numerix.arange(0,0.3,0.03):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()
Parameters :
vars

a CellVariable or tuple of CellVariable objects to plot

title

displayed at the top of the Viewer window

xlog

log scaling of x axis if True

ylog

log scaling of y axis if True

limits : dict

a (deprecated) alternative to limit keyword arguments

xmin, xmax, datamin, datamax

displayed range of data. Any limit set to a (default) value of None will autoscale. (ymin and ymax are synonyms for datamin and datamax).

legend

place a legend at the specified position, if not None

axes

if not None, vars will be plotted into this Matplotlib Axes object

log

logarithmic data scaling

class fipy.viewers.matplotlibViewer.Matplotlib2DGridViewer(vars, title=None, limits={}, cmap=None, colorbar='vertical', axes=None, figaspect='auto', **kwlimits)

Bases: fipy.viewers.matplotlibViewer.matplotlib2DViewer.AbstractMatplotlib2DViewer

Displays an image plot of a 2D CellVariable object using Matplotlib.

>>> from fipy import *
>>> mesh = Grid2D(nx=50, ny=100, dx=0.1, dy=0.01)
>>> x, y = mesh.cellCenters
>>> xyVar = CellVariable(mesh=mesh, name="x y", value=x * y)
>>> k = Variable(name="k", value=0.)
>>> viewer = Matplotlib2DGridViewer(vars=numerix.sin(k * xyVar), 
...                 limits={'ymin': 0.1, 'ymax': 0.9}, 
...                 datamin=-0.9, datamax=2.0,
...                 title="Matplotlib2DGridViewer test")
>>> for kval in range(10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()

Creates a Matplotlib2DGridViewer.

Parameters :
vars

A CellVariable object.

title

displayed at the top of the Viewer window

limits : dict

a (deprecated) alternative to limit keyword arguments

cmap

The colormap. Defaults to matplotlib.cm.jet

xmin, xmax, ymin, ymax, datamin, datamax

displayed range of data. Any limit set to a (default) value of None will autoscale.

colorbar

plot a colorbar in specified orientation if not None

axes

if not None, vars will be plotted into this Matplotlib Axes object

figaspect

desired aspect ratio of figure. If arg is a number, use that aspect ratio. If arg is ‘auto’, the aspect ratio will be determined from the Variable’s mesh.

class fipy.viewers.matplotlibViewer.Matplotlib2DGridContourViewer(vars, title=None, limits={}, cmap=None, colorbar='vertical', axes=None, figaspect='auto', **kwlimits)

Bases: fipy.viewers.matplotlibViewer.matplotlib2DViewer.AbstractMatplotlib2DViewer

Displays a contour plot of a 2D CellVariable object.

The Matplotlib2DGridContourViewer plots a 2D CellVariable using Matplotlib.

>>> from fipy import *
>>> mesh = Grid2D(nx=50, ny=100, dx=0.1, dy=0.01)
>>> x, y = mesh.cellCenters
>>> xyVar = CellVariable(mesh=mesh, name="x y", value=x * y)
>>> k = Variable(name="k", value=0.)
>>> viewer = Matplotlib2DGridContourViewer(vars=numerix.sin(k * xyVar), 
...                 limits={'ymin': 0.1, 'ymax': 0.9}, 
...                 datamin=-0.9, datamax=2.0,
...                 title="Matplotlib2DGridContourViewer test")
>>> for kval in range(10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()

Creates a Matplotlib2DViewer.

Parameters :
vars

a CellVariable object.

title

displayed at the top of the Viewer window

limits : dict

a (deprecated) alternative to limit keyword arguments

xmin, xmax, ymin, ymax, datamin, datamax

displayed range of data. Any limit set to a (default) value of None will autoscale.

cmap

the colormap. Defaults to matplotlib.cm.jet

colorbar

plot a colorbar in specified orientation if not None

axes

if not None, vars will be plotted into this Matplotlib Axes object

figaspect

desired aspect ratio of figure. If arg is a number, use that aspect ratio. If arg is ‘auto’, the aspect ratio will be determined from the Variable’s mesh.

class fipy.viewers.matplotlibViewer.Matplotlib2DViewer(vars, title=None, limits={}, cmap=None, colorbar='vertical', axes=None, figaspect='auto', **kwlimits)

Bases: fipy.viewers.matplotlibViewer.matplotlib2DViewer.AbstractMatplotlib2DViewer

Displays a contour plot of a 2D CellVariable object.

The Matplotlib2DViewer plots a 2D CellVariable using Matplotlib.

>>> from fipy import *
>>> mesh = (Grid2D(nx=5, ny=10, dx=0.1, dy=0.1)
...         + (Tri2D(nx=5, ny=5, dx=0.1, dy=0.1) 
...          + ((0.5,), (0.2,))))
>>> x, y = mesh.cellCenters
>>> xyVar = CellVariable(mesh=mesh, name="x y", value=x * y)
>>> k = Variable(name="k", value=0.)
>>> viewer = Matplotlib2DViewer(vars=numerix.sin(k * xyVar), 
...                 limits={'ymin': 0.1, 'ymax': 0.9}, 
...                 datamin=-0.9, datamax=2.0,
...                 title="Matplotlib2DViewer test")
>>> for kval in range(10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()

Creates a Matplotlib2DViewer.

Parameters :
vars

a CellVariable object.

title

displayed at the top of the Viewer window

limits : dict

a (deprecated) alternative to limit keyword arguments

cmap

the colormap. Defaults to matplotlib.cm.jet

xmin, xmax, ymin, ymax, datamin, datamax

displayed range of data. Any limit set to a (default) value of None will autoscale.

colorbar

plot a colorbar in specified orientation if not None

axes

if not None, vars will be plotted into this Matplotlib Axes object

figaspect

desired aspect ratio of figure. If arg is a number, use that aspect ratio. If arg is ‘auto’, the aspect ratio will be determined from the Variable’s mesh.

class fipy.viewers.matplotlibViewer.MatplotlibVectorViewer(vars, title=None, scale=None, sparsity=None, log=False, limits={}, axes=None, figaspect='auto', **kwlimits)

Bases: fipy.viewers.matplotlibViewer.matplotlib2DViewer.AbstractMatplotlib2DViewer

Displays a vector plot of a 2D rank-1 CellVariable or FaceVariable object using Matplotlib

>>> from fipy import *
>>> mesh = Grid2D(nx=50, ny=100, dx=0.1, dy=0.01)
>>> x, y = mesh.cellCenters
>>> xyVar = CellVariable(mesh=mesh, name="x y", value=x * y)
>>> k = Variable(name="k", value=1.)
>>> viewer = MatplotlibVectorViewer(vars=numerix.sin(k * xyVar).grad, 
...                 title="MatplotlibVectorViewer test")
>>> for kval in numerix.arange(1, 10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()
>>> viewer = MatplotlibVectorViewer(vars=numerix.sin(k * xyVar).faceGrad, 
...                 title="MatplotlibVectorViewer test")
>>> for kval in numerix.arange(1, 10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()
>>> for sparsity in numerix.arange(5000, 0, -500):
...     viewer.quiver(sparsity=sparsity)
...     viewer.plot()
>>> viewer._promptForOpinion()
>>> from fipy import *
>>> mesh = (Grid2D(nx=5, ny=10, dx=0.1, dy=0.1)
...         + (Tri2D(nx=5, ny=5, dx=0.1, dy=0.1) 
...          + ((0.5,), (0.2,))))
>>> x, y = mesh.cellCenters
>>> xyVar = CellVariable(mesh=mesh, name="x y", value=x * y)
>>> k = Variable(name="k", value=1.)
>>> viewer = MatplotlibVectorViewer(vars=numerix.sin(k * xyVar).grad, 
...                 title="MatplotlibVectorViewer test")
>>> for kval in numerix.arange(1, 10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()
>>> viewer = MatplotlibVectorViewer(vars=numerix.sin(k * xyVar).faceGrad, 
...                 title="MatplotlibVectorViewer test")
>>> for kval in numerix.arange(1, 10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()

Creates a Matplotlib2DViewer.

Parameters :
vars

a rank-1 CellVariable or FaceVariable object.

title

displayed at the top of the Viewer window

scale

if not None, scale all arrow lengths by this value

sparsity

if not None, then this number of arrows will be randomly chosen (weighted by the cell volume or face area)

log

if True, arrow length goes at the base-10 logarithm of the magnitude

limits : dict

a (deprecated) alternative to limit keyword arguments

xmin, xmax, ymin, ymax, datamin, datamax

displayed range of data. Any limit set to a (default) value of None will autoscale.

axes

if not None, vars will be plotted into this Matplotlib Axes object

figaspect

desired aspect ratio of figure. If arg is a number, use that aspect ratio. If arg is ‘auto’, the aspect ratio will be determined from the Variable’s mesh.

quiver(sparsity=None, scale=None)

matplotlib1DViewer Module

class fipy.viewers.matplotlibViewer.matplotlib1DViewer.Matplotlib1DViewer(vars, title=None, xlog=False, ylog=False, limits={}, legend='upper left', axes=None, **kwlimits)

Bases: fipy.viewers.matplotlibViewer.matplotlibViewer.AbstractMatplotlibViewer

Displays a y vs. x plot of one or more 1D CellVariable objects using Matplotlib.

>>> from fipy import *
>>> mesh = Grid1D(nx=100)
>>> x, = mesh.cellCenters
>>> xVar = CellVariable(mesh=mesh, name="x", value=x)
>>> k = Variable(name="k", value=0.)
>>> viewer = Matplotlib1DViewer(vars=(numerix.sin(k * xVar), numerix.cos(k * xVar / numerix.pi)), 
...                 limits={'xmin': 10, 'xmax': 90}, 
...                 datamin=-0.9, datamax=2.0,
...                 title="Matplotlib1DViewer test")
>>> for kval in numerix.arange(0,0.3,0.03):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()
Parameters :
vars

a CellVariable or tuple of CellVariable objects to plot

title

displayed at the top of the Viewer window

xlog

log scaling of x axis if True

ylog

log scaling of y axis if True

limits : dict

a (deprecated) alternative to limit keyword arguments

xmin, xmax, datamin, datamax

displayed range of data. Any limit set to a (default) value of None will autoscale. (ymin and ymax are synonyms for datamin and datamax).

legend

place a legend at the specified position, if not None

axes

if not None, vars will be plotted into this Matplotlib Axes object

log

logarithmic data scaling

matplotlib2DContourViewer Module

matplotlib2DGridContourViewer Module

class fipy.viewers.matplotlibViewer.matplotlib2DGridContourViewer.Matplotlib2DGridContourViewer(vars, title=None, limits={}, cmap=None, colorbar='vertical', axes=None, figaspect='auto', **kwlimits)

Bases: fipy.viewers.matplotlibViewer.matplotlib2DViewer.AbstractMatplotlib2DViewer

Displays a contour plot of a 2D CellVariable object.

The Matplotlib2DGridContourViewer plots a 2D CellVariable using Matplotlib.

>>> from fipy import *
>>> mesh = Grid2D(nx=50, ny=100, dx=0.1, dy=0.01)
>>> x, y = mesh.cellCenters
>>> xyVar = CellVariable(mesh=mesh, name="x y", value=x * y)
>>> k = Variable(name="k", value=0.)
>>> viewer = Matplotlib2DGridContourViewer(vars=numerix.sin(k * xyVar), 
...                 limits={'ymin': 0.1, 'ymax': 0.9}, 
...                 datamin=-0.9, datamax=2.0,
...                 title="Matplotlib2DGridContourViewer test")
>>> for kval in range(10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()

Creates a Matplotlib2DViewer.

Parameters :
vars

a CellVariable object.

title

displayed at the top of the Viewer window

limits : dict

a (deprecated) alternative to limit keyword arguments

xmin, xmax, ymin, ymax, datamin, datamax

displayed range of data. Any limit set to a (default) value of None will autoscale.

cmap

the colormap. Defaults to matplotlib.cm.jet

colorbar

plot a colorbar in specified orientation if not None

axes

if not None, vars will be plotted into this Matplotlib Axes object

figaspect

desired aspect ratio of figure. If arg is a number, use that aspect ratio. If arg is ‘auto’, the aspect ratio will be determined from the Variable’s mesh.

matplotlib2DGridViewer Module

class fipy.viewers.matplotlibViewer.matplotlib2DGridViewer.Matplotlib2DGridViewer(vars, title=None, limits={}, cmap=None, colorbar='vertical', axes=None, figaspect='auto', **kwlimits)

Bases: fipy.viewers.matplotlibViewer.matplotlib2DViewer.AbstractMatplotlib2DViewer

Displays an image plot of a 2D CellVariable object using Matplotlib.

>>> from fipy import *
>>> mesh = Grid2D(nx=50, ny=100, dx=0.1, dy=0.01)
>>> x, y = mesh.cellCenters
>>> xyVar = CellVariable(mesh=mesh, name="x y", value=x * y)
>>> k = Variable(name="k", value=0.)
>>> viewer = Matplotlib2DGridViewer(vars=numerix.sin(k * xyVar), 
...                 limits={'ymin': 0.1, 'ymax': 0.9}, 
...                 datamin=-0.9, datamax=2.0,
...                 title="Matplotlib2DGridViewer test")
>>> for kval in range(10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()

Creates a Matplotlib2DGridViewer.

Parameters :
vars

A CellVariable object.

title

displayed at the top of the Viewer window

limits : dict

a (deprecated) alternative to limit keyword arguments

cmap

The colormap. Defaults to matplotlib.cm.jet

xmin, xmax, ymin, ymax, datamin, datamax

displayed range of data. Any limit set to a (default) value of None will autoscale.

colorbar

plot a colorbar in specified orientation if not None

axes

if not None, vars will be plotted into this Matplotlib Axes object

figaspect

desired aspect ratio of figure. If arg is a number, use that aspect ratio. If arg is ‘auto’, the aspect ratio will be determined from the Variable’s mesh.

matplotlib2DViewer Module

class fipy.viewers.matplotlibViewer.matplotlib2DViewer.Matplotlib2DViewer(vars, title=None, limits={}, cmap=None, colorbar='vertical', axes=None, figaspect='auto', **kwlimits)

Bases: fipy.viewers.matplotlibViewer.matplotlib2DViewer.AbstractMatplotlib2DViewer

Displays a contour plot of a 2D CellVariable object.

The Matplotlib2DViewer plots a 2D CellVariable using Matplotlib.

>>> from fipy import *
>>> mesh = (Grid2D(nx=5, ny=10, dx=0.1, dy=0.1)
...         + (Tri2D(nx=5, ny=5, dx=0.1, dy=0.1) 
...          + ((0.5,), (0.2,))))
>>> x, y = mesh.cellCenters
>>> xyVar = CellVariable(mesh=mesh, name="x y", value=x * y)
>>> k = Variable(name="k", value=0.)
>>> viewer = Matplotlib2DViewer(vars=numerix.sin(k * xyVar), 
...                 limits={'ymin': 0.1, 'ymax': 0.9}, 
...                 datamin=-0.9, datamax=2.0,
...                 title="Matplotlib2DViewer test")
>>> for kval in range(10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()

Creates a Matplotlib2DViewer.

Parameters :
vars

a CellVariable object.

title

displayed at the top of the Viewer window

limits : dict

a (deprecated) alternative to limit keyword arguments

cmap

the colormap. Defaults to matplotlib.cm.jet

xmin, xmax, ymin, ymax, datamin, datamax

displayed range of data. Any limit set to a (default) value of None will autoscale.

colorbar

plot a colorbar in specified orientation if not None

axes

if not None, vars will be plotted into this Matplotlib Axes object

figaspect

desired aspect ratio of figure. If arg is a number, use that aspect ratio. If arg is ‘auto’, the aspect ratio will be determined from the Variable’s mesh.

matplotlibSparseMatrixViewer Module

class fipy.viewers.matplotlibViewer.matplotlibSparseMatrixViewer.MatplotlibSparseMatrixViewer(title='Sparsity')
plot(matrix, RHSvector, log='auto')

matplotlibVectorViewer Module

class fipy.viewers.matplotlibViewer.matplotlibVectorViewer.MatplotlibVectorViewer(vars, title=None, scale=None, sparsity=None, log=False, limits={}, axes=None, figaspect='auto', **kwlimits)

Bases: fipy.viewers.matplotlibViewer.matplotlib2DViewer.AbstractMatplotlib2DViewer

Displays a vector plot of a 2D rank-1 CellVariable or FaceVariable object using Matplotlib

>>> from fipy import *
>>> mesh = Grid2D(nx=50, ny=100, dx=0.1, dy=0.01)
>>> x, y = mesh.cellCenters
>>> xyVar = CellVariable(mesh=mesh, name="x y", value=x * y)
>>> k = Variable(name="k", value=1.)
>>> viewer = MatplotlibVectorViewer(vars=numerix.sin(k * xyVar).grad, 
...                 title="MatplotlibVectorViewer test")
>>> for kval in numerix.arange(1, 10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()
>>> viewer = MatplotlibVectorViewer(vars=numerix.sin(k * xyVar).faceGrad, 
...                 title="MatplotlibVectorViewer test")
>>> for kval in numerix.arange(1, 10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()
>>> for sparsity in numerix.arange(5000, 0, -500):
...     viewer.quiver(sparsity=sparsity)
...     viewer.plot()
>>> viewer._promptForOpinion()
>>> from fipy import *
>>> mesh = (Grid2D(nx=5, ny=10, dx=0.1, dy=0.1)
...         + (Tri2D(nx=5, ny=5, dx=0.1, dy=0.1) 
...          + ((0.5,), (0.2,))))
>>> x, y = mesh.cellCenters
>>> xyVar = CellVariable(mesh=mesh, name="x y", value=x * y)
>>> k = Variable(name="k", value=1.)
>>> viewer = MatplotlibVectorViewer(vars=numerix.sin(k * xyVar).grad, 
...                 title="MatplotlibVectorViewer test")
>>> for kval in numerix.arange(1, 10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()
>>> viewer = MatplotlibVectorViewer(vars=numerix.sin(k * xyVar).faceGrad, 
...                 title="MatplotlibVectorViewer test")
>>> for kval in numerix.arange(1, 10):
...     k.setValue(kval)
...     viewer.plot()
>>> viewer._promptForOpinion()

Creates a Matplotlib2DViewer.

Parameters :
vars

a rank-1 CellVariable or FaceVariable object.

title

displayed at the top of the Viewer window

scale

if not None, scale all arrow lengths by this value

sparsity

if not None, then this number of arrows will be randomly chosen (weighted by the cell volume or face area)

log

if True, arrow length goes at the base-10 logarithm of the magnitude

limits : dict

a (deprecated) alternative to limit keyword arguments

xmin, xmax, ymin, ymax, datamin, datamax

displayed range of data. Any limit set to a (default) value of None will autoscale.

axes

if not None, vars will be plotted into this Matplotlib Axes object

figaspect

desired aspect ratio of figure. If arg is a number, use that aspect ratio. If arg is ‘auto’, the aspect ratio will be determined from the Variable’s mesh.

quiver(sparsity=None, scale=None)

matplotlibViewer Module

class fipy.viewers.matplotlibViewer.matplotlibViewer.AbstractMatplotlibViewer(vars, title=None, figaspect=1.0, cmap=None, colorbar=None, axes=None, log=False, **kwlimits)

Bases: fipy.viewers.viewer.AbstractViewer

Attention

This class is abstract. Always create one of its subclasses.

The AbstractMatplotlibViewer is the base class for the viewers that use the Matplotlib python plotting package.

Create a AbstractMatplotlibViewer.

Parameters :
vars

a CellVariable or tuple of CellVariable objects to plot

title

displayed at the top of the Viewer window

figaspect

desired aspect ratio of figure. If arg is a number, use that aspect ratio. If arg is an array, figaspect will determine the width and height for a figure that would fit array preserving aspect ratio.

xmin, xmax, ymin, ymax, datamin, datamax

displayed range of data. A 1D Viewer will only use xmin and xmax, a 2D viewer will also use ymin and ymax. All viewers will use datamin and datamax. Any limit set to a (default) value of None will autoscale.

cmap

the colormap. Defaults to matplotlib.cm.jet

colorbar

plot a colorbar in specified orientation if not None

axes

if not None, vars will be plotted into this Matplotlib Axes object

log

whether to logarithmically scale the data

figaspect(figaspect)
log

logarithmic data scaling

plot(filename=None)

test Module

Test numeric implementation of the mesh