07-10-2018 12:35 PM
Hello, guys
Now I have X and Y coordinates and each coordinate position has a corresponding value Z, now I want to make Z as the color to plot on X and Y graph, how can I do that? I searched the contour line plot example, but it seems that VI, Z is calculated by X and Y which is different from my situation.
Thanks
Solved! Go to Solution.
07-10-2018 01:12 PM
Hi Zyb,
You can use an intensity graph to plot your data. All you need is the 2D array of Z-values, then modify the graph properties to get the x- and y-axis values correct.
07-10-2018 02:01 PM
Hello,
I see what you mean, but in my application, it seems not that convenient to do so. Can we do like make x,y,z written to a function the same time, and then plot it?
07-10-2018 03:14 PM
Can you post a VI that includes your data? To make sure the data is stored, create an indicator for the array, run the VI, then change the indicator to a constant.
LV 2016 or lower please.
07-10-2018 03:25 PM
My VI is like I use the step motor to scan the XY domain and measure the magnetic field. I use 'S shape' to scan it, like (-2,0);(-1,0);(0,0);(1,0);(2,0);(2;1);(1,1);(0,1);(-1,1);(-2,1); the step motor position X and Y and magnetic field measurement value Z are read each cycle. So I want is one measurement value corresponding to one group (x,y) and colormap it.
07-10-2018 03:29 PM
Yes. Initialize an array with the dimensions you need and some default value (0, 1, NaN?). Then as you acquire data just replace the data at the proper coordinates using "Replace Array Subset".
You can make the initial array bigger than needed and just trim using Array Subset at the end too, if your X,Y coordinates aren't equal. Simple example..
07-10-2018 05:49 PM
Hello,
Thanks for the reply.
In my application, I need to show the actual x and y position, and my step size can be controlled. Can we make the x axis and y axis show actual position automatically? .
07-10-2018 07:03 PM
Yes, in fact I hinted at how to do it above. Modify the graph properties either by hand or with a property node.
07-11-2018 11:13 AM
Hello,
Thanks for your reply. The property node does the job. And I find that the input for the inner loop is the random number, it updates every inner loop cycle so your method can do it. But for my application, the input is the value read from a while loop for each cycle. So how can we achieve the instant read value of while loop being the input of for loop for each cycle simultaneously without data loss?
07-11-2018 11:27 AM
I'm sorry you lost me with your question. Why don't you post your code along with a picture of what you hope to see (using MS paint or powerpoint is fine 🙂