TParallelCoord first selection forced to blue?

ROOT Version: 6.08/06
Platform: CentOS Linux 7 (Core)


Hi all!

When adding selection highlights to a TParallelCoord plot, the first selection appears to be forced to always be blue, and the following selections are given the color of the previous selection. Example code below with the output .pdf files. Even if there is only 1 selection given, its forced to be blue.

TFile *dataFile = TFile::Open("example.root");
TTree *fitParameters = (TTree*)(dataFile->Get("fitParameters"));
TCanvas *c1 = new TCanvas("c1", "c1", 800, 600);

fitParameters->Draw("m1pps:m1pms:p1pps:p1pms:p1p0s:m1p0s", "" , "para");
 
TParallelCoord *paraTemp = 
  (TParallelCoord*)gPad->GetListOfPrimitives()->FindObject("ParaCoord");
TParallelCoordVar* leftAxis = 
  (TParallelCoordVar*)paraTemp->GetVarList()->FindObject("m1pps");

leftAxis->AddRange(new TParallelCoordRange(leftAxis,0.0,0.013));
paraTemp->AddSelection("magenta");
paraTemp->GetCurrentSelection()->SetLineColor(kMagenta);

leftAxis->AddRange(new TParallelCoordRange(leftAxis,0.05,0.07));
paraTemp->AddSelection("red");
paraTemp->GetCurrentSelection()->SetLineColor(kRed);

leftAxis->AddRange(new TParallelCoordRange(leftAxis,0.08,0.12));
paraTemp->AddSelection("orange");
paraTemp->GetCurrentSelection()->SetLineColor(kOrange);

c1->Print("temp1.pdf");

// SECOND PLOT
fitParameters->Draw("m1pms:m1pps:p1pps:p1pms:p1p0s:m1p0s", "" , "para");

TParallelCoord *para = 
  (TParallelCoord*)gPad->GetListOfPrimitives()->FindObject("ParaCoord");
TParallelCoordVar* firstaxis = 
  (TParallelCoordVar*)para->GetVarList()->FindObject("m1pms");

  
firstaxis->AddRange(new TParallelCoordRange(firstaxis,0.72,0.74));
para->AddSelection("cyan");
para->GetCurrentSelection()->SetLineColor(kCyan);
  
firstaxis->AddRange(new TParallelCoordRange(firstaxis,0.75,0.77));
para->AddSelection("green");
para->GetCurrentSelection()->SetLineColor(kGreen);

firstaxis->AddRange(new TParallelCoordRange(firstaxis,0.78,0.80));
para->AddSelection("yellow");
para->GetCurrentSelection()->SetLineColor(kYellow);
  
c1->Print("temp2.pdf");

temp1.pdf (31.6 KB)
temp2.pdf (31.5 KB)

it could be… parallel coordinates are not used a lot. Can you provide the root. file so we can run your macro ?

Sure thing, here is the macro and associated tree

paraCoord.C (1.7 KB)
seedTree.root (45.7 KB)

I see the issue, it seems I can then edit le colour interactively.
This code is very old and kind of frozen. I do not think we will spend time fixing it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.