Programmatically Set Plot Image on Several Plot Areas of a Mixed Signal Graph

Updated Mar 20, 2025

Environment

Software

  • LabVIEW

This article explains how to set an image on several Plot Areas within a Mixed Signal Graph programmatically. The solution involves utilizing the Active Plot Area and PlotImages properties.

To set an image on multiple Plot Areas, follow the steps below:

 

  1. On the Block Diagram of your LabVIEW VI, right-click the Mixed Signal Graph indicator and select Create >> Reference.

 

 

  1. From the Application Control Palette, place a Property Node.
  2. Connect the Mixed Signal Graph Reference to the Reference input of the Property Node.

 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

 

  1. Right-click the Property Node and select Change All to Write.

 

 

  1. Click Property on the Property Node and select Active Plot Area.
    • This property allows you to programmatically specify which Plot Area to apply the subsequent properties to.
  2. Drag the bottom-edge of the Property Node to display another property. Set this one to Plot Images >> Back.
    • This property programmatically inserts an image to the background of the Plot Area.

 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

 

  1. Right-click the ActPlotArea property and select Create >> Constant.
    • This value represents the Plot Area index that you wish to draw an image on. It is 0 (the 1st Plot Area) by default.

 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

 

  1. From the Graphics & Sound >> Graphics Formats Palette, place a Read PNG File or Read JPEG File VI, depending on which image file type is being used.
  2. On the Path to PNG/JPEG File input, right-click and select Create >> Constant. Populate this constant with the path to your image file.
  3. From the Graphics & Sound >> Picture Functions Palette, place a Draw Flattened Pixmap VI.
    • This VI converts the image from the specified path into a picture data type in LabVIEW.
  4. Connect the Image Data output from Read PNG/JPEG File VI to the Image Data input of Draw Flattened Pixmap.

 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

 

  1. Connect the New Picture output from Draw Flattened Pixmap VI to the PlotImages.Back property.

 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

 

  1. Copy and paste the Property Node, and repeat.
    • NOTE: ensure that the value wired to ActPlotArea is changed to suit which Plot Area you wish to draw on.
    • The example below shows how to draw the same image on 2 Plot Areas.

 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

 

  1. Run the VI and observe that an image is drawn to each of the specified Plot Areas.

 

The attached VI (compatible with LabVIEW 2019 and newer) demonstrates the difference between the PlotImages.Back and PlotImages.Middle properties. To use this VI:

 

  1. Download the attached PlotImage on Multiple Plot Areas.vi
  2. Open and run the VI.
  3. When the Image (BACK) button is enabled, an image is added to the background of each Plot Area. The image is removed when the button is disabled.
  4. When the Image (MIDDLE) button is enabled, an image is added between the grid lines and the plot data. The image is removed when the button is disabled.