Vertical ExaggerationΒΆ

Originally posted: https://github.com/pyvista/pyvista-support/issues/8

# sphinx_gallery_thumbnail_number = 2
import pyvista as pv
from pyvista import examples
import PVGeo

Load data files using PVGeo

gpath, _ = examples.downloads._download_file("gravi.txt")
ppath, _ = examples.downloads._download_file("surf.txt")

gravi = PVGeo.ubc.GravObsReader().apply(gpath)
psurf = PVGeo.ubc.TopoReader().apply(ppath)

# Filter points of topo to a surface
surf = psurf.delaunay_2d()
gargs = dict(
    point_size=5.0,
    render_points_as_spheres=True,
    cmap="bwr",
    clim=[-50, 110],
    stitle="Residuals",
)
sargs = dict(cmap="gist_earth")


p = pv.Plotter()
p.add_mesh(gravi, **gargs)
p.add_mesh(surf)
p.camera_position = [
    (259020.43748942937, 5129530.509280042, 13023.703775334989),
    (270665.9132071607, 5119041.602718343, -837.0133710551552),
    (0.39114802616415034, -0.5453684907934401, 0.7413342234630576),
]
p.show()
exaggeration

Out:

/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pyvista/plotting/plotting.py:1297: PyvistaDeprecationWarning:
"stitle" is a depreciated keyword and will be removed in a future
release.

Use ``scalar_bar_args`` instead.  For example:

scalar_bar_args={'title': 'Scalar Bar Title'}

  warnings.warn(USE_SCALAR_BAR_ARGS, PyvistaDeprecationWarning)

[(259020.43748942937, 5129530.509280042, 13023.703775334989),
 (270665.9132071607, 5119041.602718343, -837.0133710551552),
 (0.39114802616415034, -0.5453684907934401, 0.7413342234630576)]
p = pv.Plotter()
p.add_mesh(gravi, **gargs)
p.add_mesh(surf, **sargs)
p.set_scale(zscale=5)
p.show()
exaggeration

Out:

/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pyvista/plotting/plotting.py:1297: PyvistaDeprecationWarning:
"stitle" is a depreciated keyword and will be removed in a future
release.

Use ``scalar_bar_args`` instead.  For example:

scalar_bar_args={'title': 'Scalar Bar Title'}

  warnings.warn(USE_SCALAR_BAR_ARGS, PyvistaDeprecationWarning)

[(293224.7554334926, 5139900.025933493, 4912.309886698521),
 (271629.4835, 5118304.754000001, 593.2555000000001),
 (0.0, 0.0, 1.0)]

Total running time of the script: ( 0 minutes 3.211 seconds)

Gallery generated by Sphinx-Gallery