Colouring a TParallelCoordVar in a TParallelCoordRange?

Aye folks,

Is is possible to select a TParallelCoordVar and colour its values within a particular range?

So far, I’ve a wee piece of code to select a variable and range I’m interested in; but I failed to highlight this region on the TParallelCoord plot.
On the contrary, if I use the gui and move the markers on the selected variables axis, I get the range highlighted?

I do the following:

Regards,

Colin.

 _par = new TParallelCoord(tree1, n_data);

_par->AddVariable("isac");
 _par->AddVariable("theta_tr");
 _par->AddVariable("theta_phi");
 _par->AddVariable("phi_tr");

 TCanvas *c1 = new TCanvas("c1");
  c1->Divide(1);
 c1->cd(1);

  TParallelCoordVar *var1 =  (TParallelCoordVar*)_par->GetVarList()->FindObject("isac");
  TParallelCoordRange *range1 = new TParallelCoordRange(var1,-0.8,-1.0000); 
  var1->AddRange( range1 );
   _par->AddSelection("less0");
  _par->GetCurrentSelection()->SetLineColor(38);
  _par->GetCurrentSelection()->SetActivated(true);
  _par->GetCurrentSelection()->SetShowRanges(true);
  
  par->Draw("same");
  c1->Print(outfile);

Did you look at $ROOTSYS/tutorials/tree/parallelcoord.C ? it does exacty that.

Hiya,

Thanks. I’ve had a look at the mentioned tutorial. For me, I still seem to have problems. Perhaps this is a result of the way I create and assign attributes to the TParallelCoord object: in the tutorial, use is made of an NTuple object to do this, however I’m not using this object. I’ll look over my code again.

Thanks for the advice,

Colin.

I see you are creating the ||-Coord yourself … that is more painful than using an ntuple or tree… I would recommend that you put your data in a ntuple or tree and then you draw it with option PARA.

Is there any reason why you do not want to use an ntuple ?

If yes, please send me a running example of what you are doing and I will investigate.

Hi,

I agree. Creating your own TParallelCoord object is difficult in terms of getting the global scaling and selection of attributes working. I’ve quickly converted my code to using a TNtuple.

Regards,

Colin.

p.s. I used a TParrelCoord object - rather than a TNtuple - as this was my initial coding thought.

Yes ||-Coords in root are meant to be use via ntuple because, in any case, you need a data set to play with ||-Coord and using ntuple/tree allows to benefit from all the ntuple/tree power. In particular you can draw not only variables but expressions of variables.