The function ”SetMinimum“ does not work in TGraphPolar

ROOT Version: v-22-08
Platform: ubuntu20.04

Dear experts,
The following is the code, I’d like to tune the range of Yaxis (0,1), but the function ”SetMinimum“ does not work. The attachment is the code and output.
could you please help me? Thank you very much.
huatu.C (1.0 KB)
graph

Best regards,
Jiechen

You need SetMaxRadial and SetMinRadial:

//...
  TCanvas *c1=new TCanvas("c1","c1",800,600);
//...
  TGraphPolar *gr = new TGraphPolar(N, xx, yy);
  gr->SetMarkerStyle(21);
  gr->SetMarkerColor(kBlue);
  gr->SetFillColor(kBlue);
  gr->Draw("AP");
  c1->Update();
  gr->SetMinRadial(0);
  gr->SetMaxRadial(1);

Note that first you have to draw the graph, then update the canvas (or gPad), and then change the limits (because of the way SetMin/MaxRadial are implemented in the ROOT code).

1 Like

Hi, dastudillo

It’s work, thank you.

Best regards,
Jiechen

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