.. 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_custom.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_custom.py: Custom 3D plots =================== Create a custom 3D plot from custom data sets (Plot not defined in Roxie) 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-27 .. code-block:: Python from roxieapi.commons.roxie_constants import PlotLabels from roxieapi.commons.types import Plot3D from roxieapi.output.plots import RoxiePlotOutputs plots = RoxiePlotOutputs( "../input_files/dipole_3d.post.xml", "../input_files/dipole_3d.data" ) parser = plots.output .. GENERATED FROM PYTHON SOURCE LINES 28-32 Show all defined 3D plots dataset --------------------------------- Load 3D plot and get plot information .. GENERATED FROM PYTHON SOURCE LINES 32-40 .. code-block:: Python step = parser.find_transstep(1, 1) assert step is not None print("Defined 3D plot Data:") for col in step.coilData3D.columns[1:]: lbl, desc = PlotLabels.lbl_desc_plot3D(col) print(f" Id: {col}, Label: {lbl}, Description: {desc}") .. rst-class:: sphx-glr-script-out .. code-block:: none Defined 3D plot Data: Id: cut, Label: , Description: Unknown label cut Id: 1, Label: PB, Description: Pressure on broad face of cable, positive away from pole (N/mm**2) Id: 2, Label: PN, Description: Pressure on Narrow face of cable, positive in outward direction (N/mm**2) Id: 3, Label: FX, Description: Lorentz force in x direction / surface area (N/mm**2) Id: 4, Label: FY, Description: Lorentz force in y direction / surface area (N/mm**2) Id: 5, Label: FZ, Description: Lorentz force in z direction / surface area (N/mm**2) Id: 6, Label: FR, Description: Lorentz force in radial direction / surface area (N/mm**2) Id: 7, Label: FF, Description: Lorentz force in azimuthal direction / surface area (N/mm**2) Id: 8, Label: BMAX, Description: |B| max (T) Id: 9, Label: BMIN, Description: |B| min (T) Id: 10, Label: BMID, Description: |B| average (T) Id: 12, Label: JZ, Description: Iz (A) Id: 13, Label: CURVMIN, Description: Min. curvature k (1/mm) Id: 14, Label: CURVMAX, Description: Max. curvature k (1/mm) .. GENERATED FROM PYTHON SOURCE LINES 41-43 Create the plot description --------------- .. GENERATED FROM PYTHON SOURCE LINES 43-47 .. code-block:: Python p3d = Plot3D.create("Custom 3D Plot for FR") p3d.add_coilPlot("6") assert p3d is not None .. GENERATED FROM PYTHON SOURCE LINES 48-50 Create the plot --------------- .. GENERATED FROM PYTHON SOURCE LINES 50-52 .. 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_custom_001.png :alt: plot 3d custom :srcset: /gen/examples/output_parsing/images/sphx_glr_plot_3d_custom_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_custom_001.vtksz .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.150 seconds) .. _sphx_glr_download_gen_examples_output_parsing_plot_3d_custom.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_custom.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_3d_custom.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_3d_custom.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_