LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

grayscale grid color changing

Solved!
Go to solution

Hi ,

 

I need to make this simulation of sensor network nodes energy levels . As the node energy decreases its corresponding spot on grid changes its color. I would like to plot each node on a grid defined by node's X and Y values . I also want to graphically color each node in gray -scale , so that as the energy value lowers the color dims.I have attached the representation of nodes on a gray scale grid. how acn i draw this grid and how can i periodically change its color as energy values changes.

 

 

Please, provide me with the starting point and clues 🙂

 

thanking you in advance

SDI

0 Kudos
Message 1 of 12
(3,216 Views)

Take a look at the intensity chart examples under "Help...Find Examples..."

0 Kudos
Message 2 of 12
(3,195 Views)

I have looked at the example and for a a newbie its complicated ... I have worked with simple file read and write etc.

 

I have a file in which i have  three columns

 

 

 

Xaxis            Yaxis               Energy

 

0                    0                      200

0                   1                       250

5                   3                       500

6                   3                       490

 

Now i want to plot energy value corresponding to x,y coordinates (since values are logged in in random fashion , not by an arraned array format) on Intensity chart grid

Can you please guide me with suitable blocks i should use for sorting such data ?

 

I am waiting for the help

Thanks alot

 

 

0 Kudos
Message 3 of 12
(3,173 Views)

@ssddii wrote:

I have looked at the example and for a a newbie its complicated ... I have worked with simple file read and write etc.

 

I have a file in which i have  three columns

 

 

 

Xaxis            Yaxis               Energy

 

0                    0                      200

0                   1                       250

5                   3                       500

6                   3                       490

 

Now i want to plot energy value corresponding to x,y coordinates (since values are logged in in random fashion , not by an arraned array format) on Intensity chart grid

Can you please guide me with suitable blocks i should use for sorting such data ?

 

I am waiting for the help

Thanks alot

 

 


Then look at a 3D graph. And which is it you want to do? Plotting or sorting?

0 Kudos
Message 4 of 12
(3,154 Views)

If i can directly map my energy value for each coordinate set on a 3D graph  like

 

0,0 location has corresponding energy value

 

then i dont need to sort ..


I am asking for sorting as my data is logged randomly

 

How can i plot intensity (energy value) of the x and y coordinates easily

0 Kudos
Message 5 of 12
(3,147 Views)

Sorry, but all your examples are already sorted. Do you mean you get some random x,y,z point? What do you mean by "logging data randomly"? Please post some code to show what you are trying to do.

0 Kudos
Message 6 of 12
(3,144 Views)

What i want to do is that since i get randomly logged values like


 x     y    intensity

1      1    8

1      0    4

0      0    1

0      1    3

 

I want that when i have arranged columns

 

 

0   0    1

0   1    3

1   0    4

1   1    8

so that i directly take intensity column

 

1  ----------------> corresponds to 0,0 pixel on intensity graph

3

4

8

 

 

 

and reshape my array accordingly to map

so i use reshape array of row size 2 and column size of 2 in figure

 

0 Kudos
Message 7 of 12
(3,141 Views)

So you should sort the array then. You can put each X, Y and Z values in a cluster (in that order) building an array of clusters, then use the Sort Array function on the array of clusters. Then unbundle the values and write to your intensity graph. No need to reshape.

0 Kudos
Message 8 of 12
(3,133 Views)

Bill

 

Can u show me an example code ? It would b nice of u ?

0 Kudos
Message 9 of 12
(3,129 Views)
Solution
Accepted by ssddii

Something like this:

 

sortintensity.png

 

You can substitute the constant 2D array with your data from file. I assumed X,Y,Z(energy).

Message 10 of 12
(3,125 Views)