Plotting



planex2d draws its objects with matplotlib or plotly, every edge from its exact curve. px.Plot takes faces, shapes, wires, compounds and sketches, and in Jupyter, every object shows itself as an SVG picture without a call. px.Plot3d draws the objects on their planes in 3D, next to OpenCASCADE solids.
A plot is also a check of the geometry. Marks show tiny edges, open ends and chosen edges, line_col="type" gives lines, arcs and splines a color each, and a sketch is drawn in the colors of its constraint state. px.PlotField draws measurements and simulation results from NGSolve or FEniCSx on the same geometry, from wall thickness maps to temperatures with contours, arrows and field lines.
In this section
General





Sketches
Measurements and fields
Everything at a glance
|
|
|---|---|
|
A face, shape, wire, compound, sketch or selection, an id that names one such as |
|
For an OpenCASCADE shape: the plane it is cut at (see A section through a solid); without one, it is drawn flat in its own plane. |
|
A matplotlib Axes or plotly Figure to draw into; it also selects the backend. |
|
|
|
The color of every edge. |
|
The fill color of the faces (default |
|
Marks short edges and edges with an open end at their midpoints. |
|
Marks chosen edges, given as ids, selected edges or faces, indices or a mask. |
|
Shows the legend. |
|
For a sketch: constraint signs, start and end pieces, and direction arrows. |
|
For a sketch: the OpenCASCADE solid it lies on, projected under it (see On a solid). |
Fields and meshes |
|
|---|---|
|
Color maps of NGSolve and FEniCSx fields or of measurements, with the options |
|
The element edges of a mesh, or of a cut through a 3D mesh. |
See Fields and Measurements for drawing fields and measurements, and NGSolve and FEniCSx for the solvers.
Jupyter displays a plot by itself. In a script, plt.show() from matplotlib.pyplot opens the window.


