Custom Data Plot

This plot assembles data in lists or a list of lists in Python, and then displays them as chart.

The available Python example script is add_custom_data_plot.py.

The following Python code snippet are excerpts from this script.

Create Visual

Creates a custom data plot using data with data_id, although data is not required.

    custom_data = Visuals.CustomData(Id("Custom Data"), data_id)
                            

Add to Postprocessing

Adds custom data plot in postprocessing to control_container, using the specified relative positioning.

    control_container.add_control (
        custom_data,
        True,
        RELATIVE_POSITIONING,
        1./3., 0, 1./3., 1./3.,
        "Data mining"
    )
                            

Select Type

Selects the plot type.

    plot_type = Visuals.CustomData_Type.Lines
                        

Figure 8: Grid

Grid

Figure 9: Lines

Lines

Figure 10: Points

Points

Figure 11: Bars

Bars

Figure 12: HorizontalBars

HorizontalBars

Figure 13: Box

Box

Figure 14: StackedBars

StackedBars

Figure 15: StackedHorizontalBars

StackedHorizontalBars

Figure 16: HorizontalBox

HorizontalBox

Figure 17: EvalMesh

EvalMesh

Figure 18: Mesh - Single Triangles

Mesh - Single Triangles

Figure 19: Mesh - Colored Stripe

Mesh - Colored Stripe

Add Data

To add some data to the plot:

    custom_data.add_data("layer", PyOSDesignEntry(ListList2VariantSignal(mat, vec)),StyleList(),WStrList(), False, plot_type )
                        

Parameters are:

  • Layer_name

  • Data: Converted from Python list or listlist to PyOSDesignEntry

  • Styles

  • Channelnames

  • Show channelnames in legend

    • True: Results in Layername - channel y_data1

    • False: results in ydata1

  • plot_type

Preferences

The following preference settings are available:

  • Appearance

    • Font size

    • Line width

    • Symbol size

    • Enable axes

    • Enable lines

    • Enable surfaces

  • Axis Formats

  • Axis Ranges

  • Labels

  • Legend

  • Log Axes

  • Palette

  • Rotation

  • Window appearance

For more details, see Plot Preference Settings.