.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_gallery/mesh/surface_terrain.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr__gallery_mesh_surface_terrain.py: Elevation map of the earth ========================== Surface graphic showing elevation map of the earth .. GENERATED FROM PYTHON SOURCE LINES 7-36 .. code-block:: Python # run_example = false import imageio.v3 as iio import fastplotlib as fpl import numpy as np # grayscale image of the earth where the pixel value indicates elevation elevation = iio.imread("https://neo.gsfc.nasa.gov/archive/bluemarble/bmng/topography/srtm_ramp2.world.5400x2700.jpg").astype(np.float32) elevation /= 2 figure = fpl.Figure(size=(700, 560), cameras="3d", controller_types="orbit") mesh = figure[0, 0].add_surface(elevation, cmap="terrain") mesh.world_object.local.scale_y = -1 figure[0, 0].axes.grids.xy.visible = True figure[0, 0].camera.show_object(mesh.world_object, (-4, 2, -1), up=(0, 0, 1)) figure.show() figure[0, 0].camera.zoom = 2.5 # NOTE: fpl.loop.run() should not be used for interactive sessions # See the "JupyterLab and IPython" section in the user guide if __name__ == "__main__": print(__doc__) fpl.loop.run() .. _sphx_glr_download__gallery_mesh_surface_terrain.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: surface_terrain.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: surface_terrain.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_