LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

xy graph with y axis color?

Is it possible to show the Y axis in an XY graph as a different color depending on its Y values?  I have seen this done with 3D Intensity graphs, but need to use the XY Graph.  I am displaying spectrum data using and XY graph.  It presently looks like this:

2018_08_05_13_43_49_TDI_Spectrometer_Main.vi_Front_Panel_on_Avantes_Spectrometer.lvproj_My_Computer_.png

I would like it to look like this (without the starry background):

xy graph with Y axis intensity color_.jpg

0 Kudos
Message 1 of 6
(3,615 Views)

Yes, map it into an intensity graph.

0 Kudos
Message 2 of 6
(3,600 Views)

@TeraTech wrote:

Is it possible to show the Y axis in an XY graph as a different color depending on its Y values?  I have seen this done with 3D Intensity graphs, but need to use the XY Graph. 

 


Who imposes the restriction that it "needs" to be an xy graph? You should always use the tool most suitable for the job!

 

If there are relatively few possible colors, you can overlay several plots on an xy graph, each with selective data and corresponding fill color, and each filled to zero. Seems clumsy.

0 Kudos
Message 4 of 6
(3,596 Views)

When I connect my 2D data to an intensity graph it looks like this:2018_08_05_17_57_52_XYGraph_and_Intensity_Graph.vi_Front_Panel_on_Avantes_Spectrometer.lvproj_My_Com.png

2018_08_05_17_57_52_XYGraph_and_Intensity_Graph.vi_Front_Panel_on_Avantes_Spectrometer.lvproj_My_Com_snippet.png

The help for Intensity graph says: the array indices are the X and Y for a given Z.  In my case the Z is going to be the same as the Y, right?

 

0 Kudos
Message 5 of 6
(3,571 Views)

@TeraTech wrote:

When I connect my 2D data to an intensity graph it looks like this:

2018_08_05_17_57_52_XYGraph_and_Intensity_Graph.vi_Front_Panel_on_Avantes_Spectrometer.lvproj_My_Com_snippet.png

The help for Intensity graph says: the array indices are the X and Y for a given Z.  In my case the Z is going to be the same as the Y, right?

 


This code makes absolutely no sense. You need to setup a 2D array with all zeroes and a size corresponding to e.g. the number of pixels in the graph in each dimension. Place it in a shift register. Now, in a loop, you would replace certain elements point by point with your data, using x as column index and y as row index and a value scaled to Y. You need to apply the desired linear mapping to relate x and y to array indices and z (based on y) to the color.

0 Kudos
Message 6 of 6
(3,569 Views)