# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution
Highlighted

## Two curves on a single plot

What am I doing differently between these two files? I want to plot two curves on the same plot in the file DecayingGaussian.vi, but when doing the same thing as in 2 curves in single plot-1.vi, I get an error. I'm at a loss.

Message 1 of 4
(121 Views)
Solution
Accepted by topic author jnc8mc
04-13-2019 03:18 PM

## Re: Two curves on a single plot

Modify decaying Gaussian like below.

1. Make your points index on the for loop.
2. Then bundle the arrays (x, y array)
3. Then put the clusters into an array.

mcduff

Message 2 of 4
(108 Views)

## Re: Two curves on a single plot

Your x-values are equally spaced (x0=0, dx=1), so a simple waveform graph is sufficient.

Also:

• There is a primitive for e^x and 10^x,
• The /250 exist is both case and thus belongs before the case structure. In fact, arranged right, the two cases only differ by two diagram constants and can be pulled out of the loops.
• I am sure there is a way to have fewer coercion dots.

LabVIEW Champion Do more with less code and in less time
Message 3 of 4
(74 Views)

## Re: Two curves on a single plot

Also note that you are doing a lot of duplicate operations. For example the Gaussian only needs to be calculated once before the loop and not 500 times in a row. The outer FOR loop only applies scaling.

There are plenty of ways to rewrite that code more efficiently, here is one possibility.

LabVIEW Champion Do more with less code and in less time
Message 4 of 4
(70 Views)