The Plot Python API environment in detail
Interaction with a plot
To allow custom interactions with the created graphs, the API provides some specific objects. This section presents how to use them.
Figure 11: Manipulator in AMECamDesigner
GraphManipulator : the base class
The base class for all the manipulable objects is GraphManipulator. You can consult the reference documentation that presents a hierarchy diagram of the available objects that inherit from this class. You can also consult the section dedicated to annotations that presents the basic information about these classes.
Here is the main information about these objects:
Manipulation: you can specify the permitted manipulations using the function setAllowedMotions. It will allow you, for example, to accept only the horizontal motion of a GraphPoint. Copy
*# Restricts the movement of the manipulator horizontally* manip.setAllowedMotions(amepyplot.GraphManipulator.MotionX)Callbacks: the manipulators provide callbacks on user interactions. You can connect any of these callbacks to associate your specific behavior. Here is an example where we want to change the curve color to blue when the mainpulator is pressed: Copy`# Creation of the point manipulator manip = amepyplot.GraphPoint(graph)
# Set user data to be able to retrieve the manipulator from the graph manip.setUserData("color manipulator")
# Set the position of the manipulator manip.setModelPosition(3, 50)
# Create the working function def onPressed(): # Get the first curve of the graph curve = graph.curve(0)
*# Change the color of the curve to blue*
curve.display().configure(QtCore.Qt.blue)
*# Update the graph*
graph.update()
# Connect the signal "beginManipulation" to the working function manip.beginManipulation.connect(onPressed)` Note A manipulator has no default behavior. It means that you need to provide and connect a working function that does the required behavior on the manipulation.
- Contextual menu: you can add contextual actions to a manipulator using the method addAction.
Note
You can find an example of curve manipulation in the Plot API App. You can consult the reference documentation
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Plots_Python_API/xid1204685 · retrieved 2026-07-17