LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I fix the XY Graph Plot Legend?

Solved!
Go to solution

I have an XY graph which plots up to 3 sets of data. While looking to change the color of some of those data sets, I saw an option on the right-click context menu for the plot legend called "Plot Last Element". Not knowing the pain I would be causing myself, I clicked this because I wanted to see what it did. I THINK (though I really am not sure since I can't find any documentation explaining this option) that it added a plot entity to the XY graph, which somehow made the legend entity for one of my 3 actual data sets disappear. While trying to get this legend entity back I clicked some other options and to make a long story short, my plot legend is now totally ruined.

 

I should be a 3 row plot legend with a "net flow", "flow in", and "flow out" entry. Currently I have plot4, plot5, and plot6, none of which exist. If I try to expand the plot legend up or down, I just get more plot7, plot8, etc. non existent plots. I can't find the original plots anymore, and I need them to display, but I have absolutely no clue how to just get things back to default and I can't find any docs that explain the more advanced functions of the plot legend. Please help. With every minute I fear I will make the plot legend worse.

Download All
0 Kudos
Message 1 of 5
(1,787 Views)
Solution
Accepted by topic author Tarnarmour

Do you mean "Show Last Element"?

 

You can search LabVIEW Help for that.  It is a menu choice that shows the last element in an array of elements.  A plot legend is essentially an array of plots.  I have no idea why you show 12, or why there would be more added every time you choose that menu choice.  I suspect you've had at least 12 plots somewhere in the past.  If you attached a VI, we could investigate that more.

 

But you can right click your plot legend (in edit mode) and pick Visible Items >> Vertical Scrollbar to be able to scroll the list back to the top.

Message 2 of 5
(1,759 Views)

Also don't forget you can right-click a graph and open its properties window where you will find several tabs that allow you to control all the aspects of the graph including the number of plots, their names, which scales they associate to, the legend, cursors, update modes and all the colors, points, line thicknesses, etc...

 

If you get everything mixed up, you can fix it from there.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 3 of 5
(1,724 Views)

No, not show last element. I'm plotting multiple files to an XY plot through a shift register. VI is set up so that multiple "file names can be selected from the VI while it is running. The plots selected are plotted correctly but the legend does not correspond to the plots selected. The plot displays the selected elements in the order they appear in the "file names" window. The plot legend changes the indicated colors of the plot items while the plot keeps them the same. Imagine an array with 5 items. When you select the five items they are plotted in order "0","1", "2","3","4" and the legend orders them as follows "1", "2", "3", "4", "0" so the first plot item "0" corresponds to legend item "1"not "0". And plot "1" corresponds (same color) to legend item "2" ... And the final plot item "4" in the legend it shows that color the color that is plot 4 in the legend it describes item "0". PLOT DOES NOT CORRESPOND TO THE LEGEND.

 

0 Kudos
Message 4 of 5
(1,561 Views)

Hi Ken,

 


@KEN123456 wrote:

PLOT DOES NOT CORRESPOND TO THE LEGEND.


BECAUSE YOU DID IT WRONG!

 

No need to cry: you need to set the ActivePlot first, then you can change its properties!

Hint: The property node executes the properties from top to down…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(1,530 Views)