Skip to content

How to put mapdl plots into the pyvista.plotter subplots? #1822

Answered by germa89
MrMechanics asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @MrMechanics

Remember that all the plotting functions (which uses vtk=True) pass by the function general_plotter hence they accepts any arguments that this function accept.
So you could use the argument plotter to tell PyMAPDL to reuse an specific plotter.

Having said that, you can do something like:

from ansys.mapdl.core import launch_mapdl
import pyvista as pv
# import code...

# Run model

# Plotting 
plotter = pv.Plotter(shape=(1, 3))

plotter.subplot(0, 0)
mapdl.eplot(plotter=plotter, return_plotter=True) # 'return_plotter' is to avoid plotting yet

plotter.subplot(0, 1)
mapdl.nplot(plotter=plotter, return_plotter=True)

plotter.subplot(0, 2)
mapdl.post_processing.plot_element_stress

Replies: 1 comment 15 replies

Comment options

You must be logged in to vote
15 replies
@RobPasMue
Comment options

@MrMechanics
Comment options

@RobPasMue
Comment options

@germa89
Comment options

@RobPasMue
Comment options

Answer selected by germa89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants