""" 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>` """ # %% # Setting up # ---------- # Standard Loading of input, Parsing and Initializing RoxiePlotOutputs object # 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 # %% # Show all defined 3D plots dataset # --------------------------------- # Load 3D plot and get plot information # 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}") # %% # Create the plot description # --------------- p3d = Plot3D.create("Custom 3D Plot for FR") p3d.add_coilPlot("6") assert p3d is not None # %% # Create the plot # --------------- figure = plots.plots3d.plot_3d(p3d) figure.show()