08-27-2015 11:09 AM
I'm trying to define a custom colormap for a line ploted on a X-Y graph. Is this possible? I searched, but the only solution I could find was downloading the $4,000 Sound and Vibration Measurement Suite to get the 'Colormap' graph type. It doesn't seem like this should be that complicated in LabView.
I did what I want in Matlab, but I would like to loop my code in LabView to show captured data semi-realtime. I already have the code necessary for capturing the data, I just want to be able to color the graph. I would like to make the input a 2D array with two rows (X and Y), with an additional input array with the same number of columns as the data array indicating the color. The data array should be double-precision data type. Not sure what the color array would be, but I could imagine three rows with RGB integer values.
Figure from Matlab
Any help?
Solved! Go to Solution.
08-27-2015 11:14 AM - edited 08-27-2015 11:14 AM
You can use an intensity graph, map your lines into it's grid, and use the Z for color.
Here is an example (posted here)
08-27-2015 11:23 AM - edited 08-27-2015 11:24 AM
Are there any other options? The x-axis data is sourced from the voltage value of a function generator. Plotting this on an X-Y graph is trivial. Butchering the waveform to line up with indices of an array is doable I suppose, but far from ideal. I'll see if I can borrow the method in the code you posted.
08-27-2015 11:26 AM - edited 08-27-2015 11:26 AM
You can use any resolution you need and you can set x0 and dx for the axis of the intensity graph. Should be relatively trivial to re-map. If the points are scattered, the harder part would be to do the 3D interpolation. I think I've done it in the distant past.
08-27-2015 11:29 AM - edited 08-27-2015 11:30 AM
08-27-2015 08:11 PM
Thanks for the tip altenbach, I was able to get it working with your suggestion.