LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY graph help

Solved!
Go to solution

I posted a pretty similar thread a little while ago, I was having trouble getting 3 plots on an XY graph.  I got it to work, and now I am writing a similar program, but I am still running into issues with the graphing functions in LabVIEW.

 

The attached "XY block" is the block diagram I am working with to work this out.

 

What I want the program to do:

The consumer loop is going to run 3 times, and depending on the "weighting" control, it is going to put out 3 sets of data (A, B, and C weighting for sound level meters.  The actual program doesn't take the data from the table, it uses a voltmeter and signal generator to collect the data, but the data from the table works fine for working this out).

Traditionally, all 3 sets of data are plotted together on the same chart.

 

The second attachment, "XY graph 3 plots" is the chart I currently get with the block diagram shown.

There are 2 problems with the way the data is presented in the graph, 1 more important than the other.

 

First, notice how LabVIEW connects the last point of 1 graph, with the first point of the next, resulting in 2 straight lines that cut across the center of my chart.  This is probably due to the fact that LabVIEW is treating them as 1 data set instead of 3 seperate ones... which brings me to the next, less important issue.

 

Since LabVIEW is treating them all as 1 set of data, there is only 1 label "plot 0" in the legend.  It would be nice, though not necessary, if I could have 3 items in the legend, one for each plot (and obviously to be renamed, but I know how to do that).  A, B, and C weightings are always the same, so without the legend, you still know which one is which, but it would be nice to have a legend.

 

Download All
0 Kudos
Message 1 of 20
(4,937 Views)

Well, I've drifted down enough on the board that no one sees my post anymore.

 

I know how to plot a graph with multiple plots on the same graph (mainly thanks to the help of Ben64) but I can only do so if I graph all of the data sets at the same time, as arrays and clusters.

I need to be able to plot a graph from start to finish, then plot a second function, labeled as such, on the same chart.  (...and then plot a 3rd function too).

0 Kudos
Message 2 of 20
(4,918 Views)

Is there no way to designate whether the data is going into plot 0, plot 1, plot 2, etc? (or in my case, A weighting, B weighting and C weighting?) I can add other functions in the legend by just expanding the legend (and renaming them).  I can get rid of the connecting line altogether, but I don't think that is going to work unless I can  distinguish between the plots.

0 Kudos
Message 3 of 20
(4,909 Views)

LarsUlrich,

 

Please see attached very basic demo VI (LabVIEW V10).

 

Im simply concatenating the plot to the existing graph data. You may wish to use replace array subset instead, which would then allow you to specify which plot to overwrite.

 

Hope this helps,

 

Steve

 

 

Message 4 of 20
(4,901 Views)

Thanks Steve but can you please down convert to version 8.5 for me?

0 Kudos
Message 5 of 20
(4,895 Views)
Solution
Accepted by topic author LarsUlrich

See attached..

Message 6 of 20
(4,890 Views)

This is a simple way of doing this

Message 7 of 20
(4,885 Views)

@SteveBale wrote:

Im simply concatenating the plot to the existing graph data. You may wish to use replace array subset instead, which would then allow you to specify which plot to overwrite. 


This code goes agains all design guidelines.

 

  • overuse of local variables
  • overuse of sequence structures
  • not scaleable
  • lots of duplicate code
  • Linear tapeworm

I would strongly recommend angainst any similar code architecture. It also does not answer the question about xy graphs.

Message 8 of 20
(4,877 Views)

Thanks for the suggestions Alten, though it looks like with a simple change it will work for the XY graph.  Also, it seems I can take out the locals and use shift registers.

Last question, is there a property node to change the name of the plots as they appear in the legend?  I saw a property node: plot name, but there was no way to specify which plot you want to rename, so that may just be the title of the whole thing (i.e. XY graph, in my attachments)

0 Kudos
Message 9 of 20
(4,855 Views)

"Plot Name" is correct ut you must set the "Active Plot" to specify which plot to change

Message 10 of 20
(4,848 Views)