AmesimKnowledge

The Plot Python API environment in detail

Customize a curve

Once you have a curve on a graph, you can customize it to be exactly as you want. This section describes the different ways to achieve this.

Figure 7: Matrix curve customization

Display object: how to draw the curve

Each curve has a Display object associated with it. This object specifies how the curve is drawn.

The first step is to select the type of display that you want to use. Each type of curve supports some specific displays. To know the displays that can be used for your curve, consult the documentation of the corresponding curve object. For example, the Curve2D supports the Display2DLine and the DisplayDensity (see Curve2D).

At the creation of the curve, you can specify the display you want to use. If you do not specifiy, a default display is used. For example, the Curve2D uses a Display2DLine by default:

Copy


# Create a 2D curve with default display: Display2DLine
curve = amepyplot.Curve2D(itemX, itemY)

# Create a 2D curve with given display
curve = amepyplot.Curve2D(itemX, itemY, amepyplot.Display2DLine())

Note

The two curve creations in the above code example are equivalent.

To set a specific display on a curve, you can:

  • Define the display at the creation. Copy*# Create a 2D curve with given display* curve = amepyplot.Curve2D(itemX, itemY, amepyplot.DisplayDensity())

  • Change the display after the curve creation. Copy*# Change curve display* curve.changeDisplay(amepyplot.DisplayDensity())

Note

You can consult the documentation of the object CurveDisplay to see examples of rendering for all the available displays.

To know what kind of display is used for a specific curve, you can do the following:

Copy

print("display type:", type(curve.display()))

The result for the previous curve with density display is:

Copy

display type: <class 'amepyplot.DisplayDensity'>

Display customization

Once you have choosen a display type, you will be able to customize it to get the exact rendering you want.

Here is an example where we want to draw a 2D curve using a blue line with a thickness of 2 pixels and a dashed line style. Furthermore, we want to display a red cross symbol on each point:

Copy


# Creation of the display: we can set many parameters directly at the creation
display = amepyplot.Display2DLine(QtCore.Qt.blue, QtCore.Qt.DashLine, 2)

# We can also set parameters afterwards
display.configureSymbol(amepyplot.Cross, QtCore.Qt.red, size=2)

# Now, don't forget to set the display to the curve
curve.changeDisplay(display)

Figure 8: Customized Display2DLine

Here is another example of a CurveM1D. We want to display it in a 3D graph with light, using a cold colorscale with light blue isolines (without iso-values):

Copy


# Convert the graph if it is not in 3D
if not graph.is3DGraph():
    graph.convertTo3D()

# Activate the light on the 3D graph
graph.configure3D(useLight=True)

# Surface display creation
display = amepyplot.DisplaySurface(amepyplot.COLD, showIsolines=True)

# Set isolines color and do not draw iso-values
display.configureIsolines(color=QtGui.QColor(145, 198, 212), showText=False)

# Set the display on the curve
curve.changeDisplay(display)

Figure 9: Customized DisplaySurface

Note

You can find many examples of display customization in the Plot API App. You can consult the associated documentation

Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Plots_Python_API/xid1204683 · retrieved 2026-07-17