By default, LabVIEW draws plot images relative to a plot area origin point. You can instead use data points of the graph as references rather than the plot origin by translating between coordinate systems.

This procedure applies to using the Plot Images properties to draw images on the plot area of a graph.

To translate graph coordinates of the data points to coordinates of the overall front panel, use the Map XY To Coordinates method. 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. The origin of the plot image area is 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.

Note Using splitter bars creates multiple panes. When using splitter bars, you must account for the offset of the plot area of the graph from the origin of the owning pane.

Complete the following steps to programmatically map graph coordinates to the coordinates of the owning pane.

  1. 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.
  2. Right-click the XY input of the Map XY to Coordinates method and select Create » Constant from the shortcut menu.
  3. Wire the graph coordinates of the data points to the XY input of the Map XY to Coordinates method.
  4. Right-click the graph and select Create » Property Node » Plot Area Bounds from the shortcut menu to create a Plot Area Bounds Property Node.
  5. Add the Unbundle By Name function to the block diagram.
  6. Wire the Plot Bounds output of the Plot Area Bounds Property Node to the input cluster input of the Unbundle By Name function.
  7. Resize the Unbundle By Name function so that both the left and top elements appear.
  8. Add the Bundle function to the block diagram.
  9. Wire the left and top elements of the Unbundle By Name function to the element inputs of the Bundle function.
  10. Add the Subtract function to the block diagram.
  11. Wire the Coords output of the Map XY To Coordinates Invoke Node to the x input of the Subtract function.
  12. Wire the output cluster output of the Bundle function to the y input of the Subtract function.
  13. Right-click the x–y output of the Subtract function and select Create » Indicator from the shortcut menu.