LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting intensity graph by flipping axis's alternatively

Hi

 

I am plotting a 2D(10x10) array as shown in the attachment below. However, I need to flip x-axis alternatively i.e. line 2, 4, 6 and so on. I looked over the forum and found out how to flip the axis and tried to use it but I found out that it'll flip for every line. 

 

However, I need to flip every alternate line and save the data in excel accordingly. What condition should be given to X-scale flipped function so that the condition will get true only on alternate line? Please help.

0 Kudos
Message 1 of 12
(3,406 Views)
What do you mean that you need to "flip" a line?

Mike..

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 12
(3,387 Views)

Flipping a line means plotting from 0 to 10 in one line and plotting from 10 to 0 in next line and so on as you can see in the attached vi


@mikeporter wrote:
What do you mean that you need to "flip" a line?

Mike..


. I've tried to use logical functions and I think I got the flipping part correct in intensity plot. However, how to save data in the same format in excel as well?

0 Kudos
Message 3 of 12
(3,381 Views)

The flipping part is still not correct. Instead of flipping the data in that position, it is flipping the whole axis. Can you please help me with this?

0 Kudos
Message 4 of 12
(3,332 Views)

To make it more clear I have attached a picture. I want to display my 2D array in this format and save the data accordingly. Please help someone.

0 Kudos
Message 5 of 12
(3,324 Views)

I cannot open your vi (only have 2012 on this machine) but it sounds like you need to process the data going into the chart rather than try to get the chart to plot the data differently for alternate lines (which it won't).

 

Loop through your input data rows with a for loop and reverse every other row with the Reverse 1D Array.vi and re-assemble into a 2D array at the output tunnel. Then feed that data into your chart.

0 Kudos
Message 6 of 12
(3,311 Views)

@Stuart.Parkinson wrote:

I cannot open your vi (only have 2012 on this machine) but it sounds like you need to process the data going into the chart rather than try to get the chart to plot the data differently for alternate lines (which it won't).

 

Loop through your input data rows with a for loop and reverse every other row with the Reverse 1D Array.vi and re-assemble into a 2D array at the output tunnel. Then feed that data into your chart.


I am thinking exactly that. I tried using the reverse array but I could not separate even rows from odd rows. I've attached the vi in 2012 format. Can you please give me some suggestion?

0 Kudos
Message 7 of 12
(3,301 Views)

I'm not entirely sure what you are trying to do in this vi, or even why you want to reverse every other row. However I have added a modification which does just that - does this help?

0 Kudos
Message 8 of 12
(3,292 Views)

@Stuart.Parkinson wrote:

I'm not entirely sure what you are trying to do in this vi, or even why you want to reverse every other row. However I have added a modification which does just that - does this help?


Thank you for the help. Now I am able to reverse every other row. However the elements are not properly ordered. The 1st element is moving to the last row. The 1st 10 element should be in 1st row and the next 10 in second row but reversed and so on. However, this program is sending the 1st 10 element to the last row and last 10 element to the 1st row.

 

Thus, whole 2D array seems to be flipped now. How can we solve this problem? Please help. 

0 Kudos
Message 9 of 12
(3,276 Views)

As I said, "I'm not entirely sure what you are trying to do in this vi, or even why you want to reverse every other row", hence the example is just an example of how it could be done.

 

If your elements are in the wrong order, why not compute them in the correct order? Your values obviously don't just come from a random number function like in your vi, so where do they come from, what calculates them, and what order are you getting them in? Can you change that?

 

Also you might be better off with your graph outside the loop. You wouldn't need the shift register, just compute the values and use an indexing tunnel and feed all the data to the graph at once (assuming that you don't necessarily want it snaking across the screen, filling up from the bottom like it does at the moment).

 

Without more clear and specific detail on what you are actually trying to do, I don't know what else to suggest.

0 Kudos
Message 10 of 12
(3,260 Views)