Skip to content

Plot 2d with pyvista #5992

Answered by tkoyama010
HumbertHumbert7 asked this question in Q&A
Apr 28, 2024 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

You can show the bounds axis using the show_bounds method. See show_bounds method API document for more detail.
(Edit: To make a 2D view, you can control cpos arg in the show method. See show method API document for more detail. Also, enable_parallel_projection is also useful to make it a 2D view.)

import pyvista as pv
from pyvista import examples

mesh = pv.Sphere()
plotter = pv.Plotter()
actor = plotter.add_mesh(mesh)
actor = plotter.show_bounds(
    grid='front',
    location='outer',
    all_edges=True,
)
plotter.enable_parallel_projection()
plotter.show(cpos="xy")

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@tkoyama010
Comment options

@HumbertHumbert7
Comment options

@tkoyama010
Comment options

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

This discussion was converted from issue #5991 on April 29, 2024 00:40.