LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to plot X Y points with different colours?

Hi,

I have been reading in this forum different ways how to plot X Y points with different colours, but unable to find a good solution for me. I want to plot GPS positions in a X Y graph with intensity colours as a function of received signal level. This will be done offline from a big log file.

 

I have understood that the change of the colour for a individual point in a plot in the XY graph is not possible. So I tested picture alternative, but noticed that I couldn't maintain the XY points in the picture, with other words, I couldn't see the measurement route for the positions.

What would be my options to plot a XY graph like picture with colour intensity for a individual point ? I can predefine range of colours.

I attach a picture for clarity what I want to do. Only thing what is missing in XY graph is colours of the plot.

 

An other minor thing is that I have not found a setting how to reset the X axis absolute time in a chart. Now the time is increased every time I run my front panel.

 

best regards,

petri

 

0 Kudos
Message 1 of 6
(4,368 Views)

Have you tried using the intensity graph directly?

 

I don't quite understand what your picture is supposed to show. The top graph shows 4 plots of different colors. The bottom one is one plot (as far as I can tell) of one color. What are we supposed to be looking at?

0 Kudos
Message 2 of 6
(4,344 Views)

 

I looked also into the intensity graph but I couldn't find a method how to plot XY coordinates with Z as an intensity information into it. I understood that intensity graph uses only Y and Z information and the X is the index for an array having values for Y and Z. 

 

Sorry, I was too unclear regarding the attached picture. The bottom graph shows the X Y positions which I want to include with an intensity information from the upper picture in respective measurement. With other words, when looking into the upper figure and e.g. white line its level varies. That variation I want to transform to intensity in XY graph on the bottom figure. For the intensity I'm thinking at least three different colours e.g. green, yellow and red, but optimum would be to have indefinete colour change from red to green via yellow. I can predefine ranges for colours .

 

best regards,

petri

    

0 Kudos
Message 3 of 6
(4,326 Views)

Let's say you need N colors: create an XYgraph with N plots, each defined with a different point color.

With a little programming, you can set the plot colors by code.

Don't use connecting lines, only points. Then organize your data points into N couples of X and Y arrays, according to the signal level.

The drawback of this simple approach is that you don't get a continuous path (as you may desire), only isolated points.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 6
(4,315 Views)

@Petri wrote:

 

I looked also into the intensity graph but I couldn't find a method how to plot XY coordinates with Z as an intensity information into it. I understood that intensity graph uses only Y and Z information and the X is the index for an array having values for Y and Z.


That's not correct. You provide a 2D array to an intensity chart/graph. The array indices refer to the X,Y coordinates. The array element value is the Z value. Thus, the element at indices 0,0 would be the Z value at X=0, Y=0.

 


Sorry, I was too unclear regarding the attached picture. The bottom graph shows the X Y positions which I want to include with an intensity information from the upper picture in respective measurement. With other words, when looking into the upper figure and e.g. white line its level varies. That variation I want to transform to intensity in XY graph on the bottom figure. For the intensity I'm thinking at least three different colours e.g. green, yellow and red, but optimum would be to have indefinete colour change from red to green via yellow. I can predefine ranges for colours .

Sorry. Still don't understand. The top graph shows time scale. The bottom does not. Also, the Y values on the bottom graph seem to bear no relation to either the X or Y scale on the top graph.

0 Kudos
Message 5 of 6
(4,300 Views)

 

OK. In my case the intensity graph indexes would be like magnitude of Y=6,49e6 and X=1,26e6. Perhaps this is not either a problem in LV... many things quite new for me when learning LV after a decade of experience in CVI 😉

 

Here is a mathematical explanation for the attached picture. Five power levels are sampled in a position X and Y at a time/date tick into a log file. Data format is dispayed as original line in attached picture. Extracted from that data, top graph shows power as a function of time/date tick for five frequencies. Bottom graph shows position X and Y at the same time/date tick for one frequency (finally I will expand this to 5 graphs each showing one frequency). I want bottom graph to show power as a function of position X and Y in that particular time/date tick and power intensity indicated with colour. Time/date tick is not interesting in bottom graph so therefore I don't have to take it account. Because log files may contain thousands of lines I process only one line in time. hope this clarifies the attached picture. 

 

best regards,

petri

 

 

 

0 Kudos
Message 6 of 6
(4,283 Views)