Programmatically Change Multi X/Y Axis Labels of a XY Graph

Updated Jun 1, 2023

Environment

Software

  • LabVIEW

Often is necessary to plot data using different scales that we need to easily recognize with appropriate names.
How to do it? Please follow the steps below.

Please note that the following example was developed for change the Labels just of Y axis. The procedure is the same for the X axis.

1. Launch LabVIEW
2. In the Front Panel, right click to open the control palette
3. Select Graph >> XY Graph
 
4. Right click the Y scale >> Duplicate Scale
 
4. In the Block Diagram, right click the XY Graph >> Create >> Property Node >> Active Y Scale
 

 
5.Right click Active Y Scale >> Add Element

6. Click the new element added >> Y Scale >> Name Label >> Text
 

 
7. Change the access mode to All Write if necessary, right clicking the property node >> Change all To Write
 

 
8. Create a constant for the Active Y Scale, right clicking the terminal >> create constant.
9. Insert the number correspondent to the Y Label. Remember that the enumeration starts from 0.
10. Create a constant for the Y Label, right clicking the relative terminal.
11. Type the name you want to give to the axis.

You should have obtained the following .vi
 

This is a snippet, drag and drop it to your VI and use it.

After the execution, you will see the X/Y Graph on the Front Panel that looks like: