nplot#
- Mapdl.nplot(nnum='', vtk=None, **kwargs)#
APDL Command: NPLOT
Displays nodes.
Note
PyMAPDL plotting commands with
vtk=True
ignore any values set with thePNUM
command.- Parameters:
- nnumbool,
int
,optional
Node number key:
False
: No node numbers on display (default).True
: Include node numbers on display.
Note
This parameter is only valid when
vtk==True
- vtkbool,
optional
Plot the currently selected nodes using
pyvista
. Defaults to currentuse_vtk
setting as set on the initialization of MAPDL.- plot_bcbool,
optional
Activate the plotting of the boundary conditions. Defaults to
False
.Warning
This is in alpha state.
- plot_bc_legendbool,
optional
Shows the boundary conditions legend. Defaults to
False
- plot_bc_labelsbool,
optional
Shows the boundary conditions label per node. Defaults to
False
.- bc_labels
List
[str
],Tuple
(str
),optional
List or tuple of strings with the boundary conditions to plot, i.e.
["UX", "UZ"]
. You can obtain the allowed boundary conditions by evaluatingansys.mapdl.core.plotting.BCS
. You can use also the following shortcuts:‘mechanical’ To plot the following mechanical boundary conditions:
'UX'
,'UY'
,'UZ'
,'FX'
,'FY'
, and'FZ'
. Rotational or momentum boundary conditions are not allowed.'thermal'
To plot the following boundary conditions: ‘TEMP’ and ‘HEAT’.'electrical'
To plot the following electrical boundary conditions:'VOLT'
,'CHRGS'
, and'AMPS'
.
Defaults to all the allowed boundary conditions present in the responses of
ansys.mapdl.core.Mapdl.dlist()
andansys.mapdl.core.Mapdl.flist()
.- bc_target
List
[str
],Tuple
(str
),optional
Specify the boundary conditions target to plot, i.e. “Nodes”, “Elements”. You can obtain the allowed boundary conditions target by evaluating
ansys.mapdl.core.plotting.ALLOWED_TARGETS
. Defaults to only"Nodes"
.- bc_glyph_size
float
,optional
Specify the size of the glyph used for the boundary conditions plotting. By default is ratio of the bounding box dimensions.
- bc_labels_font_size
float
,optional
Size of the text on the boundary conditions labels. By default it is 16.
- nnumbool,
Examples
Plot using VTK while showing labels and changing the background.
>>> mapdl.prep7() >>> mapdl.n(1, 0, 0, 0) >>> mapdl.n(11, 10, 0, 0) >>> mapdl.fill(1, 11, 9) >>> mapdl.nplot( ... nnum=True, ... vtk=True, ... background='w', ... color='k', ... show_bounds=True ... )
Plot without using VTK.
>>> mapdl.prep7() >>> mapdl.n(1, 0, 0, 0) >>> mapdl.n(11, 10, 0, 0) >>> mapdl.fill(1, 11, 9) >>> mapdl.nplot(vtk=False)
Plot nodal boundary conditions.
>>> mapdl.nplot( ... plot_bc=True, ... plot_bc_labels=True, ... bc_labels="mechanical", ... )