From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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 
Search instead for 
Did you mean: 

Controling colors with XY graphs

How can I controll the colors of individual points in e.g. a scatter
graph in LabView. For example if I want to let the color of each point
be a function of a third variable.

Looking forward for any swift answers to a LabView beginner in
trouble....

Per Johan Brandvik
Associate prof., Arctic Environmental Technology
University studies on Svalbard, Norway
0 Kudos
Message 1 of 8
(3,569 Views)
"Per Johan Brandvik" wrote in message
news:39524A5D.2923269B@unis.no...
> How can I controll the colors of individual points in e.g. a scatter
> graph in LabView. For example if I want to let the color of each point
> be a function of a third variable.
>
> Looking forward for any swift answers to a LabView beginner in
> trouble....
>
> Per Johan Brandvik
> Associate prof., Arctic Environmental Technology
> University studies on Svalbard, Norway

What you want is possible with attribute nodes and some tedious sorting and
shuffling of your data.


A much simpler solution:

Don't use an XY-Graph!

Why not just use an intensity graph? Start with a 2D array of zeroes and
fill in your z-data at appropriate array indices corresponding to your
x and
y values.

Use a nice color ramp for the Z-axis with zero=black.

Cheers
Christian
0 Kudos
Message 2 of 8
(3,569 Views)
Christian
Yes, if I had all the data available, sorting into groups and ploting them in a
multiple graph, could do the job, but I am ploting the data in real time as they
are generated.

What I want to do is to let the color of a positional trace (XY graph) from a
GPS system reflect the concentration of some measurements we are doing in real
time.

I am not so attracted to the intensity graph because I need a a rather high
resulution of my GPS trace. Do you have any further suggestions?

Per Johan

Christian Altenbach wrote:

> "Per Johan Brandvik" wrote in message
> news:39524A5D.2923269B@unis.no...
> > How can I controll the colors of individual points in e.g. a scatter
> > graph in LabView. For example if I want to let the col
or of each point
> > be a function of a third variable.
> >
> > Looking forward for any swift answers to a LabView beginner in
> > trouble....
> >
> > Per Johan Brandvik
> > Associate prof., Arctic Environmental Technology
> > University studies on Svalbard, Norway
>
> What you want is possible with attribute nodes and some tedious sorting and
> shuffling of your data.
>
> A much simpler solution:
>
> Don't use an XY-Graph!
>
> Why not just use an intensity graph? Start with a 2D array of zeroes and
> fill in your z-data at appropriate array indices corresponding to your x and
> y values.
>
> Use a nice color ramp for the Z-axis with zero=black.
>
> Cheers
> Christian
0 Kudos
Message 4 of 8
(3,569 Views)
For LV 5.1.1 see examples for picture control. Does exatly that.

"Per Johan Brandvik" wrote in message
news:39524A5D.2923269B@unis.no...
> How can I controll the colors of individual points in e.g. a scatter
> graph in LabView. For example if I want to let the color of each point
> be a function of a third variable.
>
> Looking forward for any swift answers to a LabView beginner in
> trouble....
>
> Per Johan Brandvik
> Associate prof., Arctic Environmental Technology
> University studies on Svalbard, Norway
>




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
0 Kudos
Message 3 of 8
(3,569 Views)
Reinis
As I understand this picture control example you are refering to, you can
controll the colour of the cursor itself or all the point (or the whole
line) in the XY graph. What I want to do is to let the color of a positional
trace (XY graph) from a GPS system reflect the concentration of some
measurements we are doing in real time.
Do you have any further suggestions?
Per Johan

Reinis Kanders wrote:

> For LV 5.1.1 see examples for picture control. Does exatly that.
>
> "Per Johan Brandvik" wrote in message
> news:39524A5D.2923269B@unis.no...
> > How can I controll the colors of individual points in e.g. a scatter
> > graph in LabView. For example if I want to let the color of each point
> > be a function of a third varia
ble.
> >
> > Looking forward for any swift answers to a LabView beginner in
> > trouble....
> >
> > Per Johan Brandvik
> > Associate prof., Arctic Environmental Technology
> > University studies on Svalbard, Norway
> >
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
0 Kudos
Message 5 of 8
(3,569 Views)
You could use that example and modify it. Also there is a lower level VI
called draw point.vi, it takes x,y coordinates as well as point's color.
Since you can just draw on the picture control without redrawing it, that
should create a scatter plot you want. If you have an array of values
(x,y,z =mapped color), then put draw point.vi inside of for loop with input
being that (x,y,z) array. I attached a simple example, basically a modified
x,y graph pictrue control.


"Per Johan Brandvik" wrote in message
news:39534662.54E1B76E@unis.no...
Reinis
As I understand this picture control example you are refering to, you can
controll the colour of the cursor itself or all the point (or the whole
line) in the XY graph. What I
want to do is to let the color of a positional
trace (XY graph) from a GPS system reflect the concentration of some
measurements we are doing in real time.
Do you have any further suggestions?
Per Johan
Reinis Kanders wrote:
For LV 5.1.1 see examples for picture control. Does exatly that.
"Per Johan Brandvik" wrote in message
news:39524A5D.2923269B@unis.no...
> How can I controll the colors of individual points in e.g. a scatter
> graph in LabView. For example if I want to let the color of each point
> be a function of a third variable.
>
> Looking forward for any swift answers to a LabView beginner in
> trouble....
>
> Per Johan Brandvik
> Associate prof., Arctic Environmental Technology
> University studies on Svalbard, Norway
>
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----



[Attachment Scatter Plot.zip, see below]

0 Kudos
Message 6 of 8
(3,569 Views)
Reinis
Thanks, this looks very promissing. This is exactly what I was looking for!! I will
follow this brilliant idea and implement it into my project.
Thanks again!
Per Johan


Reinis Kanders wrote:

> You could use that example and modify it. Also there is a lower level VI
> called draw point.vi, it takes x,y coordinates as well as point's color.
> Since you can just draw on the picture control without redrawing it, that
> should create a scatter plot you want. If you have an array of values
> (x,y,z =mapped color), then put draw point.vi inside of for loop with input
> being that (x,y,z) array. I attached a simple example, basically a modified
> x,y graph pictrue control.
>
> "Per Johan Brandvik" wrote in message
> news:39534662.54E1B76E@unis.no...
> Reinis
> As I understand this picture control example you are refering to, you can
> controll the colour of the cursor itself or all the point (or the whole
> line) in the XY graph. What I want to do is to let the color of a positional
> trace (XY graph) from a GPS system reflect the concentration of some
> measurements we are doing in real time.
> Do you have any further suggestions?
> Per Johan
> Reinis Kanders wrote:
> For LV 5.1.1 see examples for picture control. Does exatly that.
> "Per Johan Brandvik" wrote in message
> news:39524A5D.2923269B@unis.no...
> > How can I controll the colors of individual points in e.g. a scatter
> > graph in LabView. For example if I want to let the color of each point
> > be a function of a third variable.
> >
> > Looking forward for any swift answers to a LabView beginner in
> > trouble....
> >
> > Per Johan Brandvik
> > Associate prof., Arctic Environmental Technology
> > University studies on Svalbard, Norway
> >
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
>
> Name: Scatter Plot.zip
> Scatter Plot.zip Type: Zip Compressed Data (application/x-zip-compressed)
> Encoding: x-uuencode
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
0 Kudos
Message 8 of 8
(3,569 Views)
Use a multiplot XY graph and use one plot for each color you need. The third
variable becomes the plot index.

Jean-Pierre Drolet

Per Johan Brandvik a écrit dans le message :
39524A5D.2923269B@unis.no...
> How can I controll the colors of individual points in e.g. a scatter
> graph in LabView. For example if I want to let the color of each point
> be a function of a third variable.
>
> Looking forward for any swift answers to a LabView beginner in
> trouble....
>
> Per Johan Brandvik
> Associate prof., Arctic Environmental Technology
> University studies on Svalbard, Norway
>
0 Kudos
Message 7 of 8
(3,569 Views)