LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D scatter plot -- controlling colors of individual points

Hi folks,

 

I need to control the individual color of points in a 3D scatter plot. The post 

 

ActiveX 3D Graph Shows Wrong Colors of Points on LabVIEW - NI

 

seems to give the direction. However, I fail to fill the 3D indicator with n 1-point plots rather than one plot with n points. See the attached vi. What am I doing wrongly?

 

Best regards,
Peter

0 Kudos
Message 1 of 6
(283 Views)

Hi Peter,
Your example differs from the example from the article.

JGoebel_0-1759181595739.png

On the for loop output tunnle, rightclick -> tunnlemode -> concatenating
This will create an array of plot-objects, rather than a single one.
These will now all have the same color. By using the propertynode for "active plot", followed by the propertynodes for the style and color palette, you can set the color palette to a single specific color for each plot. You have to make sure to set the plot ID for the plot helper and the property node.

I've attached an example that colors the dots with 10 different colors defined in a separate array.
Best, Jan

0 Kudos
Message 2 of 6
(191 Views)

I'd say you better use a shift register instead of auto-concatenating

 

why?

your sample data has N= 10, so there shall be 10 plots.

 

if you use auto-concatenating this results in  sizes = 55

alexderjuengere_1-1759241908444.png

 

alexderjuengere_0-1759241885067.png

 

if you use a shift register instead of auto-concatenating this results in  sizes = 10, as expected, therefore I prefer the shift register method

 

alexderjuengere_2-1759242004012.png

alexderjuengere_3-1759242017617.png

 

 

however, for both methods, the resulting plots look almost identical, and for a dataset with N=10 this is irrelevant.

 

attached as labview 2025 q3, as I can't back-convert, because of:

 

alexderjuengere_0-1759245251571.png

 

 

Download All
0 Kudos
Message 3 of 6
(163 Views)

Hi Alexander,
thanks a lot for your comment. You are in deed right. The Plot helper generates an array of the size of the Plot-ID you enter. That way a faculty(i) (i!) sized array is created with a lot of empty plots.

This causes the performance issues that were also mentioned in the article.
I've created a new article and example for this that runs much faster and replaced the old KnowledgeBase with it:

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA0VU0000009mjl0AA&l=en-GB

3D_Scatter_Plot.png

Best,
Jan

Message 4 of 6
(131 Views)

Thanks a lot to both, Jan and Alexander, for the given solution!

0 Kudos
Message 5 of 6
(68 Views)

Jan, hate to be "that guy" but since you JUST posted it, thought I'd point out a typo- the first line says "The points in a single plor are..."

 

Think that should be "plot" 🙂

Message 6 of 6
(65 Views)