This page contains the viewers Package documentation.
Bases: fipy.viewers.viewer._Viewer
Create a _Viewer object.
Parameters : |
|
---|
Bases: exceptions.IndexError
Generic function for creating a Viewer.
The Viewer factory will search the module tree and return an instance of the first Viewer it finds that supports the dimensions of vars. Setting the ‘FIPY_VIEWER‘ environment variable to either ‘gist‘, ‘gnuplot‘, ‘matplotlib‘, ‘tsv‘, or ‘vtk‘ will specify the viewer.
The kwlimits or limits parameters can be used to constrain the view. For example:
Viewer(vars=some1Dvar, xmin=0.5, xmax=None, datamax=3)
or:
Viewer(vars=some1Dvar,
limits={'xmin': 0.5, 'xmax': None, 'datamax': 3})
will return a viewer that displays a line plot from an x value of 0.5 up to the largest x value in the dataset. The data values will be truncated at an upper value of 3, but will have no lower limit.
Parameters : |
|
---|
A deprecated synonym for Viewer
Bases: fipy.viewers.viewer._Viewer
Treat a collection of different viewers (such for different 2D plots or 1D plots with different axes) as a single viewer that will plot() all subviewers simultaneously.
Parameters : |
|
---|
Interactively test the viewers
Bases: fipy.viewers.viewer._Viewer
“Views” one or more variables in tab-separated-value format.
Output is a list of coordinates and variable values at each cell center.
File contents will be, e.g.:
title
x y ... var0 var2 ...
0.0 0.0 ... 3.14 1.41 ...
1.0 0.0 ... 2.72 0.866 ...
:
:
Creates a TSVViewer.
Any cell centers that lie outside the limits provided will not be included. Any values that lie outside the datamin or datamax will be replaced with nan.
All variables must have the same mesh.
It tries to do something reasonable with rank-1 CellVariable and FaceVariable objects.
Parameters : |
|
---|
“plot” the coordinates and values of the variables to filename. If filename is not provided, “plots” to stdout.
>>> from fipy.meshes.grid1D import Grid1D
>>> m = Grid1D(nx = 3, dx = 0.4)
>>> from fipy.variables.cellVariable import CellVariable
>>> v = CellVariable(mesh = m, name = "var", value = (0, 2, 5))
>>> TSVViewer(vars = (v, v.getGrad())).plot()
x var var_gauss_grad_x
0.2 0 2.5
0.6 2 6.25
1 5 3.75
>>> from fipy.meshes.grid2D import Grid2D
>>> m = Grid2D(nx = 2, dx = .1, ny = 2, dy = 0.3)
>>> v = CellVariable(mesh = m, name = "var", value = (0, 2, -2, 5))
>>> TSVViewer(vars = (v, v.getGrad())).plot()
x y var var_gauss_grad_x var_gauss_grad_y
0.05 0.15 0 10 -3.33333333333333
0.15 0.15 2 10 5
0.05 0.45 -2 35 -3.33333333333333
0.15 0.45 5 35 5
Parameters : |
|
---|