LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Color XY gra[h using a gradient?

Solved!
Go to solution

Hi,

 

I searched around on the forums and  website a lot, but I couldn't find what I was looking for.

 

I have a set of data representing the thickness of a piece of metal, it's been measured at many points to make a grid of data and I plotted it using an Intensity Graph to show the topographical information. I then added a XY Graph beside it, and added a cursor to the intensity graph. As you move the cursor, it displays the profile at that slice.

 

I'm just wondering if it's possible to color my XY  graph the same way the intensity graph is colored? Would I need to have a plot for each region or is there a way to interpolate colors on an xy graph?

 

Attached is a VI I made showing what I'm trying to do.

 

Thanks!

 

-Nick

0 Kudos
Message 1 of 13
(6,292 Views)

You can build a separate intensity graph with the appropriate colors, and drop the plot area image on the graph background, as shown on the attached vis

 

Profile_SIM.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Profile_SIM background builder.png

 

 

Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Download All
Message 2 of 13
(6,273 Views)

Improved version of the subvi below. Now the background colors matches exactly the Zscale.

Although the white color is not centered on zero, this is the correct result, corresponding to the imposed scale : white = 0.5.

I wonder why the Zscale on the intensity graph is shifted...

 

 

 

 

Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 3 of 13
(6,241 Views)
Solution
Accepted by topic author NickG88

If you want the line colored instead, you could do something like in this very old example.

 

 

Message 4 of 13
(6,230 Views)

Thanks for the feedback chilly charly and altenbach!

 

That's exactly what I was looking for altenbach, but both solutions look quite nice.

0 Kudos
Message 5 of 13
(6,185 Views)

I think the Z scale on the intensity graph is shifted because I added random values to the sine wave to make it look a little noisy. I have it setting the mean value equal to white, so with the added random values it would probably be shifted up a bit.

 

 

0 Kudos
Message 6 of 13
(6,174 Views)
A fancier option would involve e.g. the 3D line graph, while setting the viewpoint straight down along the z axis.
0 Kudos
Message 7 of 13
(6,168 Views)

Hello

 

It seems that my question belongs here.

 

I'v done some measurement in XY plane and generate color graph with 3D graph.

I'm trying to do the same with intensity graph and I need more interpolation between color?

 

One solution would be interpolating data but I  more interesting in some Intensity graph feature.

 

Does someone knows what kind of interolation is used with 3D graph ?

 

Any idea ?

 

Regards

 

0 Kudos
Message 8 of 13
(5,802 Views)

 


sasko wrote:

It seems that my question belongs here.


 

No, it doesn't! This is a thread with a marked solution. Even though the topics are related, you now cannot mark a reply to your question as solution, because it is not your thread. Also, this thread is half a year old. So, next time start a new thread. Insert a link to this thread if you think it provides additional information. 😉

 

I don't know what kind of interpolation the 3D graph uses, but here's a quick draft (LV 8.0) using my old bilinear interpolation routines posted here many years ago. (see also this example).

 

It probably needs a few tweaks but should get you started.

 

 

Download All
0 Kudos
Message 9 of 13
(5,794 Views)

Sorry for disregarding the rules, I did not know for it.

 

Thank you for intensity graph example. It is great !

 

Sasa

0 Kudos
Message 10 of 13
(5,756 Views)