06-14-2017 09:58 AM
Hi,
I am trying to fix the horizontal axis of a plot. It can get very narrow because the data points are distributions values. In cases that it does get narrow, I would like to zoom in on it by making the axis tighter which means removing the data points when my Y values is 0 before the rising edge of the plot and after the falling edge of it.
I have a file showing an example of what the plot may look like sometimes.
I can extract the data from excel but I don't know how to removed those values or do some tricks with the x axis to make it tighter using Labview excel activex. Can someone help me?
06-14-2017 04:00 PM
Looks to me like your data is a very simple 1D array of numbers. If you already know how to read them into LabVIEW then you are half way there. If you want to iterate through values in an array and return anything that is not zero, then do this:
Is that what you want to do?
06-15-2017 10:53 AM
no not at all.
I want to remove the zeros before the start rising edge of the plot and after the falling edge of it. Because there will be zeros in the middle of the plot. In other words I want to make the X axis a little tighter programmatically because the plots will vary at each iteration of data file that I process.
Once I am thinking If I can detect the first rising edge of the plot, I can set the starting axis X point to be 5 points before it. And if I detect the last falling edge of the plot I can set the ending X axis limit to be 5 data points after it.
I attached a file showing what the raw plot would look and how I want to modify it
06-15-2017 11:24 AM
Hi ritch_by_nature,
You are right that this problem becomes trivial once you can identify the first rising edge and the last falling edge. The first edge could be detected by measuring the first time the signal rises above a certain threshold. The last edge could be detected using the same process, but starting at the end of your array and decrementing the index.
Best,
Duncan W.
06-15-2017 11:50 AM
Also I wanted to clarify I am not generating a real time signal.. It's a 2D array from a saved data file
06-15-2017 11:56 AM
06-20-2017 10:32 AM
Not a bad solution but this create another issue. As my graph changes setting up a fixed threshold don't quite work.
Also I want to clarify although your technique works for reading a file directly and plotting it. It doesn't work for my code because I am setting the max and min axis values using excel activex. I tried getting the max and min of subarray 2 for my x-axis using your code but it didn't work.
06-20-2017 11:03 AM - edited 06-20-2017 11:05 AM
That is exactly why I created this Malleable VI later that day. It takes an array of points or an array of EXT, DBL, SGL or INT. (sorry, no Complex or Fixed Point support)
06-20-2017 02:45 PM
Thanks, I had already manage to get to that part. But presetting my threshold is not working when I go through many data files to plot. Assuming That I want to modify my X axis only. Attached is of what I am trying to do when it comes to setting the axis only.
I tried using the max and min values of your final subarray and feed it to my x axes MaximumScale and MinimumScale Methods but it did not work
06-20-2017 03:07 PM
Scale the Y axis