LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Q] How to merge 2 differents XY Graph?

Solved!
Go to solution

Hi,

 

I'm currently having a stupid problem, at least I hope.

 

StillAProblem.png

 

I would like to plot the XY graph 2 and the other one on the same graph, but I'm just not able to. I tried to merge them in several ways, but it's not working. 

 

I know there is a probably a dimension problem of my array compared to the other one, but what I don't understand is why I can plot them separatly on the same kind of graph, even invert the wires but not merge them easily to show me the both results on 1?

I already searched on google and on LabView forum, but don't have found anything yet.

 

Is there an easy way to do it?

 

I can't post my VI, but if really needed to help me, maybe I can create a one reproducing that problem. I tried to give as much as possible informations on the screenshot I took for that reason.

 

Thank you,

Sébastien

0 Kudos
Message 1 of 6
(5,237 Views)

Your representation for the plots is different. The top plots are a cluster of arrays and the bottom ones are an array of clusters. Hover over the terminal for the XY graph and click the Detailed Help link in the context help window and read it. Look at the examples it links to. Like I said in the other thread, it is crucial to understand the data types and what they represent.


___________________
Try to take over the world!
Message 2 of 6
(5,227 Views)

Hi,

 

I've read all the XY Graph.vi, but it doesn't help me.

I agree with you there is a cluster of arrays and an array of clusters. I also agree with you that it's important to correctly important to understand what kind of data you are using, but I'm doing an internship during 4 months (already one month and 2 weeks done), and it's not thinkable that I focus on that during more weeks on a so "small" details as it's really not the main goal of my internship.

 

I tried to use almost all the "cluster to array" "array to cluster" "build array" "insert to array" "bundle" in a lot of differents ways, but I just have lack of skills in LabView to correct my problem.

 

I just realised that it was quite easy to extract the values of a graph, so I was able to create a VI with exactly the same values reproducing the problem. I attached it.

 

StillAProblem.png

 

Thank you,

 

Regards,

Sébastien

0 Kudos
Message 3 of 6
(5,213 Views)
Solution
Accepted by Zepiii

Here's one way:

 

Merge2XYGraph.png

 

To manipulate individual elements in arrays, you will usually need to iterate over them with a loop. You could equally go over the elements of the arrays in the top graph and bundle them (or use the Index and Bundle Cluster Array primitive to create an array of cluster) to convert them to the format of the bottom graph.


___________________
Try to take over the world!
Message 4 of 6
(5,202 Views)

This is just sick how complicated it is for something that looks so basic. I tried with one for loop, but it would have took me ages to be able to do what you have done.

 

Thank you very much... once again.

 

As usual, I have not forgotten kudos 😉

 

Cheers!

Sébastien

0 Kudos
Message 5 of 6
(5,197 Views)

@Zepiii wrote:

This is just sick how complicated it is for something that looks so basic.


I don't think it is complicated, as long as you understand the data types. It basically translates into:

 

For each PLOT

For each POINT

Take the X value and the Y value and add them to an array

 

 

Or converting

 

[{x1,y1},{x2,y2},{x3,y3}]

 

to

 

{[x1,x2,x3],[y1,y2,y3]}

 

where [] is an array and {} is a cluster.


___________________
Try to take over the world!
Message 6 of 6
(5,191 Views)