GithubHelp home page GithubHelp logo

Comments (2)

banesullivan avatar banesullivan commented on June 19, 2024

@laserman781 - since you posted this twice, once in the main PyVista repo and once here, I'm going to split the two parts of this issue into 1. a question which I'll answer here, and 2. a feature request which I will address in pyvista/pyvista#337

How would I go about having the grid only be shown in the 2d plane (not as a box) at the elevation of the clip?

Simply pass in the bounds of the box you'd like to use - if you want a 2D box, then make the min/max for the plane of no variation the same. For example, in the snippet below, I add a 2D axes grid at the bottom of Mt. St. Helens. All you need to do is specify the bounds argument for show_grid which is a length six array of min/max for each axes (e.g. [xmin,xmax, ymin,ymax, zmin,zmax]).

import pyvista as pv
from pyvista import examples

mesh = examples.download_st_helens().warp_by_scalar()

bounds = mesh.bounds
bounds[5] = bounds[4]

p = pv.Plotter()
p.add_mesh(mesh)
p.show_grid(bounds=bounds)
p.show()

download

from pyvista-support.

banesullivan avatar banesullivan commented on June 19, 2024

FYI: show_grid is an alias/helper for show_bounds - so you might not have seen all the options available unless looking at the docs for show_bounds: https://docs.pyvista.org/plotting/plotting.html#pyvista.BasePlotter.show_bounds

from pyvista-support.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.