From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Color XY gra[h using a gradient?

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

Message 1 of 13
(6,360 Views)

## Re : Color XY graph using a gradient?

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

Chilly Charly    (aka CC)

E-List Master - Kudos glutton - Press the yellow button on the left...

Message 2 of 13
(6,341 Views)

## Re : Color XY graph using a gradient?

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...

Message 3 of 13
(6,309 Views)
Solution
Accepted by topic author NickG88

## Re: Color XY gra[h using a gradient?

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

Message 4 of 13
(6,298 Views)

## Re: Color XY gra[h using a gradient?

Thanks for the feedback chilly charly and altenbach!

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

Message 5 of 13
(6,253 Views)

## Re: Re : Color XY graph using a gradient?

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.

Message 6 of 13
(6,242 Views)

## Re: Re : Color XY graph using a gradient?

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

## Re: Re : Color XY graph using a gradient?

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

Message 8 of 13
(5,870 Views)

## Re: Re : Color XY graph using a gradient?

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.

Message 9 of 13
(5,862 Views)

## Re: Re : Color XY graph using a gradient?

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

Thank you for intensity graph example. It is great !

Sasa

Message 10 of 13
(5,824 Views)