LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to draw thousands of symbols in XY graph?

Solved!
Go to solution

Hello,

I would need to help with a part of code, where I need to draw hundreds or possibly thousands of various symbols in XY coordinates. I guess the XY graph is the most suitable for it. However I have troubles there with execution time - it last forever to complete drawings of all plottes.

I need to plot every XY pair as one plot because its symbol may vary based on some external conditions (in the current VI all symbols are circles). I have attached the VI to this post, it is only simplified version of the code but the problem is the same. 

Is there any better method how to draw the required symbols into graph? I have also tried Advanced Plotting Toolkit addon, which works perfectly there but I am persuaded that there must be an option for Labview standard graphs as well. (example of the toolkit graph is also attached to this post).

Thank you a lot!

Lukas

Download All
0 Kudos
Message 1 of 7
(2,744 Views)
Solution
Accepted by topic author lukas.maliar

You can improve the speed by using Defer Panel Updates property node.

Set it to TRUE before graph's update, then update graph and set back to FALSE.

http://zone.ni.com/reference/en-XX/help/371361R-01/lvprop/pnl_defer_pnl_updts/

 

Message 2 of 7
(2,726 Views)

Also, you can do the coloring properties once for all plots if they are static. In your example they are all black, so set the properties for say 1000 plots once, and those properties will be saved with the graph. No need to do it in runtime at all.

Certified LabVIEW Architect
0 Kudos
Message 3 of 7
(2,676 Views)

Thank you a lot Andrey! That way it really works much better and faster.

The only problem that remains is ability to edit properties of the graph in front panel in edit mode. I mean once you fill the graph with the data and finish the execution, whole front panel becomes very laggy (e.g. while you try move the panel's controls). This can be solved by either manually or programmatically clearing the graph after the execution has finished. Anyway, this is not a problem for graphs from mentioned free Advanced Plotting Toolkit.

I have attached updated VI with 'defer panel updates' option, hopefully I have used it the right way.

 

And for thols, thank you for your suggestion however I consider also the color change for every plot separately because it could help to recognize different symbols faster if they are of different color as well. 

0 Kudos
Message 4 of 7
(2,664 Views)

The number of plots is the culprit here. If you could split it into one plot per color/property, then it would be faster. I tried using just one plot for all data and its super-responsive. So try minimizing he number of plots.

Certified LabVIEW Architect
Message 5 of 7
(2,657 Views)

You are right, I will consider this option once I finish the code for assigning symbols to the array members. There will be roughly 5 possible symbols to be plotted so it would mean only 5 plots are required as minimum.

0 Kudos
Message 6 of 7
(2,653 Views)

A much more efficient way would be to use an intensity graph of a fixed sized array. The datatype would be U8 integer. Given a suitable Z color ramp, you can now replace elements at each location with a suitable color index.

 

What xy resolution do you need?

 

Now the entire operation is in-place with a fixed amount of memory.

 

Your VI did not include any typical data. Once you attach a VI with some real data, I can better show you how.

0 Kudos
Message 7 of 7
(2,473 Views)