0

Suppose I have points

data = {{0,1,0},{0,0,1},{1,0,0},{0.2,0.8,0}};

And another array exists with

colours = {0.1,0.2,0.6,0.3};

I want to Plot a ListPointPlot3D of data, with colour of each point defined by colours.

I tried something like

Show[ListPointPlot3D[data], 
ColorFunction-> (ColorData["Rainbow"][#1] /@ colours)];

But was unsuccessful. Any help would be appreciated!

MKF
  • 591
  • 2
  • 10
  • 1
    Graphics3D[ {AbsolutePointSize@12, Point[data, VertexColors -> (ColorData["Rainbow"] /@ colours) ]} ] – Kuba Jan 24 '19 at 14:26
  • Let me know if the linked topic does not fit your needs. – Kuba Jan 24 '19 at 14:31
  • @Kuba thanks for the idea; is it not possible/much more difficult using ListPointPlot3D? I was hoping to retain the functionality of ListPointPlot3D... – MKF Jan 24 '19 at 14:54
  • For instance, use of BarLegends for the colours? – MKF Jan 24 '19 at 14:56
  • You can put BarLegend["Rainbow"] next to it? Inset or whatever? – Kuba Jan 24 '19 at 15:03
  • Sweet, thanks for the hint @Kuba; I got it working using Legended[Graphics[...], BarLegend[{"Rainbow", {Min[colours],Max[colours]}}]] – MKF Jan 24 '19 at 15:37

0 Answers0