.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_gallery/image_volume/image_volume_toy_data.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_image_volume_image_volume_toy_data.py: Volume rendering of toy data ============================ Volume rendering of toy trig data .. GENERATED FROM PYTHON SOURCE LINES 7-32 .. code-block:: Python import fastplotlib as fpl import numpy as np n_cols = 100 n_rows = 100 z = 50 xs = np.linspace(0, 1_000, n_cols) sine = np.sin(np.sqrt(xs)) data = np.dstack([np.vstack([sine * i for i in range(n_rows)]).astype(np.float32) * j for j in range(z)]) figure = fpl.Figure(cameras="3d", controller_types="orbit") volume = figure[0, 0].add_image_volume(data) figure.show() # 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_image_volume_image_volume_toy_data.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: image_volume_toy_data.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: image_volume_toy_data.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_