LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to colour a spesific points in a graph

Solved!
Go to solution
Hi all,

I have a graph contains power steps, i want to colour a spesific pints(one step), i have read some comments regarding XY graph. But i dont use it at this moment. Any idea? Thanks in advance
0 Kudos
Message 1 of 9
(3,732 Views)

A single plot has a single color. Period.

 

So if you want to have different colors in "a single plot", you have to fake it by using multiple plots. XY Graph helps as it simplifies positioning of plots next to each other.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 9
(3,718 Views)
Thank you so much for your comment, can you please explain to me how to fake by using multiple plots?
Thanks in advance
0 Kudos
Message 3 of 9
(3,694 Views)

You should take a look into the context help of the XY Graph to learn how to bundle multiple plots.

The next to look into is how to make X-arrays for all these fake plots to get an appearance of "one single plot".

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 9
(3,681 Views)
Ok, i will have a look. Thanks again
0 Kudos
Message 5 of 9
(3,670 Views)
Solution
Accepted by topic author Al-rawachy

The second plot you add will be an array of the same length as your data (and the same X-array), with all of the y-values set to NaN (this prevents it from appearing on the graph).  When you know which point you want to "change color", copy it's value into the same location in the second plot's cluster.  Set the color of plot2 to whatever you want.  This can be done for any point on the graph (lets say you wanted to color all points above a certain threshold, just repeat above steps for each point of interest).

Message 6 of 9
(3,656 Views)

@pjr1121 wrote:

The second plot you add will be an array of the same length as your data (and the same X-array), with all of the y-values set to NaN (this prevents it from appearing on the graph). 


This will work but it is not necessary to have an array of the same lenght, you can have a single point array. Select plot type that doesn't include line and point type that you can see on the graph.

 

add single point to xy graph.png

 

Ben64

Message 7 of 9
(3,638 Views)

also I think on other method  I think it is more easy to work with 

just a bit work on coordinates conversion's 

0 Kudos
Message 8 of 9
(3,625 Views)

Hi all,

 

I am so grateful to you guys, It's really work. Thanks again

 

Regards 

0 Kudos
Message 9 of 9
(3,566 Views)