LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting two plots on graph but in different way

Hi,

1. I am trying to plot graph produced from already existing file. While running the code I want a dot to read the values in already existing plot like comet in MATLAB.

 

2. I am trying to plot an already existing plot from right side while another plot is coming from left side. The plot from right side is from already existing file and the plot from left side would be the identical points but in real time.

 

I am new to labVIEW and mainly when it comes to plotting two different graphs. I am able to plot two different graphs. But not in the fashion I have written above.

 

Thank you in advance.

0 Kudos
Message 1 of 11
(3,147 Views)

@dib1205 wrote:

Hi,

1. I am trying to plot graph produced from already existing file. While running the code I want a dot to read the values in already existing plot like comet in MATLAB.

I didn't know what a "plot like comet in Matlab" meant, but this sounds like a Chart.  Do you know the difference between a Chart and a Graph?  Basically, a Graph is where you put all the points down "at once", while a Chart is you add points "one at a time" and they either "scroll" (like a Strip Chart Recorder) or "Sweep" (like an oscilloscope) (there's a third mode, as well).

 

2. I am trying to plot an already existing plot from right side while another plot is coming from left side. The plot from right side is from already existing file and the plot from left side would be the identical points but in real time.

 

Not sure what you want to do here.  However, the "plot from the left side" sounds rather like a Chart.  Do you want a "static plot" ("right side") + a "dynamic plot" ("left side")?  And if so, why?  Might be easiest to have a Graph (existing plot) and below that a Chart (real time, new points) ...  Alternatively, you could make a Chart with two plots, Channel 1 the "existing plot" (plotted one point at a time) and Channel 2 the "incoming data" ...

Bob Schor

0 Kudos
Message 2 of 11
(3,124 Views)

Thank you Bob for replying.

1. The question you have asked is exactly my problem. I want to plot a graph before taking the data in real-time and overlay on the existing plot point by point like a chart.

 

2. The options you have told me in 2nd question, I have tried that. But to match the amplitude and frequency of both (static and dynamic) plots, the way I have suggested is more helpful.

 

 

0 Kudos
Message 3 of 11
(3,117 Views)

Are the x-values spaced equally?

Do the x-values match up between the plots?

 

To incrementally overlay new data to an existing plot, you would start the second plot with a matching array of NaNs, keep it in a shift register, and incrementally replace elements with the new data while graphing both with each update.

0 Kudos
Message 4 of 11
(3,107 Views)

Take your "Static" waveform.  Plot it on a graph

 

Export it as a simplified image (There is a Method for that! so just use an invoke node) Choose your options wisely. (trial and error works well)

 

Then, if you are really good.....

Example_VI.png

They call you "Cracker Jack"

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 11
(3,103 Views)

Here's what I had in mind.

 

TwoPlots.png

0 Kudos
Message 6 of 11
(3,096 Views)

Thank you so much for replying. Your code is not compatible to mine and mine is lower version i.e., 2011. That's why I couldn't download. But I looked at the picture of the diagram and I made mine. The problem is when I am passing the value after x^2 it is not going as an array but n element. That's why I am not able to plot. Using Build array is also not helping me. But I think this is a nice solution if it works in my version.

0 Kudos
Message 7 of 11
(3,089 Views)

Right-click the tunnel and disable indexing so it looks like in the picture (solid orange)..

 

Here's a 2011 version.

0 Kudos
Message 8 of 11
(3,082 Views)

Hi,

Thank you for your reply. Your program works fine. But when I am substituting the sine wave with the data from the already existing file it is plotting the data from at 30000 to 60000 point (data length is 30000) and it starts reading real time signal from 0 to 30000. But I want my program to work the way your code is working. Is there any problem with version? Because when I tried running your code after changing the node indexing it was happening with your code also.

 

Thank you.

Dibyajyoti

0 Kudos
Message 9 of 11
(3,056 Views)

Maybe your "built array" is set to "concatenate". Make sure it outputs a 2D array and not a 1D array.

 

If this does not solve the problem, please attach your code.

0 Kudos
Message 10 of 11
(3,038 Views)