Hi Jonathan, see two possible solutions in the script below: Rene Brun { gROOT->Reset(); TCanvas *c1 = new TCanvas("c1","c1",700,900); c1->Divide(1,2); c1->cd(1); TFile f("hsimple.root"); //file produced by tutorial hsimple.C TNtuple *ntuple = (TNtuple*)f.Get("ntuple"); //solution 1: use a scatter plot with different colors //corresponding to one variable (here i%8) TString cut = "i%8=="; ntuple->SetMarkerColor(1); for (Int_t col=1;col<8;col++) { ntuple->SetMarkerColor(col); TString selection=cut+col; if (col==1) ntuple->Draw("px:py:pz",selection); else ntuple->Draw("px:py:pz",selection,"same"); } //solution 2: use a surface plot using the 4th dimension //as the weight for each cell in the 3-d histogram c1->cd(2); ntuple->SetFillColor(38); ntuple->Draw("px:py:pz","random","iso"); } > Johnathan Wang wrote: > > Hi, I have a dataset of x, y, z, val, something like > > 1 1 1 5 > > 2 2 2 6 > > 3 3 3 7 > > where val is actually a function of of x, y, z, so val = f (x, y, z). > > how does one generate a 3-dim surface plot in root with this data (3 physical > dim with the 4th dim being represented by color). > > i know how to do this in paw where one can just create a ntuple, read the > dataset in, and plot the ntuple. But I can't quite figure out how to do the > equivalent in root. > > Any help is appreciated, > > john
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET