plot¶
-
dolfin.common.plotting.
plot
(object, *args, **kwargs)¶ Plot given object.
- Arguments
- object
- a
Mesh
, aMeshFunction
, aFunction
, aExpression
<dolfin.cpp.Expression>, aDirichletBC
<dolfin.cpp.DirichletBC> or aFiniteElement
.
- Examples of usage
In the simplest case, to plot only e.g. a mesh, simply use
mesh = UnitSquare(4,4) plot(mesh)
Use the
title
argument to specify title of the plotplot(mesh, tite="Finite element mesh")
It is also possible to plot an element
element = FiniteElement("BDM", tetrahedron, 3) plot(element)
Vector valued functions can be visualized with an alternative mode
plot(u, mode = "glyphs")
A more advanced example
plot(u, wireframe = True, # use wireframe rendering interactive = False, # do not hold plot on screen scalarbar = False, # hide the color mapping bar hardcopy_prefix = "myplot", # default plotfile name scale = 2.0 # scale the warping/glyphs title = "Fancy plot" # Set your own title )