RootTalk


ROOT Discussion Forums

Increase division of colour bar in TGraph2D  SOLVED

Discuss installing and running ROOT here. Please post bug reports here.

Moderator: rootdev

Increase division of colour bar in TGraph2D

Unread postby anushree » Fri Jul 19, 2013 10:44

Hii ROOTers,
I am trying to plot contours/oscillogram using TGraph2D. I have attached the data file. In the file there are three columns : x,y,z. I have plotted contours in xy plane for different values of z. The code is following:
Code: Select all
       TGraph2D *gr = new TGraph2D();
   double prob_calc_diff,E,cos;
   ifstream file1;
   file1.open("prob_2d.dat");
   int a=0;
   for(int i=0;i<100;i++)
   {
      for(int j=0;j<100;j++)
      {
         file1>>cos>>E>>prob_calc_diff;
         gr->SetPoint(a,cos,E,prob_calc_diff);
         a++;
      }
   }
   //gStyle->SetPalette(1);
      gr->Draw("cont4z");

The questions are:
1) How can I increase the divisions in the colour bar?
2) In the manual it is written that " This software cannot be guaranteed to work
under all circumstances. It was originally written to work with a few hundred points in an XY space with similar X and Y ranges."
In this case, since the x range(-1 to 0) and y range(1 to 10) are not same, is there any possibility of getting wrong result?

Thanks in advance :)..
Attachments
prob_2d.dat
(217.68 KiB) Downloaded 4 times
anushree
 
Posts: 8
Joined: Sun Jul 11, 2010 6:58

Re: Increase division of colour bar in TGraph2D  SOLVED

Unread postby couet » Fri Jul 19, 2013 13:55

2) In the manual it is written that " This software cannot be guaranteed to work
under all circumstances. It was originally written to work with a few hundred points in an XY space with similar X and Y ranges."
In this case, since the x range(-1 to 0) and y range(1 to 10) are not same, is there any possibility of getting wrong result?


should be fine...
couet
 
Posts: 4650
Joined: Tue Sep 02, 2003 8:32
Location: CERN

Re: Increase division of colour bar in TGraph2D

Unread postby couet » Fri Jul 19, 2013 13:58

1) How can I increase the divisions in the colour bar?


see:

http://root.cern.ch/drupal/content/how- ... or-palette
couet
 
Posts: 4650
Joined: Tue Sep 02, 2003 8:32
Location: CERN

Re: Increase division of colour bar in TGraph2D

Unread postby anushree » Mon Jul 22, 2013 8:52

Thanks a lot ! :)
anushree
 
Posts: 8
Joined: Sun Jul 11, 2010 6:58


Return to ROOT Support

Who is online

Users browsing this forum: Bing [Bot] and 3 guests