The Plot Python API environment in detail
Update a curve
In some cases, an existing curve needs to be updated. This means the data values will be modified. This section explains how to do that.
Access to the Item(s)
The data values are stored in the Item objects. To modify these values, you first need to access the corresponding items. Here is an example on a 2D curve:
Copy
xItem = curveToUpdate.xItem()
yItem = curveToUpdate.yItem()
Set new values
The new values can come from a new simulation, a new computation or something else. Note that the size of the new values must be coherent. That means for example that to be used in a 2D curve, the x values and the y values must have the same size.
Here is an example where the x and y values of a 2D curve are updated:
Copy
xItem.setValues(xNewValues)
yItem.setValues(yNewValues)
Update the graph
Once the values have been updated, you need the graph to be redrawn. This can be done for a single graph like this:
Copy
graph.update()
Or you can do it for all the graphs of a PlotWidget like this:
Copy
widget.updateGraphs()
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Plots_Python_API/xid1245599 · retrieved 2026-07-17