Here is my plot and my source code, the points are generated by gRandom and the data will be just like it (the data is not available now).
void plot() {
TCanvas *cvs = new TCanvas("cvs", "", 800, 600);
gStyle->SetCanvasColor(0);
gStyle->SetMarkerStyle(7);
Int_t palette[5];
palette[0] = 19;
palette[1] = 46;
palette[2] = 6;
palette[3] = 30;
palette[4] = 38;
gStyle->SetPalette(5,palette);
TNtuple *n = new TNtuple("n", "n", "x:y:z:color");
for (Int_t i = 0; i < 10000; i++) {
Float_t x, y, z;
x=gRandom->Gaus(0, 10);
y=gRandom->Gaus(0, 10);
z=gRandom->Gaus(0, 10);
n->Fill(x, y, z, setcolor(x, y, z));
}
for (Int_t i = 0; i < 3000; i++) {
Float_t x, y, z;
x=gRandom->Uniform(-40, 40);
y=gRandom->Uniform(-40, 40);
z=gRandom->Uniform(-40, 40);
n->Fill(x, y, z, setcolor(x, y, z));
}
for (Int_t i = 0; i < 3000; i++) {
Float_t x, y, z;
x=gRandom->Gaus(0, 10);
y=gRandom->Gaus(0, 10);
z=gRandom->Uniform(-40, 40);
n->Fill(x, y, z, setcolor(x, y, z));
n->Fill(x, z, y, setcolor(x, z, y));
n->Fill(z, y, x, setcolor(z, y, x));
}
n->Draw("x:y:z:color");
}
Int_t setcolor(Float_t x, Float_t y, Float_t z){
Int_t color = 10;
if (abs(x)<10 && abs(y)<10 && abs(z)<10) color = 50;
if ((abs(x)>20 && abs(x)<40 && abs(y)<10 && abs(z)<10)||
(abs(y)>20 && abs(y)<40 && abs(x)<10 && abs(z)<10)||
(abs(z)>20 && abs(z)<40 && abs(x)<10 && abs(y)<10))
color = 40;
if ((abs(x)>20 && abs(x)<40 && abs(y)>20 && abs(y)<40 && abs(z)<10)||
(abs(y)>20 && abs(y)<40 && abs(z)>20 && abs(z)<40 && abs(x)<10)||
(abs(z)>20 && abs(z)<40 && abs(x)>20 && abs(x)<40 && abs(y)<10))
color = 30;
if (abs(x)>20 && abs(x)<40 &&
abs(y)>20 && abs(y)<40 &&
abs(z)>20 && abs(z)<40)
color = 20;
return color;
}
I was working on the palette but it looks like a mess, while it’s pretty good on the x-y (or other projection) plane. Maybe it’s not a good idea to do this in a 3-d plot.