.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gen/examples/output_parsing/plot_3d.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_gen_examples_output_parsing_plot_3d.py: 3D plots =================== Plot the 3D geometry and results Download Input files * :download:`dipole_3d.data <../../../../../examples/input_files/dipole_3d.data>` * :download:`dipole_3d.post.xml <../../../../../examples/input_files/dipole_3d.post.xml>` .. GENERATED FROM PYTHON SOURCE LINES 14-18 Setting up ---------- Standard Loading of input, Parsing and Initializing RoxiePlotOutputs object .. GENERATED FROM PYTHON SOURCE LINES 18-24 .. code-block:: Python from roxieapi.output.plots import RoxiePlotOutputs plots = RoxiePlotOutputs( "../input_files/dipole_3d.post.xml", "../input_files/dipole_3d.data" ) .. GENERATED FROM PYTHON SOURCE LINES 25-29 Extracting plot information ----------------------------------- Load 3D plot and get plot information .. GENERATED FROM PYTHON SOURCE LINES 29-34 .. code-block:: Python parser = plots.output p3d = parser.get_3d_plot(1) # We load Plot Number 1 (defined in datafile) assert p3d is not None .. GENERATED FROM PYTHON SOURCE LINES 35-37 Create the plot --------------- .. GENERATED FROM PYTHON SOURCE LINES 37-40 .. code-block:: Python figure = plots.plots3d.plot_3d(p3d) figure.show() .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /gen/examples/output_parsing/images/sphx_glr_plot_3d_001.png :alt: plot 3d :srcset: /gen/examples/output_parsing/images/sphx_glr_plot_3d_001.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /builds/roxie/roxie-api/docs/source/gen/examples/output_parsing/images/sphx_glr_plot_3d_001.vtksz .. GENERATED FROM PYTHON SOURCE LINES 41-43 Changing the dataset to plot ---------------------------- .. GENERATED FROM PYTHON SOURCE LINES 43-52 .. code-block:: Python print("Available Datasets:") for id, pl in enumerate(p3d.coilPlots): print(f"Index {id} with label {pl.label}") # Set the new prefered dataset: p3d.active = p3d.coilPlots[2] # Print with new dataset figure2 = plots.plots3d.plot_3d(p3d) figure2.show() .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /gen/examples/output_parsing/images/sphx_glr_plot_3d_002.png :alt: plot 3d :srcset: /gen/examples/output_parsing/images/sphx_glr_plot_3d_002.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /builds/roxie/roxie-api/docs/source/gen/examples/output_parsing/images/sphx_glr_plot_3d_002.vtksz .. rst-class:: sphx-glr-script-out .. code-block:: none Available Datasets: Index 0 with label Coil Index 1 with label |B| max (T) Index 2 with label |B| min (T) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.396 seconds) .. _sphx_glr_download_gen_examples_output_parsing_plot_3d.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_3d.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_3d.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_3d.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_