Mapping Graph Coordinates to Plot Image Coordinates
When you use the Plot Images properties, LabVIEW draws the image beginning at the origin of the graph plot area. If you want to use the Plot Images properties to draw an image that uses the graph data points as references rather than the plot area origin (0,0), you can use the Map XY To Coordinates method to map the graph coordinates of the data points to coordinates of the front panel. The Map XY To Coordinates method returns coordinates relative to the origin of the front panel. However, to draw the image correctly, you must make the coordinates relative to the origin of the plot image area located at the top, leftmost corner of the graph plot area. To account for the difference, you must subtract the offset of the plot area of the graph from the origin of the front panel from the coordinates that Map XY To Coordinates returns.
Complete the following steps to programmatically map graph coordinates to the coordinates of the owning pane.
Note Using splitter bars creates multiple panes. You then account for the offset of the plot area of the graph from the origin of the owning pane.
Right-click the graph and select Create»Invoke Node»Map XY To Coordinates from the shortcut menu to create a Map XY To Coordinates Invoke Node.
Right-click the XY input of the Map XY to Coordinates method and select Create»Constant from the shortcut menu. Wire the graph coordinates of the data points to the XY input of the Map XY To Coordinates method.
Right-click the graph and select Create»Property Node»Plot Area Bounds from the shortcut menu to create a Plot Area Bounds Property Node.