09-18-2017 04:01 PM
Hi,
There's a gap between the two graphs. Does anyone have any idea how to close that gap? It's shown in the image below:
The vi is attached also. Thanks for helping!
09-19-2017 02:13 AM
First of all I'm missing your plot. Second of all just make 2 plots in stead of the amount that you have now. As first a green plot and secondly a red plot. Make the values of the green plot, where only the red plot should be visible, NaN. Do the same (NaN for the red plot values) when the green plot should be visible. This makes it more simple and should resolve your issue.
09-19-2017 02:21 AM - edited 09-19-2017 02:22 AM
Hi Ben,
- unfortunately your VI is not executable as it is missing several type definitions and a XY graph as well!
- it also doesn't help when you don't provide meaningful example data.
- it seems "interesting" you initialize the shift register holding the plot number with zero, but then decrement its value in each of the cases. What are the plots "-1", "-2",…???
09-19-2017 10:46 AM
My bad, I had 2 vis labelled test1, here's the correct vi.
09-19-2017 11:23 AM
Put all your code in one For Loop.
Each plot needs to include the point where you make the change from green to red. You need a point where the green will end, and a point where the red will begin. And vice versa.
So when you go to hide a slide, first determine if you are going from a green to red point. On the point where you make the change, plot both values. On any consecutive slice after that, put NaN in either the red or the green. When it switches back, put points in both plots, and then NaN, in either the green or red.
09-19-2017 01:17 PM
Hi Ravensfan,
I'm not sure what you mean by hide a slide. Are you talking about the overlap between the 1's array and the NaN's array?
Yes, the idea is to include the point where the two arrays merge in both plots but I'm not sure how.
Thanks!
09-19-2017 01:25 PM
Actually, I meant hide a "slice". I must've mistyped.
Let's say your array is 1 2 3 4 5 6 and you want 3 and 4 to be hidden. Then you need your green plot to be
1 2 3 NaN 5 6
Your red plot to be:
NaN Nan 3 4 5 Nan
So where you transition from shown in slice 2 to hidden in slice 3, you need 3 to be in both arrays, then start doing NaN in the green array.
And when you transition from hidden to shown starting at slice 5, then you need 5 to be in both arrays and start doing NaN in the red array.
09-19-2017 07:07 PM
I thought that's what the 2 loops were doing, the top replaces the slices to be ignored with NaN's in an array of 1's and the bottom does the opposite for the same slices. Now, when the dt is small it appears continuous. It's considering both slices but it appears to be stopping a few points short/starting a few points after each slice. to illustrate, here's an image of the graph with a smaller dt(0.01):
Thank you for your help!
09-20-2017 08:19 AM
No.
Your one loop will give 1 2 NaN Nan 5 6
Your other gives NaN Nan 3 4 NaN Nan.
They are either/or.
You need to have a given point be "active" in both plots.
So it needs to be:
1 2 3 NaN 5 6
NaN Nan 3 4 5 Nan
3 exists in both and 5 exists in both so that it can END the one plot with a complete line while the next plot begins.
09-25-2017 10:07 AM
Hi ravensfan,
I modified that vi. Could you give me some feedback on whether this vi could be simplified further or if it could be done in a different way?
Thank you for your help!!