Polar frame drawing


_ROOT Version:any


Hi all,
I’ve try to draw polar frame

#include <TGraphPolar.h>
// #include <chenxufunc/cxROOTHead.hh>
// cspell:disable

// root --web=off
void p21_polar() {
  auto* c1 = new TCanvas("c1", "c1", 300, 300, 1000, 1000);
  gStyle->SetOptStat(0);
  gStyle->SetNumberContours(100);
  double r[2] = {0, 1};                   // NOLINT
  double phi[2] = {0, 1};                 // NOLINT
  auto* g1 = new TGraphPolar(2, r, phi);  // NOLINT
  g1->SetMarkerStyle(kStar);
  g1->Draw("P");
  c1->Update();
  g1->GetPolargram();
  auto* arrow = new TArrow(0, 0, 1, 1, 0.02, "->");
  arrow->SetArrowSize(0.005);
  arrow->Draw("same");
}

It seems the arrow cannot draw on polar, how can I do it
I’d love a new function like

TCanvas::DrawPolarFrame

or some alter

The Polargram does not create a TPad in polar coordinates (like the log scales). Therefore the TArrow ignores the fact a Polargram in drawn.

so the only solution now is to convert polar coordinate by myself?

Yes you need to do the conversion yourself.

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