LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding spectral color on background of graph

Solved!
Go to solution

Hi, I have a program that plots a spectrum with wavelength on the x-axis. I would like to have the corresponding color displayed as the background. But it should also scale with the x-axis as this can change, so a simple image won't do. Is there a way to create a scalable background? 

 

I have attached an image that shows roughly what I want.

 

In this topic they show some screenshots, but not how to actually program it. Could I somehow create an array of colors and then plot that array as colors? I'm not sure if that is possible.

 

---
0 Kudos
Message 1 of 5
(294 Views)
Solution
Accepted by topic author Basjong53

You can put intensity graph (it has color table property to match values and colors) under transparent data graph, then synchronise scales

Or you can use Plot Images Back property of your data graph and adjust image every time scale changes. 

Message 2 of 5
(250 Views)

The intensity graph under the other graph did the trick, great idea. Thanks very much!

---
0 Kudos
Message 3 of 5
(214 Views)

Also works, might be easier in some cases 

When number of digits on Y scale changes and affects graph width.

Or if you need to shift/scale, you need to adjust one graph, not 2.

30 ms 1500x400 picture

bg image.png

PS LV 2011 breaks reference and property node connections on the snippet 

PPS. Extremely slow (and slowing down) when trying to edit image from property node. VI time changes from 300 ms to 1.5 s in 20 seconds of running continuously.

Message 4 of 5
(172 Views)

@Alexander_Sobolev wrote:

Also works, might be easier in some cases 

When number of digits on Y scale changes and affects graph width.

Or if you need to shift/scale, you need to adjust one graph, not 2.

30 ms 1500x400 picture

bg image.png

PS LV 2011 breaks reference and property node connections on the snippet 

PPS. Extremely slow (and slowing down) when trying to edit image from property node. VI time changes from 300 ms to 1.5 s in 20 seconds of running continuously.


Some thought that may help out...

 

1)

Advanced >>> Auto Adjust Scales (disable)

 

2)

Before updating the PlotImage.Back

 

DeferFPUpdat = T

Graph Visable = F

 

Apply the update

 

Then undo the Graph visable and then the DeferFPUpdat

 

The first inhibits the scale adjust.

 

The second lets LV update the image and skip the display updates until all changes applied.

 

Not usre if any will help but it may be worth a try.

 

Ben

 

 

Message 5 of 5
(161 Views)