Example Code

Create a Multi-Plot Graph where each Plot has an Associated Scale and Cursor

Code and Documents

Attachment

Introduction


This is a technique that can be used to create any type of Graph (XY Graph, Waveform Graph etc.) with multiple plots, whereby each plot has its own Y-Axis scale and cursor.

Steps to Complete

In order to see a working demonstration of a Waveform Graph which has two plots with each having its own Y-Axis scale and cursor, download and install the attached VI. This technique can be expanded any number of plots. In order to create such a graph yourself, follow the steps below.

  1. Place down a graph on the Front Panel and Create your Block Diagram such that you are passing multiple plots of data to the graph.
  2. Add a Y-Axis to your graph for each plot by right-clicking the existing Y-Axis and selecting Duplicate Scale. It is often desirable for Y-Axis' to be on opposite sides of the graph. This can be achieved by right-clicking the axis and selecting Swap Sides.
  3. Associate each plot to the created Y-Axis by right-clicking the graph and selecting Properties. Navigate to the Plots tab and for each plot (selectable from the drop down menu) select a Y-Axis using the Y-scale pull down menu.
  4. Add two cursors to the graph which you ultimately want to associate with the created plots. Display the Cursor Legend by right-clicking the graph and selecting Visible Items > Cursor Legend. Add the required cursors by right-clicking the Cursor Legend and selecting Create Cursor > Free.

  5. Associate each of the created cursors with the previously created Y-Axis. This is done by right-clicking each cursor in the Cursor Legend and selecting Y Scale > x, where x is the name of the Y-Axis.


Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
aroberts
Member
Member
on

Answered my question exactly and worked like a charm. Thank you!

Contributors