.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/3Dvispy/13-axis.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_3Dvispy_13-axis.py: Display axis ============================================================ .. image:: ../../_static/cigvis/3Dvispy/13.png :alt: image :align: center .. GENERATED FROM PYTHON SOURCE LINES 14-53 .. code-block:: default # sphinx_gallery_thumbnail_path = '_static/cigvis/3Dvispy/13.png' import numpy as np import cigvis from pathlib import Path root = Path(__file__).resolve().parent.parent.parent seisp = root / 'data/co2/sx.dat' ni, nx, nt = 192, 192, 240 sx = np.fromfile(seisp, np.float32).reshape(ni, nx, nt) nodes1 = cigvis.create_slices(sx, pos=[[0, 191], [0, 191], [0, 239]]) # Add a north pointer via passing north_direction, if axis_pos is 'auto', axis will change when rotating nodes1 += cigvis.create_axis(sx.shape, 'box', axis_pos='auto', north_direction=[0, 1]) nodes2 = cigvis.create_slices(sx, pos=[[0, 191], [0, 191], [0, 239]]) # Use intervals and starts to control the tick labels, and set axis_labels to show the axis labels nodes2 += cigvis.create_axis(sx.shape, 'axis', axis_pos='auto', intervals=[0.025, 0.025, 0.004], starts=[10, 10, 3], axis_labels=['Inline/km', 'Crossline/km', 'Time/s']) nodes3 = cigvis.create_slices(sx, pos=[[0, 191], [0, 191], [0, 239]]) # if want to show the axis in the specific position, set axis_pos, and the axis will be fixed # there are some other parameters to control the axis, such as tick_nums, ticks_font_size, labels_font_size, ticks_length nodes3 += cigvis.create_axis(sx.shape, 'axis', axis_pos=[0, 0, 1], tick_nums=4, ticks_font_size=26, labels_font_size=30, ticks_length=6) nodes4 = cigvis.create_slices(sx, pos=[[0, 191], [0, 191], [0, 239]]) # More controls, see cigvis/vispynodes/axis3d/Axis3D class # for example, axis color, axis line width, ticks color, rotation the axis label nodes4 += cigvis.create_axis(sx.shape, 'axis', axis_pos=[3, 3, 1], color='blue', ticks_color='red', rotation=[50, -40, -100]) cigvis.plot3D([nodes1, nodes2, nodes3, nodes4], xyz_axis=False, grid=(2, 2), share=True, size=(900, 800), savename='example.png') .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.000 seconds) .. _sphx_glr_download_gallery_3Dvispy_13-axis.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 13-axis.py <13-axis.py>` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 13-axis.ipynb <13-axis.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_