148 ((px-
gPad->XtoPixel(0))<0)) ||
150 ((px-
gPad->XtoPixel(0))>0))) {
156 ((py-
gPad->YtoPixel(0))>0)) ||
158 (py-
gPad->YtoPixel(0))<0)) {
195 static Int_t d1, d2, d3, px1, py1, px3, py3;
196 static Bool_t p1, p2, p3, p4, p5, p6, p7, p8;
198 p2 = p3 = p4 = p5 = p6 = p7 = p8 =
kFALSE;
199 if (!
gPad->IsEditable())
return;
206 px2 =
gPad->XtoAbsPixel(-1);
207 py2 =
gPad->YtoAbsPixel(1);
209 px3 =
gPad->XtoAbsPixel(-1);
210 py3 =
gPad->YtoAbsPixel(-1);
218 if ( d2 < kMaxDiff) {
223 if ( d3 < kMaxDiff) {
241 px2 =
gPad->AbsPixeltoX(px);
242 py2 =
gPad->AbsPixeltoY(py);
243 if ( px2 < 0 && py2 < 0) {p2 =
kTRUE;};
244 if ( px2 < 0 && py2 > 0 ) {p3 =
kTRUE;};
245 if ( px2 > 0 && py2 > 0 ) {p4 =
kTRUE;};
246 if ( px2 > 0 && py2 < 0 ) {p5 =
kTRUE;};
280 while(angle < 0 || angle > 2*pi){
286 else if(
angle > pi/2 &&
angle < pi)
return 31;
287 else if(
angle > pi &&
angle < 3*pi/2)
return 33;
288 else if(
angle > 3*pi/2 &&
angle < 2*pi)
return 13;
289 else if(
angle == 0 ||
angle == 2*pi)
return 12;
290 else if(
angle == pi/2)
return 21;
291 else if(
angle == pi)
return 32;
292 else if(
angle == 3*pi/2)
return 23;
298 else if(
angle > 3*pi/2 &&
angle <= 2*pi)
return 12;
311 while(angle < 0 || angle > 2*pi){
350 Int_t optionpoldiv, optionraddiv;
356 if(opt.
Contains(
'P')) optionpoldiv=1;
else optionpoldiv=0;
357 if(opt.
Contains(
'R')) optionraddiv=1;
else optionraddiv=0;
391 for (i=0; i<=
n; i++) {
395 x[i] =
x1 + dx*ct - dy*st;
396 y[i] =
y1 + dx*st + dy*ct;
410 gPad->RangeAxis(-1,-1,1,1);
411 gPad->Range(-1.25,-1.25,1.25,1.25);
415 if (!
gPad->GetLogy()) {
416 for (i=0; i<ndivMajor; i++) {
438 if (rnum == 0) form.
Form(
"%d",rnum);
439 if (rnum == 1 && rden == 1) form =
"#pi";
440 if (rnum == 1 && rden != 1) form.
Form(
"#frac{#pi}{%d}",rden);
441 if (rnum != 1 && rden == 1 && i !=0) form.
Form(
"%d#pi",rnum);
442 if (rnum != 1 && rden != 1) form.
Form(
"#frac{%d#pi}{%d}",rnum,rden);
449 form.
Form(
"%5.3g",txtval);
470 if (rnum == 0) form.
Form(
"%d",rnum);
471 if (rnum == 1 && rden == 1) form =
"#pi";
472 if (rnum == 1 && rden != 1) form.
Form(
"#frac{#pi}{%d}",rden);
473 if (rnum != 1 && rden == 1 && i !=0) form.
Form(
"%d#pi",rnum);
474 if (rnum != 1 && rden != 1) form.
Form(
"#frac{%d#pi}{%d}",rnum,rden);
477 textangular.
PaintLatex(costhetas,corr+sinthetas,0,
481 form.
Form(
"%5.3g",txtval);
500 if (issettickpolar) {
512 gPad->PaintLine(0.,0.,costheta,sintheta);
517 for (j=1; j<ndivMinor; j++) {
531 for (i=1; i<=
test; i++) {
532 Double_t txtval = pow((
double)10,(
double)(i-1));
551 form.
Form(
"%5.3g",txtval);
568 form.
Form(
"%5.3g",txtval);
586 if (issettickpolar) {
598 gPad->PaintLine(0.,0.,costheta,sintheta);
607 for (j=1; j<9; j++) {
624 static char chopt[8] =
"";
627 Int_t ndivMajor = ndiv%100;
628 Int_t ndivMinor = ndiv/100;
630 Double_t frwrmin = 0., frwrmax = 0., binWidth = 0;
633 frwrmax, ndivmajor,binWidth,
"");
636 if (!
gPad->GetLogx()) {
637 gPad->RangeAxis(-1,-1,1,1);
638 gPad->Range(-1.25,-1.25,1.25,1.25);
643 Double_t dist = (rmajmax-rmajmin)/ndivmajor;
647 strncat(chopt,
"SDH", 4);
648 if (
fNdivRad < 0) strncat(chopt,
"N",2);
657 umin, umax, ndiv, chopt, 0.,
kFALSE);
665 Double_t frwrmini = 0., frwrmaxi = 0., binWidth2 =0;
667 frwrmaxi, ndivminor,binWidth2,
"");
670 for (i=1; i<=ndivmajor+2; i++) {
678 for (j=1; j<ndivminor+1; j++) {
679 if (rmajmin+j*dist2<=1)
PaintCircle(0.,0.,rmajmin+j*dist2,0.,360,0);
687 for (i=1; i<=ndivMajor; i++) {
694 for (j=1; j<ndivMinor; j++) {
697 PaintCircle(0.,0.,rmaj- j*1./(ndivMajor*ndivMinor),0.,360,0);
709 for (i=1; i<=
test; i++) {
721 for (j=1; j<9; j++) {
748 for (i=j; i > 1; i--) {
749 if ((
a % i == 0) && (
b % i == 0)) {
const Int_t kMaxPixel
Max value for an int.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint angle
Option_t Option_t TPoint TPoint const char y1
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Style_t GetLineStyle() const
Return the line style.
virtual void Modify()
Change current line attributes if necessary.
Style_t fLineStyle
Line style.
Int_t DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
Compute distance from point px,py to a line.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
virtual void PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t &wmin, Double_t &wmax, Int_t &ndiv, Option_t *chopt="", Double_t gridlength=0, Bool_t drawGridOnly=kFALSE)
Control function to draw an axis.
void SetLabelFont(Int_t labelfont)
void SetLabelOffset(Float_t labeloffset)
void SetLabelColor(Int_t labelcolor)
void SetLabelSize(Float_t labelsize)
void LabelsLimits(const char *label, Int_t &first, Int_t &last)
Internal method to find first and last character of a label.
Double_t fRwrmin
Minimal radial value (real world)
void ReduceFraction(Int_t Num, Int_t Denom, Int_t &rnum, Int_t &rden)
Reduce fractions.
Double_t GetPolarLabelSize()
Color_t fRadialLabelColor
Set color of the radial labels.
void SetPolarLabelColor(Color_t tcolorangular=1)
Set Polar labels color.
void PaintPolarDivisions(Bool_t noLabels)
Draw Polar divisions.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Everything within the circle belongs to the TGraphPolargram.
void SetRangePolar(Double_t tmin, Double_t tmax)
Allows to change range Polar.
Double_t fPolarTextSize
Set Polar text size.
Double_t fRwtmin
Minimal angular value (real world)
Double_t GetRadialOffset()
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Indicate that there is something to click here.
void Init()
Initialize some of the fields of TGraphPolargram.
Double_t GetTickpolarSize()
void SetPolarOffset(Double_t PolarOffset=0.04)
Set the labels offset.
void SetTwoPi()
Set range from 0 to 2*pi.
Double_t FindTextAngle(Double_t theta)
Determine the orientation of the polar labels according to their angle.
void SetRadialLabelColor(Color_t tcolorradial=1)
Set radial labels color.
void PaintCircle(Double_t x, Double_t y, Double_t r, Double_t phimin, Double_t phimax, Double_t theta)
This is simplified from TEllipse::PaintEllipse.
virtual ~TGraphPolargram()
TGraphPolargram destructor.
void SetRangeRadial(Double_t rmin, Double_t rmax)
Set the radial range.
void SetTickpolarSize(Double_t tickpolarsize=0.02)
Set polar ticks size.
void SetAxisAngle(Double_t angle=0)
Set axis angle.
void SetToDegree()
The Polar circle is labelled using degree.
void SetNdivPolar(Int_t Ndiv=508)
Set the number of Polar divisions: enter a number ij with 0<i<99 and 0<j<99.
Int_t fNdivRad
Number of radial divisions.
Font_t GetPolarLabelFont()
void Draw(Option_t *options="") override
Draw Polargram.
Double_t fTickpolarSize
Set size of Tickmarks.
void SetRadialLabelSize(Double_t radialsize=0.035)
Set radial labels size.
Font_t fPolarLabelFont
Set font of angular labels.
TString * fPolarLabels
! [fNdivPol] Specified polar labels
void PaintRadialDivisions(Bool_t drawaxis)
Paint radial divisions.
void SetToGrad()
The Polar circle is labelled using gradian.
void ChangeRangePolar(Double_t tmin, Double_t tmax)
Set the Polar range.
void SetPolarLabelSize(Double_t angularsize=0.04)
Set angular labels size.
void SetRadialLabelFont(Font_t tfontradial=62)
Set radial label font.
Double_t fAxisAngle
Set angle of the radial axis.
void SetToRadian()
The Polar circle is labelled using radian.
Double_t fRwtmax
Minimal angular value (real world)
Double_t fRwrmax
Maximal radial value (real world)
void SetPolarLabel(Int_t div, const TString &label)
Set some specified polar labels, used in the case of a spider plot.
TGraphPolargram(const char *name, Double_t rmin, Double_t rmax, Double_t tmin, Double_t tmax)
TGraphPolargram Constructor.
Font_t fRadialLabelFont
Set font of radial labels.
Int_t fNdivPol
Number of polar divisions.
Font_t GetRadialLabelFont()
Int_t fCutRadial
if fCutRadial = 0, circles are cut by radial axis if fCutRadial = 1, circles are not cut
Color_t fPolarLabelColor
Set color of the angular labels.
Double_t fPolarOffset
Offset for Polar labels.
void Paint(Option_t *options="") override
Paint TGraphPolargram.
void SetPolarLabelFont(Font_t tfontangular=62)
void SetRadialOffset(Double_t RadialOffset=0.025)
Set the labels offset.
Color_t GetRadialColorLabel()
Int_t FindAlign(Double_t angle)
Find the alignement rule to apply for TText::SetTextAlign(Short_t).
void SetNdivRadial(Int_t Ndiv=508)
Set the number of radial divisions: enter a number ij with 0<i<99 and 0<j<99.
Double_t GetRadialLabelSize()
Color_t GetPolarColorLabel()
Double_t fRadialOffset
Offset for radial labels.
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
Static function to compute reasonable axis limits.
To draw Mathematical Formula.
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Main drawing function.
The TNamed class is the base class for all named ROOT classes.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
const char * Data() const
void ToUpper()
Change string to upper case.
TString & Remove(Ssiz_t pos)
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void PaintText(Double_t x, Double_t y, const char *text)
Draw this text with new coordinates.
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Double_t ASin(Double_t)
Returns the principal value of the arc sine of x, expressed in radians.
constexpr Double_t PiOver2()
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.