692 if (
gPad->GetLogx()) {
693 for (
Int_t i = 0; i < npoints; i++) {
697 for (
Int_t i = 0; i < npoints; i++)
700 if (!opt &&
gPad->GetLogy()) {
701 for (
Int_t i = 0; i < npoints; i++) {
705 for (
Int_t i = 0; i < npoints; i++)
724 if (distance <= 5)
return distance;
728 const Int_t big = 9999;
729 const Int_t kMaxDiff = 10;
739 theX = theGraphPolar->
GetXpol();
740 theY = theGraphPolar->
GetYpol();
742 theX = theGraph->
GetX();
743 theY = theGraph->
GetY();
747 for (i=0;i<theNpoints;i++) {
748 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
749 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
759 if (distance < kMaxDiff)
return distance;
761 for (i=0;i<theNpoints-1;i++) {
764 if (
d < distance) distance =
d;
779 TIter next(functions);
781 if (
f->InheritsFrom(
TF1::Class())) distance =
f->DistancetoPrimitive(-px,py);
782 else distance =
f->DistancetoPrimitive(px,py);
783 if (distance < kMaxDiff) {
784 gPad->SetSelected(
f);
800 Error(
"DrawPanel",
"need to draw graph first");
805 gROOT->ProcessLine(
TString::Format(
"((TCanvas*)0x%zx)->Selected((TVirtualPad*)0x%zx,(TObject*)0x%zx,1)",
806 (
size_t)
gPad->GetCanvas(), (
size_t)
gPad, (
size_t)theGraph));
828 const Int_t kMaxDiff = 10;
829 static Bool_t middle, badcase;
830 static Int_t ipoint, pxp, pyp;
831 static Int_t px1,px2,py1,py2;
832 static Int_t pxold, pyold, px1old, py1old, px2old, py2old;
833 static Int_t dpx, dpy;
834 static std::vector<Int_t>
x,
y;
841 if (!
gPad->IsEditable())
return;
851 theGraph->TAttLine::Modify();
852 px1 =
gPad->XtoAbsPixel(
gPad->GetX1());
853 py1 =
gPad->YtoAbsPixel(
gPad->GetY1());
854 px2 =
gPad->XtoAbsPixel(
gPad->GetX2());
855 py2 =
gPad->YtoAbsPixel(
gPad->GetY2());
859 if (!
x.empty() || !
y.empty())
break;
860 x.resize(theNpoints+1);
861 y.resize(theNpoints+1);
862 for (i=0;i<theNpoints;i++) {
863 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
864 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
865 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
871 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
872 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
873 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
874 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
879 if (
d < kMaxDiff) ipoint =i;
885 if (ipoint < 0)
return;
889 px2old =
gPad->XtoAbsPixel(theX[1]);
890 py2old =
gPad->YtoAbsPixel(theY[1]);
891 }
else if (ipoint == theNpoints-1) {
892 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[theNpoints-2]));
893 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[theNpoints-2]));
897 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint-1]));
898 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint-1]));
899 px2old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint+1]));
900 py2old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint+1]));
902 pxold =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint]));
903 pyold =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint]));
911 for (i=0;i<theNpoints;i++) {
912 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
913 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
915 if (
d < kMaxDiff) middle =
kFALSE;
927 for(i=0;i<theNpoints-1;i++) {
928 gVirtualX->DrawLine(
x[i]+dpx,
y[i]+dpy,
x[i+1]+dpx,
y[i+1]+dpy);
931 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
932 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
933 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
934 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
935 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
936 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
938 pxp =
x[theNpoints-1]+dpx;
939 pyp =
y[theNpoints-1]+dpy;
940 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
941 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
942 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
943 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
948 for(i=0;i<theNpoints-1;i++) {
949 gVirtualX->DrawLine(
x[i]+dpx,
y[i]+dpy,
x[i+1]+dpx,
y[i+1]+dpy);
952 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
953 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
954 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
955 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
956 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
957 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
959 pxp =
x[theNpoints-1]+dpx;
960 pyp =
y[theNpoints-1]+dpy;
961 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
962 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
963 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
964 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
966 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
967 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
968 gVirtualX->DrawLine(pxold-4, pyold-4, pxold+4, pyold-4);
969 gVirtualX->DrawLine(pxold+4, pyold-4, pxold+4, pyold+4);
970 gVirtualX->DrawLine(pxold+4, pyold+4, pxold-4, pyold+4);
971 gVirtualX->DrawLine(pxold-4, pyold+4, pxold-4, pyold-4);
978 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
979 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
980 gVirtualX->DrawLine(pxold-4, pyold-4, pxold+4, pyold-4);
981 gVirtualX->DrawLine(pxold+4, pyold-4, pxold+4, pyold+4);
982 gVirtualX->DrawLine(pxold+4, pyold+4, pxold-4, pyold+4);
983 gVirtualX->DrawLine(pxold-4, pyold+4, pxold-4, pyold-4);
992 dxr = dx/(1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
993 dyr = dy/(1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
1009 for(i=0;i<theNpoints;i++) {
1010 if (badcase)
continue;
1011 if (!
x.empty()) theX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(
x[i]+dpx));
1012 if (!
y.empty()) theY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i]+dpy));
1021 theX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
1022 theY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));
1026 theX[theNpoints-1] = theX[0];
1027 theY[theNpoints-1] = theY[0];
1029 if (ipoint == theNpoints-1) {
1030 theX[0] = theX[theNpoints-1];
1031 theY[0] = theY[theNpoints-1];
1043 if (
gROOT->IsEscaped()) {
1057 dxr = dx/(1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
1058 dyr = dy/(1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
1064 ymin - dyr*
gPad->GetBottomMargin(),
1070 for(i=0;i<theNpoints;i++) {
1071 if (badcase)
continue;
1072 if (!
x.empty()) theX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(
x[i]+dpx));
1073 if (!
y.empty()) theY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i]+dpy));
1076 theX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
1077 theY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));
1081 theX[theNpoints-1] = theX[0];
1082 theY[theNpoints-1] = theY[0];
1084 if (ipoint == theNpoints-1) {
1085 theX[0] = theX[theNpoints-1];
1086 theY[0] = theY[theNpoints-1];
1140 const Int_t kHighlightRange = 50;
1141 static Int_t distanceOld = kHighlightRange;
1144 if ((distance < kHighlightRange) && (distance < distanceOld)) {
1182 if (
gPad->GetLogx()) {
1186 if (
gPad->GetLogy()) {
1190 if ((hx < uxmin) || (hx > uxmax))
return;
1191 if ((hy < uymin) || (hy > uymax))
return;
1215 strlcpy(chopt,
option,80);
1218 char *l1 = strstr(chopt,
"pfc");
1219 char *l2 = strstr(chopt,
"plc");
1220 char *l3 = strstr(chopt,
"pmc");
1221 if (l1 || l2 || l3) {
1230 char *l4 = strstr(chopt,
"rx");
1231 char *l5 = strstr(chopt,
"ry");
1265 TIter next(functions);
1273 if (palette) palette->
Paint();
1287 gPad->PushSelectableObject(theGraph);
1289 Int_t optionLine , optionAxis , optionCurve , optionStar , optionMark;
1290 Int_t optionBar , optionR , optionOne , optionE;
1291 Int_t optionFill , optionZ , optionCurveFill, optionIAxis;
1292 Int_t i, npt, nloop;
1295 Double_t barxmin, barxmax, barymin, barymax;
1302 Error(
"PaintGraph",
"illegal number of points (%d)", npoints);
1309 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1310 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1311 if (opt.
Contains(
"C")) optionCurve = 1;
else optionCurve = 0;
1312 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1313 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1314 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1315 if (opt.
Contains(
"R")) optionR = 1;
else optionR = 0;
1316 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1317 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1318 if (opt.
Contains(
"I")) optionIAxis = 1;
else optionIAxis = 0;
1324 if (optionLine+optionFill+optionCurve+optionStar+optionMark+optionBar+optionE == 0) {
1325 if (!chopt[0]) optionLine=1;
1331 optionCurveFill = 0;
1332 if (optionCurve && optionFill) {
1333 optionCurveFill = 1;
1338 Double_t rwxmin,rwxmax, rwymin, rwymax, maximum, minimum, dx, dy;
1341 rwxmin =
gPad->GetUxmin();
1342 rwxmax =
gPad->GetUxmax();
1343 rwymin =
gPad->GetUymin();
1344 rwymax =
gPad->GetUymax();
1347 if (minimum == -1111) {
1351 if (maximum == -1111) {
1355 uxmin =
gPad->PadtoX(rwxmin);
1356 uxmax =
gPad->PadtoX(rwxmax);
1359 theGraph->
ComputeRange(rwxmin, rwymin, rwxmax, rwymax);
1361 if (rwxmin == rwxmax) rwxmax += 1.;
1362 if (rwymin == rwymax) rwymax += 1.;
1363 dx = 0.1*(rwxmax-rwxmin);
1364 dy = 0.1*(rwymax-rwymin);
1365 uxmin = rwxmin - dx;
1366 uxmax = rwxmax + dx;
1367 minimum = rwymin - dy;
1368 maximum = rwymax + dy;
1372 if (uxmin < 0 && rwxmin >= 0) uxmin = 0.9*rwxmin;
1373 if (uxmax > 0 && rwxmax <= 0) {
1374 if (
gPad->GetLogx()) uxmax = 1.1*rwxmax;
1377 if (minimum < 0 && rwymin >= 0) minimum = 0.9*rwymin;
1378 if (maximum > 0 && rwymax <= 0) {
1382 if (minimum <= 0 && gPad->GetLogy()) minimum = 0.001*maximum;
1383 if (uxmin <= 0 && gPad->GetLogx()) {
1384 if (uxmax > 1000) uxmin = 1;
1385 else uxmin = 0.001*uxmax;
1392 char chopth[8] =
" ";
1393 if (strstr(chopt,
"x+")) strncat(chopth,
"x+",3);
1394 if (strstr(chopt,
"y+")) strncat(chopth,
"y+",3);
1395 if (optionIAxis) strncat(chopth,
"A",2);
1402 if (theNpoints > npt) npt = theNpoints;
1414 if (
gPad->GetLogy()) {
1427 rwxmin =
gPad->GetUxmin();
1428 rwxmax =
gPad->GetUxmax();
1429 rwymin =
gPad->GetUymin();
1430 rwymax =
gPad->GetUymax();
1431 uxmin =
gPad->PadtoX(rwxmin);
1432 uxmax =
gPad->PadtoX(rwxmax);
1437 maximum =
gPad->PadtoY(rwymax);
1438 minimum =
gPad->PadtoY(rwymin);
1442 theGraph->TAttLine::Modify();
1443 theGraph->TAttFill::Modify();
1444 theGraph->TAttMarker::Modify();
1447 gxwork.resize(2*npoints+10);
1448 gywork.resize(2*npoints+10);
1452 if (optionLine || optionFill) {
1458 if (optionFill && (xn !=
x1 || yn !=
y1)) nloop++;
1460 for (i=1;i<=nloop;i++) {
1503 if (optionCurveFill) {
1505 if (xn !=
x1 || yn !=
y1) nloop++;
1509 for (i=1;i<=nloop;i++) {
1534 for (i=1;i<=nloop;i++) {
1538 if (
y[i-1] < minimum ||
y[i-1] > maximum)
continue;
1539 if (
x[i-1] < uxmin ||
x[i-1] > uxmax)
continue;
1565 for (i=1;i<=npoints;i++) {
1580 for (i=1;i<=npoints;i++) {
1595 if(FillSave ==
gPad->GetFrameFillColor()) {
1597 if (
gPad->GetFrameFillColor()==1) {
1599 theGraph->TAttFill::Modify();
1602 theGraph->TAttFill::Modify();
1608 for (i=1;i<npoints;i++) {
1609 if (
x[i] < barxmin) barxmin =
x[i];
1610 if (
x[i] > barxmax) barxmax =
x[i];
1612 bdelta = (barxmax-barxmin)/
Double_t(npoints);
1616 for (i=1;i<npoints;i++) {
1617 if (
y[i] < barymin) barymin =
y[i];
1618 if (
y[i] > barymax) barymax =
y[i];
1620 bdelta = (barymax-barymin)/
Double_t(npoints);
1624 for (i=1;i<=npoints;i++) {
1625 xlow =
x[i-1] - dbar;
1626 xhigh =
x[i-1] + dbar;
1628 if (xlow < uxmin && xhigh < uxmin)
continue;
1629 if (xhigh > uxmax && xlow > uxmax)
continue;
1630 if (xlow < uxmin) xlow = uxmin;
1631 if (xhigh > uxmax) xhigh = uxmax;
1633 else ylow =
gPad->GetUymin();
1647 for (i=1;i<=npoints;i++) {
1649 ylow =
y[i-1] - dbar;
1650 yhigh =
y[i-1] + dbar;
1661 theGraph->TAttFill::Modify();
1705 const char *where =
"PaintGrapHist";
1707 Int_t optionLine , optionAxis , optionCurve, optionStar, optionMark;
1708 Int_t optionBar , optionRot , optionOne , optionOff ;
1709 Int_t optionFill , optionZ;
1710 Int_t optionHist , optionBins , optionMarker;
1712 Int_t drawtype=0, drawborder, drawbordersav;
1718 Double_t xi, xi1, xj, xj1, yi1, yi, yj, yj1, xwmin, ywmin;
1722 char choptaxis[10] =
" ";
1725 Error(where,
"illegal number of points (%d)", npoints);
1730 if (opt.
Contains(
"H")) optionHist = 1;
else optionHist = 0;
1731 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1732 if (opt.
Contains(
"C")) optionCurve= 1;
else optionCurve= 0;
1733 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1734 if (opt.
Contains(
"R")) optionRot = 1;
else optionRot = 0;
1735 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1736 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1737 if (opt.
Contains(
"N")) optionBins = 1;
else optionBins = 0;
1738 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1739 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1740 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1741 if (opt.
Contains(
"][")) optionOff = 1;
else optionOff = 0;
1742 if (opt.
Contains(
"P0")) optionMark = 10;
1744 Int_t optionFill2 = 0;
1746 optionFill = 0; optionFill2 = 1;
1761 nbins = last -
first + 1;
1773 Double_t rounding = (uxmax-uxmin)*1.e-5;
1776 Int_t nx1, nx2, ndivx, ndivy, ndiv;
1789 if (ndivx < 0) strlcat(choptaxis,
"N",10);
1790 if (
gPad->GetGridx()) {
1792 strlcat(choptaxis,
"W",10);
1794 if (
gPad->GetLogx()) {
1798 strlcat(choptaxis,
"G",10);
1808 axis.
PaintAxis(rwxmin,rwymin,rwxmax,rwymin,rwmin,rwmax,ndiv,choptaxis);
1818 strlcat(choptaxis,
"N",10);
1821 if (
gPad->GetGridy()) {
1823 strlcat(choptaxis,
"W",10);
1825 if (
gPad->GetLogy()) {
1829 strlcat(choptaxis,
"G",10);
1838 axis.
PaintAxis(rwxmin,rwymin,rwxmin,rwymax,rwmin,rwmax,ndiv,choptaxis);
1843 theGraph->TAttLine::Modify();
1844 theGraph->TAttFill::Modify();
1845 theGraph->TAttMarker::Modify();
1854 Int_t fwidth =
gPad->GetFrameLineWidth();
1857 if (optionOff) fwidth = 1;
1868 gxwork.resize(2*npoints+10);
1869 gywork.resize(2*npoints+10);
1873 if (optionFill && !optionCurve) {
1881 for (j=
first; j<=last;j++) {
1888 xj1 =
x[j]; xj =
x[j-1];
1890 if (j != last)
Error(where,
"X must be in increasing order");
1891 else Error(where,
"X must have N+1 values with option N");
1899 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1900 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1913 if (!fillarea)
gyworkl[0] = ylast;
1924 for (j=
first; j<=last;j++) {
1929 yj1 =
y[j]; yj =
y[j-1];
1931 if (j != last)
Error(where,
"Y must be in increasing order");
1932 else Error(where,
"Y must have N+1 values with option N");
1938 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1939 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1946 if (!fillarea)
gyworkl[0] = ylast;
1953 theGraph->TAttLine::Modify();
1954 theGraph->TAttFill::Modify();
1959 if ((optionHist) || !chopt[0]) {
1967 for (i=
first; i<=last;i++) {
1972 xi1 =
x[i]; xi =
x[i-1];
1974 if (i != last)
Error(where,
"X must be in increasing order");
1975 else Error(where,
"X must have N+1 values with option N");
1983 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1984 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1996 Int_t nbpoints = npt-2;
2002 for (ip=point1; ip<=nbpoints; ip++) {
2009 Int_t point2 = nbpoints;
2010 for (ip=point2; ip>=point1; ip--) {
2016 nbpoints = point2-point1+1;
2020 if (
gxwork[0] >
gPad->GetUxmin()) { nbpoints++; point1 = 0; }
2021 if (
gxwork[nbpoints] <
gPad->GetUxmax()) nbpoints++;
2024 gPad->PaintPolyLine(nbpoints,
gxworkl.data() + point1,
gyworkl.data() + point1, noClip);
2034 for (i=
first; i<=last;i++) {
2039 yi1 =
y[i]; yi =
y[i-1];
2041 if (i != last)
Error(where,
"Y must be in increasing order");
2042 else Error(where,
"Y must have N+1 values with option N");
2048 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
2049 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
2068 if (!optionOne) drawtype = 2;
2073 for (i=
first; i<=last;i++) {
2078 xi1 =
x[i]; xi =
x[i-1];
2080 if (i != last)
Error(where,
"X must be in increasing order");
2081 else Error(where,
"X must have N+1 values with option N");
2084 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2115 drawtype = drawtype+10;
2117 for (i=
first; i<=last;i++) {
2122 yi1 =
y[i]; yi =
y[i-1];
2124 if (i != last)
Error(where,
"Y must be in increasing order");
2125 else Error(where,
"Y must have N+1 values with option N");
2128 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2161 wminstep =
wmin + 0.5*delta;
2163 gPad->GetRangeAxis(ax1,ay1,ax2,ay2);
2167 for (i=
first; i<=last;i++) {
2172 xi1 =
x[i]; xi =
x[i-1];
2174 if (i != last)
Error(where,
"X must be in increasing order");
2175 else Error(where,
"X must have N+1 values with option N");
2178 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2180 if (
gxwork[npt-1] < uxmin ||
gxwork[npt-1] > uxmax) { npt--;
continue;}
2183 if ((
gywork[npt-1] < rwymin) || ((
gywork[npt-1] > rwymax) && !optionFill2)) {
2220 for (i=
first; i<=last;i++) {
2223 gywork[npt-1] = wminstep+(i-
first)*delta+0.5*delta;
2225 yi1 =
y[i]; yi =
y[i-1];
2227 if (i != last)
Error(where,
"Y must be in increasing order");
2228 else Error(where,
"Y must have N+1 values with option N");
2231 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2234 if ((
gxwork[npt-1] < uxmin) || (
gxwork[npt-1] > uxmax)) {
2256 if (optionLine != 0 && npt > 1) {
2267 offset = delta*baroffset; dbar = delta*barwidth;
2271 dbar = (
x[1]-
x[0])*barwidth;
2274 dbar = (
y[1]-
y[0])*barwidth;
2277 drawbordersav = drawborder;
2284 else ylow =
gPad->GetUymin();
2286 for (i=
first; i<=last;i++) {
2293 if (xlow < rwxmax && xhigh > rwxmin)
2297 xhigh = xhigh+delta;
2300 xi1 =
x[i]; xi =
x[i-1];
2302 Error(where,
"X must be in increasing order");
2306 dbar = (
x[i+1]-
x[i])*barwidth;
2316 else xlow =
gPad->GetUxmin();
2317 for (i=
first; i<=last;i++) {
2325 gPad->PaintBox(xlow,ylow,xhigh,yhigh);
2327 ylow = ylow + delta;
2328 yhigh = yhigh + delta;
2331 yi1 =
y[i]; yi =
y[i-1];
2333 Error(where,
"Y must be in increasing order");
2337 dbar = (
y[i+1]-
y[i])*barwidth;
2350 if ((optionStar) || (optionMark)) optionMarker=1;
2356 for (i=
first; i<=last;i++) {
2357 if (!optionBins) xm =
wmin+(i-
first)*delta+0.5*delta;
2358 else xm =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2360 if (optionMark != 10) {
2361 if (ym<rwymax && ym > rwymin) {
2367 if (ym<rwymax && ym >= rwymin) {
2384 wminstep =
wmin + 0.5*delta;
2385 for (i=
first; i<=last;i++) {
2386 if (!optionBins) ym = wminstep+(i-
first)*delta+0.5*delta;
2387 else ym =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2389 if (optionMark != 10) {
2390 if (xm<rwxmax && xm > rwxmin) {
2396 if (xm<rwxmax && xm >= rwxmin) {
2431 std::vector<Double_t> xline, yline;
2436 const Int_t kBASEMARKER=8;
2437 static Float_t cxx[30] = {1.0,1.0,0.5,0.5,1.0,1.0,0.5,0.6,1.0,0.5,0.5,1.0,0.5,0.6,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
2438 static Float_t cyy[30] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.5,0.5,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
2457 const char *arrowOpt =
nullptr;
2458 if (strchr(
option,
'>')) arrowOpt =
">";
2459 if (strstr(
option,
"|>")) arrowOpt =
"|>";
2484 xline.resize(2*theNpoints);
2485 yline.resize(2*theNpoints);
2486 if (xline.empty() || yline.empty()) {
2487 Error(
"PaintGraphAsymmErrors",
"too many points, out of memory");
2494 theGraph->TAttLine::Modify();
2509 Double_t sbase = symbolsize*kBASEMARKER;
2524 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2529 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
2530 for (
Int_t i=0;i<theNpoints;i++) {
2531 x =
gPad->XtoPad(theX[i]);
2532 y =
gPad->YtoPad(theY[i]);
2536 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
2537 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
2538 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
2539 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
2541 if (x < gPad->GetUxmin())
continue;
2542 if (
x >
gPad->GetUxmax())
continue;
2543 if (y < gPad->GetUymin())
continue;
2544 if (
y >
gPad->GetUymax())
continue;
2564 xl2 =
gPad->XtoPad(theX[i] - exl);
2566 xr2 =
gPad->XtoPad(theX[i] + exh);
2580 yup2 =
gPad->YtoPad(theY[i] + eyh);
2582 ylow2 =
gPad->YtoPad(theY[i] - eyl);
2584 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2585 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2593 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2594 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2595 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2596 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2597 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2598 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2599 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2600 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2601 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2602 else box.PaintBox(x1b, y1b, x2b, y2b);
2610 yline[if1-1] = yup2;
2611 yline[if2-1] = ylow2;
2617 if (exl != 0. || exh != 0.) {
2619 if (exl != 0.)
arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
2620 if (exh != 0.)
arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
2623 if (exl != 0.)
gPad->PaintLine(xl1,
y,xl2,
y);
2624 if (exh != 0.)
gPad->PaintLine(xr1,
y,xr2,
y);
2629 xb[0] = xl2+tx; yb[0] =
y-ty;
2630 xb[1] = xl2; yb[1] =
y-ty;
2631 xb[2] = xl2; yb[2] =
y+ty;
2632 xb[3] = xl2+tx; yb[3] =
y+ty;
2633 gPad->PaintPolyLine(4, xb, yb);
2636 xb[0] = xr2-tx; yb[0] =
y-ty;
2637 xb[1] = xr2; yb[1] =
y-ty;
2638 xb[2] = xr2; yb[2] =
y+ty;
2639 xb[3] = xr2-tx; yb[3] =
y+ty;
2640 gPad->PaintPolyLine(4, xb, yb);
2643 gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
2644 gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
2650 if (eyl != 0. || eyh != 0.) {
2652 if (eyh != 0.)
arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
2653 if (eyl != 0.)
arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
2656 if (eyh != 0.)
gPad->PaintLine(
x,yup1,
x,yup2);
2657 if (eyl != 0.)
gPad->PaintLine(
x,ylow1,
x,ylow2);
2662 xb[0] =
x-tx; yb[0] = yup2-ty;
2663 xb[1] =
x-tx; yb[1] = yup2;
2664 xb[2] =
x+tx; yb[2] = yup2;
2665 xb[3] =
x+tx; yb[3] = yup2-ty;
2666 gPad->PaintPolyLine(4, xb, yb);
2669 xb[0] =
x-tx; yb[0] = ylow2+ty;
2670 xb[1] =
x-tx; yb[1] = ylow2;
2671 xb[2] =
x+tx; yb[2] = ylow2;
2672 xb[3] =
x+tx; yb[3] = ylow2+ty;
2673 gPad->PaintPolyLine(4, xb, yb);
2676 if (eyh != 0.)
gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
2677 if (eyl != 0.)
gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
2691 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
2692 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
2693 gPad->SetLogx(logx);
2694 gPad->SetLogy(logy);
2710 Int_t NYErrors = tg->GetNYErrors();
2711 if (NYErrors <= 0) {
2719 std::vector<TString> options(NYErrors + 1);
2728 while ((firstSemicolon = tsOpt.
First(
';')) !=
kNPOS && filled <= NYErrors) {
2729 options[filled] = tsOpt(0, firstSemicolon);
2730 tsOpt = tsOpt(firstSemicolon + 1, tsOpt.
Length());
2734 if (filled <= NYErrors) {
2735 options[filled] = tsOpt.
Copy();
2739 for (
Int_t i = filled; i <= NYErrors; i++)
2742 std::vector<Double_t> xline;
2743 std::vector<std::vector<Double_t>> yline(NYErrors);
2748 const Int_t kBASEMARKER = 8;
2749 static Float_t cxx[30] = {1.0,1.0,0.5,0.5,1.0,1.0,0.5,0.6,1.0,0.5,0.5,1.0,0.5,0.6,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
2750 static Float_t cyy[30] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.5,0.5,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
2751 Int_t theNpoints = tg->GetN();
2755 Double_t *theExH = tg->GetEXhigh();
2756 std::vector<Double_t *> theEyL(NYErrors);
2757 std::vector<Double_t *> theEyH(NYErrors);
2760 for (
Int_t j = 0; j < NYErrors; j++) {
2761 theEyL[j] = tg->GetEYlow(j);
2762 theEyH[j] = tg->GetEYhigh(j);
2763 theEyExists &= (theEyL[j] && theEyH[j]);
2766 if (!theX || !theY || !theExL || !theExH || !theEyExists)
2769 std::vector<Bool_t> DrawErrors(NYErrors);
2774 std::vector<Bool_t> Braticks(NYErrors);
2775 std::vector<Bool_t> Brackets(NYErrors);
2776 std::vector<Bool_t> EndLines(NYErrors);
2777 std::vector<Char_t *> ArrowOpt(NYErrors);
2778 std::vector<Bool_t> Option5(NYErrors);
2779 std::vector<Bool_t> Option4(NYErrors);
2780 std::vector<Bool_t> Option3(NYErrors);
2782 std::vector<Bool_t> Option2(NYErrors);
2783 std::vector<Bool_t> Option0(NYErrors);
2785 std::vector<Double_t> Scale(NYErrors);
2787 const TRegexp ScaleRegExp(
"s=*[0-9]\\.*[0-9]");
2789 for (
Int_t j = 0; j < NYErrors; j++) {
2790 if (options[j + 1].Contains(
"s=")) {
2791 sscanf(strstr(options[j + 1].Data(),
"s="),
"s=%lf", &Scale[j]);
2792 options[j + 1].ReplaceAll(options[j + 1](ScaleRegExp),
"");
2796 DrawErrors[j] = !options[j + 1].Contains(
"x");
2797 AnyErrors |= DrawErrors[j];
2798 Braticks[j] = options[j + 1].Contains(
"[]");
2799 Brackets[j] = options[j + 1].Contains(
"||") || Braticks[j];
2800 EndLines[j] = !options[j + 1].Contains(
"z");
2802 if (options[j + 1].Contains(
"|>"))
2803 ArrowOpt[j] = (
Char_t *)
"|>";
2804 else if (options[j + 1].Contains(
">"))
2805 ArrowOpt[j] = (
Char_t *)
">";
2807 ArrowOpt[j] =
nullptr;
2809 Option5[j] = options[j + 1].Contains(
"5");
2810 Option4[j] = options[j + 1].Contains(
"4");
2811 Option3[j] = options[j + 1].Contains(
"3") || Option4[j];
2812 AnyOption3 |= Option3[j];
2813 Option2[j] = options[j + 1].Contains(
"2") || Option5[j];
2814 Option0[j] = options[j + 1].Contains(
"0");
2815 AnyOption0 |= Option0[j];
2817 NoErrorsX &= (Option3[j] || Option2[j]);
2818 Option0X |= !(Option3[j] || Option2[j]) && Option0[j];
2819 DrawMarker |= !(Brackets[j] || Option3[j] || Option2[j]);
2822 Bool_t Draw0PointsX = !options[0].Contains(
"x0") && (
gPad->GetLogx() == 0);
2823 Bool_t Draw0PointsY = !options[0].Contains(
"y0") && (
gPad->GetLogy() == 0);
2824 options[0].ReplaceAll(
"x0",
"");
2825 options[0].ReplaceAll(
"y0",
"");
2827 Bool_t DrawErrorsX = !options[0].Contains(
"x");
2828 Bool_t BraticksX = options[0].Contains(
"[]");
2829 Bool_t BracketsX = options[0].Contains(
"||") || BraticksX;
2830 Bool_t EndLinesX = !options[0].Contains(
"z");
2832 Char_t *ArrowOptX =
nullptr;
2833 if (options[0].Contains(
"|>"))
2834 ArrowOptX = (
Char_t *)
"|>";
2835 else if (options[0].Contains(
">"))
2836 ArrowOptX = (
Char_t *)
">";
2839 if (options[0].Contains(
"s=")) {
2840 sscanf(strstr(options[0].Data(),
"s="),
"s=%lf", &ScaleX);
2841 options[0].ReplaceAll(options[0](ScaleRegExp),
"");
2844 if (!AnyErrors && !DrawErrorsX) {
2849 Bool_t DrawAxis = options[0].Contains(
"a");
2850 Bool_t IndividualStyles = options[0].Contains(
"s");
2855 Int_t NPointsInside = AnyOption0 ? theNpoints : 0;
2858 for (
Int_t i = 0; i < theNpoints && !AnyOption0; i++) {
2859 x =
gPad->XtoPad(theX[i]);
2860 y =
gPad->YtoPad(theY[i]);
2862 if ((
x >=
gPad->GetUxmin()) && (x <= gPad->GetUxmax()) && (
y >=
gPad->GetUymin()) && (y <= gPad->GetUymax()) &&
2863 (Draw0PointsX || theX[i] != 0.) && (Draw0PointsY || theY[i] != 0.))
2868 xline.resize(2 * NPointsInside);
2870 if (xline.empty()) {
2871 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2876 if2 = 2 * NPointsInside;
2879 for (
Int_t j = 0; j < NYErrors; j++) {
2880 if (Option3[j] && DrawErrors[j]) {
2881 yline[j].resize(2 * NPointsInside);
2883 if (yline[j].empty()) {
2884 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2890 tg->TAttLine::Modify();
2893 arrow.SetLineWidth(tg->GetLineWidth());
2894 arrow.SetLineColor(tg->GetLineColor());
2895 arrow.SetFillColor(tg->GetFillColor());
2899 box.SetLineWidth(tg->GetLineWidth());
2900 box.SetLineColor(tg->GetLineColor());
2901 box.SetFillColor(tg->GetFillColor());
2902 box.SetFillStyle(tg->GetFillStyle());
2904 Double_t symbolsize = tg->GetMarkerSize();
2905 Double_t sbase = symbolsize * kBASEMARKER;
2911 cx = cxx[
mark - 20];
2912 cy = cyy[
mark - 20];
2921 Float_t asize = 0.6 * symbolsize * kBASEMARKER /
gPad->GetWh();
2926 Double_t xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
2927 for (
Int_t i = 0; i < theNpoints; i++) {
2928 x =
gPad->XtoPad(theX[i]);
2929 y =
gPad->YtoPad(theY[i]);
2932 (
x <
gPad->GetUxmin()) || (
x >
gPad->GetUxmax()) || (y < gPad->GetUymin()) || (
y >
gPad->GetUymax());
2934 if ((isOutside && !AnyOption0) || (!Draw0PointsX && theX[i] == 0.) || (!Draw0PointsY && theY[i] == 0.))
2939 if (x < gPad->GetUxmin())
2940 x =
gPad->GetUxmin();
2941 if (
x >
gPad->GetUxmax())
2942 x =
gPad->GetUxmax();
2943 if (y < gPad->GetUymin())
2944 y =
gPad->GetUymin();
2945 if (
y >
gPad->GetUymax())
2946 y =
gPad->GetUymax();
2956 for (
Int_t j = 0; j < NYErrors; j++) {
2961 if (Option2[j] && (!isOutside || Option0[j])) {
2962 if (IndividualStyles) {
2963 box.SetLineWidth(tg->GetLineWidth(j));
2964 box.SetLineColor(tg->GetLineColor(j));
2965 box.SetFillColor(tg->GetFillColor(j));
2966 box.SetFillStyle(tg->GetFillStyle(j));
2969 x1b =
gPad->XtoPad(theX[i] - Scale[j] * theExL[i]);
2970 y1b =
gPad->YtoPad(theY[i] - theEyL[j][i]);
2971 x2b =
gPad->XtoPad(theX[i] + Scale[j] * theExH[i]);
2972 y2b =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2973 if (x1b < gPad->GetUxmin())
2974 x1b =
gPad->GetUxmin();
2975 if (x1b >
gPad->GetUxmax())
2976 x1b =
gPad->GetUxmax();
2977 if (y1b < gPad->GetUymin())
2978 y1b =
gPad->GetUymin();
2979 if (y1b >
gPad->GetUymax())
2980 y1b =
gPad->GetUymax();
2981 if (x2b < gPad->GetUxmin())
2982 x2b =
gPad->GetUxmin();
2983 if (x2b >
gPad->GetUxmax())
2984 x2b =
gPad->GetUxmax();
2985 if (y2b < gPad->GetUymin())
2986 y2b =
gPad->GetUymin();
2987 if (y2b >
gPad->GetUymax())
2988 y2b =
gPad->GetUymax();
2990 box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2992 box.PaintBox(x1b, y1b, x2b, y2b);
2997 if (!isOutside || Option0[j]) {
2998 yline[j][if1 - 2] =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2999 yline[j][if2] =
gPad->YtoPad(theY[i] - theEyL[j][i]);
3001 yline[j][if1 - 2] =
gPad->GetUymin();
3002 yline[j][if2] =
gPad->GetUymin();
3006 if (IndividualStyles) {
3007 tg->GetAttLine(j)->Modify();
3009 arrow.SetLineWidth(tg->GetLineWidth(j));
3010 arrow.SetLineColor(tg->GetLineColor(j));
3011 arrow.SetFillColor(tg->GetFillColor(j));
3014 ylow1 =
y - s2y * cy;
3015 ylow2 =
gPad->YtoPad(theY[i] - theEyL[j][i]);
3016 if (ylow2 < gPad->GetUymin())
3017 ylow2 =
gPad->GetUymin();
3018 if (ylow2 < ylow1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
3020 arrow.PaintArrow(
x, ylow1,
x, ylow2, asize, ArrowOpt[j]);
3023 gPad->PaintLine(
x, ylow1,
x, ylow2);
3034 gPad->PaintPolyLine(4, xb, yb);
3036 gPad->PaintLine(
x - tx, ylow2,
x + tx, ylow2);
3041 yup1 =
y + s2y * cy;
3042 yup2 =
gPad->YtoPad(theY[i] + theEyH[j][i]);
3043 if (yup2 >
gPad->GetUymax())
3044 yup2 =
gPad->GetUymax();
3045 if (yup2 > yup1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
3047 arrow.PaintArrow(
x, yup1,
x, yup2, asize, ArrowOpt[j]);
3050 gPad->PaintLine(
x, yup1,
x, yup2);
3061 gPad->PaintPolyLine(4, xb, yb);
3063 gPad->PaintLine(
x - tx, yup2,
x + tx, yup2);
3070 if (IndividualStyles) {
3071 tg->TAttLine::Modify();
3073 arrow.SetLineWidth(tg->GetLineWidth());
3074 arrow.SetLineColor(tg->GetLineColor());
3075 arrow.SetFillColor(tg->GetFillColor());
3079 xl2 =
gPad->XtoPad(theX[i] - ScaleX * theExL[i]);
3080 if (xl1 > xl2 && !NoErrorsX && (!isOutside || Option0X)) {
3082 arrow.PaintArrow(xl1,
y, xl2,
y, asize, ArrowOptX);
3085 gPad->PaintLine(xl1,
y, xl2,
y);
3096 gPad->PaintPolyLine(4, xb, yb);
3098 gPad->PaintLine(xl2,
y - ty, xl2,
y + ty);
3104 xr2 =
gPad->XtoPad(theX[i] + ScaleX * theExH[i]);
3105 if (xr1 < xr2 && !NoErrorsX && (!isOutside || Option0X)) {
3107 arrow.PaintArrow(xr1,
y, xr2,
y, asize, ArrowOptX);
3110 gPad->PaintLine(xr1,
y, xr2,
y);
3121 gPad->PaintPolyLine(4, xb, yb);
3123 gPad->PaintLine(xr2,
y - ty, xr2,
y + ty);
3135 tg->TAttFill::Copy(tgDummy);
3136 tg->TAttLine::Copy(tgDummy);
3137 tg->TAttMarker::Copy(tgDummy);
3139 for (
Int_t j = 0; j < NYErrors; j++)
3140 if (Option3[j] && DrawErrors[j]) {
3141 if (IndividualStyles) {
3142 tg->GetAttFill(j)->
Copy(tgDummy);
3143 tg->GetAttLine(j)->Copy(tgDummy);
3151 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"FC");
3153 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"F");
3154 gPad->SetLogx(logx);
3155 gPad->SetLogy(logy);
3166 std::vector<Double_t> xline, yline;
3171 const Int_t kBASEMARKER=8;
3172 static Float_t cxx[30] = {1.0,1.0,0.5,0.5,1.0,1.0,0.5,0.6,1.0,0.5,0.5,1.0,0.5,0.6,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
3173 static Float_t cyy[30] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.5,0.5,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
3196 const char *arrowOpt =
nullptr;
3197 if (strchr(
option,
'>')) arrowOpt =
">";
3198 if (strstr(
option,
"|>")) arrowOpt =
"|>";
3223 xline.resize(2*theNpoints);
3224 yline.resize(2*theNpoints);
3225 if (xline.empty() || yline.empty()) {
3226 Error(
"PaintGraphBentErrors",
"too many points, out of memory");
3233 theGraph->TAttLine::Modify();
3248 Double_t sbase = symbolsize*kBASEMARKER;
3263 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3268 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
3270 for (
Int_t i=0;i<theNpoints;i++) {
3271 x =
gPad->XtoPad(theX[i]);
3272 y =
gPad->YtoPad(theY[i]);
3273 bxl =
gPad->YtoPad(theY[i]+theEXlowd[i]);
3274 bxh =
gPad->YtoPad(theY[i]+theEXhighd[i]);
3275 byl =
gPad->XtoPad(theX[i]+theEYlowd[i]);
3276 byh =
gPad->XtoPad(theX[i]+theEYhighd[i]);
3280 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3281 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3282 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3283 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3285 if (x < gPad->GetUxmin())
continue;
3286 if (
x >
gPad->GetUxmax())
continue;
3287 if (y < gPad->GetUymin())
continue;
3288 if (
y >
gPad->GetUymax())
continue;
3314 xl2 =
gPad->XtoPad(theX[i] - exl);
3316 xr2 =
gPad->XtoPad(theX[i] + exh);
3336 yup2 =
gPad->YtoPad(theY[i] + eyh);
3338 ylow2 =
gPad->YtoPad(theY[i] - eyl);
3340 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3341 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3343 if (xrevlog) {bs = bxl; bxl = bxh; bxh = bs;}
3344 if (yrevlog) {bs = byl; byl = byh; byh = bs;}
3352 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3353 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3354 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3355 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3356 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3357 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3358 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3359 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3360 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3361 else box.PaintBox(x1b, y1b, x2b, y2b);
3369 yline[if1-1] = yup2;
3370 yline[if2-1] = ylow2;
3376 if (exl != 0. || exh != 0.) {
3378 if (exl != 0.)
arrow.PaintArrow(xl1,
y,xl2,bxl,asize,arrowOpt);
3379 if (exh != 0.)
arrow.PaintArrow(xr1,
y,xr2,bxh,asize,arrowOpt);
3382 if (exl != 0.)
gPad->PaintLine(xl1,
y,xl2,bxl);
3383 if (exh != 0.)
gPad->PaintLine(xr1,
y,xr2,bxh);
3388 xb[0] = xl2+tx; yb[0] = bxl-ty;
3389 xb[1] = xl2; yb[1] = bxl-ty;
3390 xb[2] = xl2; yb[2] = bxl+ty;
3391 xb[3] = xl2+tx; yb[3] = bxl+ty;
3392 gPad->PaintPolyLine(4, xb, yb);
3395 xb[0] = xr2-tx; yb[0] = bxh-ty;
3396 xb[1] = xr2; yb[1] = bxh-ty;
3397 xb[2] = xr2; yb[2] = bxh+ty;
3398 xb[3] = xr2-tx; yb[3] = bxh+ty;
3399 gPad->PaintPolyLine(4, xb, yb);
3402 gPad->PaintLine(xl2,bxl-ty,xl2,bxl+ty);
3403 gPad->PaintLine(xr2,bxh-ty,xr2,bxh+ty);
3409 if (eyl != 0. || eyh != 0.) {
3411 if (eyh != 0.)
arrow.PaintArrow(
x,yup1,byh,yup2,asize,arrowOpt);
3412 if (eyl != 0.)
arrow.PaintArrow(
x,ylow1,byl,ylow2,asize,arrowOpt);
3415 if (eyh != 0.)
gPad->PaintLine(
x,yup1,byh,yup2);
3416 if (eyl != 0.)
gPad->PaintLine(
x,ylow1,byl,ylow2);
3421 xb[0] = byh-tx; yb[0] = yup2-ty;
3422 xb[1] = byh-tx; yb[1] = yup2;
3423 xb[2] = byh+tx; yb[2] = yup2;
3424 xb[3] = byh+tx; yb[3] = yup2-ty;
3425 gPad->PaintPolyLine(4, xb, yb);
3428 xb[0] = byl-tx; yb[0] = ylow2+ty;
3429 xb[1] = byl-tx; yb[1] = ylow2;
3430 xb[2] = byl+tx; yb[2] = ylow2;
3431 xb[3] = byl+tx; yb[3] = ylow2+ty;
3432 gPad->PaintPolyLine(4, xb, yb);
3435 if (eyh != 0.)
gPad->PaintLine(byh-tx,yup2,byh+tx,yup2);
3436 if (eyl != 0.)
gPad->PaintLine(byl-tx,ylow2,byl+tx,ylow2);
3451 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3452 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3453 gPad->SetLogx(logx);
3454 gPad->SetLogy(logy);
3465 std::vector<Double_t> xline, yline;
3470 const Int_t kBASEMARKER=8;
3471 static Float_t cxx[30] = {1.0,1.0,0.5,0.5,1.0,1.0,0.5,0.6,1.0,0.5,0.5,1.0,0.5,0.6,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
3472 static Float_t cyy[30] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.5,0.5,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
3489 const char *arrowOpt =
nullptr;
3490 if (strchr(
option,
'>')) arrowOpt =
">";
3491 if (strstr(
option,
"|>")) arrowOpt =
"|>";
3516 xline.resize(2*theNpoints);
3517 yline.resize(2*theNpoints);
3518 if (xline.empty() || yline.empty()) {
3519 Error(
"PaintGraphErrors",
"too many points, out of memory");
3526 theGraph->TAttLine::Modify();
3541 Double_t sbase = symbolsize*kBASEMARKER;
3556 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3561 Double_t x,
y,
ex,
ey, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
3562 for (
Int_t i=0;i<theNpoints;i++) {
3563 x =
gPad->XtoPad(theX[i]);
3564 y =
gPad->YtoPad(theY[i]);
3568 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3569 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3570 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3571 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3573 if (x < gPad->GetUxmin())
continue;
3574 if (
x >
gPad->GetUxmax())
continue;
3575 if (y < gPad->GetUymin())
continue;
3576 if (
y >
gPad->GetUymax())
continue;
3594 xl2 =
gPad->XtoPad(theX[i] -
ex);
3596 xr2 =
gPad->XtoPad(theX[i] +
ex);
3610 yup2 =
gPad->YtoPad(theY[i] +
ey);
3612 ylow2 =
gPad->YtoPad(theY[i] -
ey);
3614 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3615 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3623 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3624 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3625 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3626 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3627 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3628 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3629 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3630 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3631 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3632 else box.PaintBox(x1b, y1b, x2b, y2b);
3640 yline[if1-1] = yup2;
3641 yline[if2-1] = ylow2;
3649 arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
3650 arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
3653 gPad->PaintLine(xl1,
y,xl2,
y);
3654 gPad->PaintLine(xr1,
y,xr2,
y);
3658 xb[0] = xl2+tx; yb[0] =
y-ty;
3659 xb[1] = xl2; yb[1] =
y-ty;
3660 xb[2] = xl2; yb[2] =
y+ty;
3661 xb[3] = xl2+tx; yb[3] =
y+ty;
3662 gPad->PaintPolyLine(4, xb, yb);
3663 xb[0] = xr2-tx; yb[0] =
y-ty;
3664 xb[1] = xr2; yb[1] =
y-ty;
3665 xb[2] = xr2; yb[2] =
y+ty;
3666 xb[3] = xr2-tx; yb[3] =
y+ty;
3667 gPad->PaintPolyLine(4, xb, yb);
3669 gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
3670 gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
3678 arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
3679 arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
3682 gPad->PaintLine(
x,yup1,
x,yup2);
3683 gPad->PaintLine(
x,ylow1,
x,ylow2);
3687 xb[0] =
x-tx; yb[0] = yup2-ty;
3688 xb[1] =
x-tx; yb[1] = yup2;
3689 xb[2] =
x+tx; yb[2] = yup2;
3690 xb[3] =
x+tx; yb[3] = yup2-ty;
3691 gPad->PaintPolyLine(4, xb, yb);
3692 xb[0] =
x-tx; yb[0] = ylow2+ty;
3693 xb[1] =
x-tx; yb[1] = ylow2;
3694 xb[2] =
x+tx; yb[2] = ylow2;
3695 xb[3] =
x+tx; yb[3] = ylow2+ty;
3696 gPad->PaintPolyLine(4, xb, yb);
3698 gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
3699 gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
3714 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3715 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3716 gPad->SetLogx(logx);
3717 gPad->SetLogy(logy);
3729 Double_t rwrmin, rwrmax, rwtmin, rwtmax;
3733 Int_t theNpoints = theGraphPolar->
GetN();
3739 if (theNpoints<1)
return;
3754 if (thePolargram)
if (!
gPad->FindObject(thePolargram->
GetName())) thePolargram=
nullptr;
3755 if (!thePolargram) {
3768 if (!thePolargram) {
3770 rwrmin = theY[0]; rwrmax = theY[theNpoints-1];
3771 rwtmin = theX[0]; rwtmax = theX[theNpoints-1];
3773 for (ipt = 0; ipt < theNpoints; ipt++) {
3776 if (theX[ipt] -theEX[ipt] < rwtmin) rwtmin = theX[ipt]-theEX[ipt];
3777 if (theX[ipt] +theEX[ipt] > rwtmax) rwtmax = theX[ipt]+theEX[ipt];
3779 if (theX[ipt] < rwtmin) rwtmin=theX[ipt];
3780 if (theX[ipt] > rwtmax) rwtmax=theX[ipt];
3783 if (theY[ipt] -theEY[ipt] < rwrmin) rwrmin = theY[ipt]-theEY[ipt];
3784 if (theY[ipt] +theEY[ipt] > rwrmax) rwrmax = theY[ipt]+theEY[ipt];
3786 if (theY[ipt] < rwrmin) rwrmin=theY[ipt];
3787 if (theY[ipt] > rwrmax) rwrmax=theY[ipt];
3791 if (rwrmin == rwrmax) rwrmax += 1.;
3792 if (rwtmin == rwtmax) rwtmax += 1.;
3799 rwtmax += dt/theNpoints;
3801 rwrmin = thePolargram->
GetRMin();
3802 rwrmax = thePolargram->
GetRMax();
3803 rwtmin = thePolargram->
GetTMin();
3804 rwtmax = thePolargram->
GetTMax();
3809 thePolargram =
new TGraphPolargram(
"Polargram",rwrmin,rwrmax,rwtmin,rwtmax);
3813 if (nolabel) thePolargram->
Draw(
"N");
3814 else thePolargram->
Draw(
"");
3823 Double_t radiusNDC = rwrmax-rwrmin;
3833 for (i=0; i<theNpoints; i++) {
3834 Double_t eymin, eymax, exmin,exmax;
3835 exmin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3837 eymin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3839 exmax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3841 eymax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3843 theGraphPolar->TAttLine::Modify();
3844 if (exmin != exmax || eymin != eymax)
gPad->PaintLine(exmin,eymin,exmax,eymax);
3848 for (i=0; i<theNpoints; i++) {
3849 Double_t rad = (theY[i]-rwrmin)/radiusNDC;
3852 theGraphPolar->TAttLine::Modify();
3853 if (phimin != phimax) thePolargram->
PaintCircle(0,0,rad,phimin,phimax,0);
3859 if (!(
gPad->GetLogx()) && !(
gPad->GetLogy())) {
3860 Double_t a,
b,
c=1,
x1,
x2,
y1,
y2, discr, norm1, norm2, xts, yts;
3868 for (i=0; i<theNpoints; i++) {
3871 xt = (theY[i]-rwrmin)/radiusNDC*
TMath::Cos(
c*(theX[i]-rwtmin)/thetaNDC);
3872 yt = (theY[i]-rwrmin)/radiusNDC*
TMath::Sin(
c*(theX[i]-rwtmin)/thetaNDC);
3873 norm = sqrt(xt*xt+yt*yt);
3878 if (!previouspointin) {
3883 a = (yt-yts)/(xt-xts);
3885 discr = 4*(
a*
a-
b*
b+1);
3886 x1 = (-2*
a*
b+sqrt(discr))/(2*(
a*
a+1));
3887 x2 = (-2*
a*
b-sqrt(discr))/(2*(
a*
a+1));
3890 norm1 = sqrt((
x1-xt)*(
x1-xt)+(
y1-yt)*(
y1-yt));
3891 norm2 = sqrt((
x2-xt)*(
x2-xt)+(
y2-yt)*(
y2-yt));
3892 previouspointin =
kFALSE;
3894 if (norm1 < norm2) {
3904 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3909 if (j>=1 && !previouspointin) {
3910 a = (yt-theYpol[j])/(xt-theXpol[j]);
3911 b = theYpol[j]-
a*theXpol[j];
3912 previouspointin =
kTRUE;
3913 discr = 4*(
a*
a-
b*
b+1);
3914 x1 = (-2*
a*
b+sqrt(discr))/(2*(
a*
a+1));
3915 x2 = (-2*
a*
b-sqrt(discr))/(2*(
a*
a+1));
3918 norm1 = sqrt((
x1-xt)*(
x1-xt)+(
y1-yt)*(
y1-yt));
3919 norm2 = sqrt((
x2-xt)*(
x2-xt)+(
y2-yt)*(
y2-yt));
3921 if (norm1 < norm2) {
3928 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3935 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3938 for (i=0; i<theNpoints; i++) {
3942 PaintGraph(theGraphPolar, theNpoints, theXpol, theYpol,opt);
3950 TIter next(
gPad->GetListOfPrimitives());
3951 while (
auto obj = next()) {
3955 if (strcmp(title->
GetName(),
"title")) {title =
nullptr;
continue;}
3959 if (title)
delete title;
3965 if (ht <= 0) ht = 0.05;
3986 if (talh < 1) talh = 1;
else if (talh > 3) talh = 3;
3988 if (talv < 1) talv = 1;
else if (talv > 3) talv = 3;
4030 TF1 *theF = theGraphQQ->
GetF();
4033 Error(
"TGraphQQ::Paint",
"2nd dataset or theoretical function not specified");
4048 Double_t yxmin, xymin, yxmax, xymax;
4054 TLine line1, line2, line3;
4057 yxmin = (theYq2-theYq1)*(
xmin-theXq1)/(theXq2-theXq1) + theYq1;
4059 xymin = (theXq2-theXq1)*(
ymin-theYq1)/(theYq2-theYq1) + theXq1;
4065 line2.
PaintLine(xqmin, yqmin, xqmax, yqmax);
4067 yxmax = (theYq2-theYq1)*(
xmax-theXq1)/(theXq2-theXq1) + theYq1;
4069 xymax = (theXq2-theXq1)*(
ymax-theYq1)/(theYq2-theYq1) + theXq1;
4112 if (lxp) opth.
Append(
"x+");
4113 if (lyp) opth.
Append(
"y+");
4138 XA1 =
gPad->GetUxmin();
4139 XA2 =
gPad->GetUxmax();
4140 YA1 =
gPad->GetUymin();
4141 YA2 =
gPad->GetUymax();
4178 if (
gPad->GetGridx()) {
4179 if (
gPad->GetLogy()) {
4182 GL = (YA2 - YA1) / (
gPad->GetY2() -
gPad->GetY1());
4190 TGaxis *theReversedXaxis;
4191 if (
gPad->GetLogx()) {
4204 theReversedXaxis =
new TGaxis(
gPad->GetUxmax(),
4218 theReversedXaxis->
Paint();
4222 if (
gPad->GetLogx()) {
4226 for (i=0; i<
N; i++) rX[i] = dX-
X[i];
4230 if (rEXhigh && EXlow)
for (i=0; i<
N; i++) rEXhigh[i] = EXlow[i];
4231 if (rEXlow && EXhigh)
for (i=0; i<
N; i++) rEXlow[i] = EXhigh[i];
4234 if (rEXhighd && EXlowd)
for (i=0; i<
N; i++) rEXhighd[i] = EXlowd[i];
4235 if (rEXlowd && EXhighd)
for (i=0; i<
N; i++) rEXlowd[i] = EXhighd[i];
4246 if (
gPad->GetGridy()) {
4247 if (
gPad->GetLogx()) {
4250 GL = (XA2 - XA1) / (
gPad->GetX2() -
gPad->GetX1());
4258 TGaxis *theReversedYaxis;
4259 if (
gPad->GetLogy()) {
4285 theReversedYaxis->
Paint();
4289 if (
gPad->GetLogy()) {
4293 for (i=0; i<
N; i++) rY[i] = dY-Y[i];
4297 if (rEYhigh && EYlow)
for (i=0; i<
N; i++) rEYhigh[i] = EYlow[i];
4298 if (rEYlow && EYhigh)
for (i=0; i<
N; i++) rEYlow[i] = EYhigh[i];
4301 if (rEYhighd && EYlowd)
for (i=0; i<
N; i++) rEYhighd[i] = EYlowd[i];
4302 if (rEYlowd && EYhighd)
for (i=0; i<
N; i++) rEYlowd[i] = EYhighd[i];
4306 if (rEYlowd)
for (i=0; i<
N; i++) rEYlowd[i] = -rEYlowd[i];
4307 if (rEYhighd)
for (i=0; i<
N; i++) rEYhighd[i] = -rEYhighd[i];
4310 if (rEXlowd)
for (i=0; i<
N; i++) rEXlowd[i] = -rEXlowd[i];
4311 if (rEXhighd)
for (i=0; i<
N; i++) rEXhighd[i] = -rEXhighd[i];
4336 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
4341 double *theColor = theScatter->
GetColor();
4342 double *theSize = theScatter->
GetSize();
4346 double minx = DBL_MAX;
4347 double maxx = -DBL_MAX;
4348 double miny = DBL_MAX;
4349 double maxy = -DBL_MAX;
4350 double minc = DBL_MAX;
4351 double maxc = -DBL_MAX;
4352 double mins = DBL_MAX;
4353 double maxs = -DBL_MAX;
4354 for (
int i=0; i<
n; i++) {
4372 if (theX[0] == 0.) {
4382 if (theY[0] == 0.) {
4393 if (theColor[0] == 0.) {
4398 minc = theColor[0] -
d;
4399 maxc = theColor[0] +
d;
4405 if (theSize[0] == 0.) {
4410 mins = theSize[0] -
d;
4411 maxs = theSize[0] +
d;
4417 if (optionAxis)
h->
Paint(
" ");
4428 functions->
Remove(palette);
4429 delete palette; palette =
nullptr;
4433 functions->
Remove(palette);
4434 delete palette; palette =
nullptr;
4457 if (palette) palette->
Paint();
4462 int logx =
gPad->GetLogx();
4463 int logy =
gPad->GetLogy();
4464 int logz =
gPad->GetLogz();
4465 if (theColor && logz) {
4466 if (minc>0) minc = log10(minc);
4467 if (maxc>0) maxc = log10(maxc);
4470 theScatter->TAttMarker::Modify();
4473 for (
int i=0; i<
n; i++) {
4476 if (theColor[i]>0)
c = log10(theColor[i]);
4482 if (nc > nbcol-1) nc = nbcol-1;
4486 ms = (MaxMarkerSize-MinMarkerSize)*((theSize[i]-mins)/(maxs-mins))+MinMarkerSize;
4489 if (theColor || theSize) theScatter->TAttMarker::Modify();
4491 if (theX[i]>0)
x = log10(theX[i]);
4497 if (theY[i]>0)
y = log10(theY[i]);
4502 gPad->PaintPolyMarker(1,&
x,&
y);
4523 if (!functions)
return;
4532 obj->Paint(lnk->GetOption());
4552 std::vector<Double_t> xf(2*
n);
4553 std::vector<Double_t> yf(2*
n);
4554 std::vector<Double_t> xt(
n);
4555 std::vector<Double_t> yt(
n);
4556 Double_t x1,
x2,
y1,
y2, x3, y3, xm, ym,
a, a1, a2, a3;
4559 Int_t ix1,iy1,ix2,iy2;
4563 gPad->GetPadPar(x1p,y1p,x2p,y2p);
4564 ix1 = (
Int_t)(iw*x1p);
4565 iy1 = (
Int_t)(ih*y1p);
4566 ix2 = (
Int_t)(iw*x2p);
4567 iy2 = (
Int_t)(ih*y2p);
4579 gPad->GetRange(rx1,ry1,rx2,ry2);
4580 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
4581 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
4585 xf[0] = rx*(
x[0]-rx1)+x1ndc;
4586 yf[0] = ry*(
y[0]-ry1)+y1ndc;
4588 for (i=1; i<
n; i++) {
4589 if (
x[i]==
x[i-1] &&
y[i]==
y[i-1])
continue;
4591 xf[nf] = rx*(
x[i]-rx1)+x1ndc;
4592 if (xf[i]==xf[i-1]) xf[i] += 0.000001;
4593 yf[nf] = ry*(
y[i]-ry1)+y1ndc;
4612 if (xf[nf]==xf[nf-1]) {
4617 if (xf[nf]>=xf[nf-1]) {
4626 for (i=1; i<nf; i++) {
4638 if (xi1<xi0) a1 = a1+3.14159;
4644 if (xi0<xi2) a2 = a2+3.14159;
4659 if ((xm-xi0)*(x3-xi0)<0 && (ym-yi0)*(y3-yi0)<0) {
4663 if ((xm==
x1) && (ym==
y1)) {
4672 if (xf[nf]==xf[0] && yf[nf]==yf[0]) {
4673 xm = (xt[nf]+xt[0])*0.5;
4674 ym = (yt[nf]+yt[0])*0.5;
4682 if ((xm-xf[0])*(x3-xf[0])<0 && (ym-yf[0])*(y3-yf[0])<0) {
4696 for (i=nf2; i>0; i--) {
4697 for (j=i-1; j>0; j--) {
4698 if (xt[i-1]==xt[i] || xt[j-1]==xt[j])
continue;
4699 c1 = (yt[i-1]-yt[i])/(xt[i-1]-xt[i]);
4700 b1 = yt[i]-
c1*xt[i];
4701 c2 = (yt[j-1]-yt[j])/(xt[j-1]-xt[j]);
4702 b2 = yt[j]-
c2*xt[j];
4704 xc = (b2-b1)/(
c1-
c2);
4710 nf++; xf[nf] = xt[i]; yf[nf] = yt[i];
4711 nf++; xf[nf] = xc ; yf[nf] = yc;
4729 nf++; xf[nf] = xt[0]; yf[nf] = yt[0];
4732 for (i=0; i<nf+1; i++) {
4733 xf[i] = (1/rx)*(xf[i]-x1ndc)+rx1;
4734 yf[i] = (1/ry)*(yf[i]-y1ndc)+ry1;
4738 gPad->PaintFillArea(nf+1,xf.data(),yf.data());
4739 theGraph->TAttLine::Modify();
4752 TIter next(functions);
4753 while (
auto obj = next()) {
4763 if (!dofit) fit =
nullptr;
4765 if (dofit == 1) dofit = 111;
4767 Int_t print_fval = dofit%10;
4768 Int_t print_ferrors = (dofit/10)%10;
4769 Int_t print_fchi2 = (dofit/100)%10;
4770 Int_t print_fprob = (dofit/1000)%10;
4771 Int_t nlinesf = print_fval + print_fchi2 + print_fprob;
4773 if (print_fval < 2) nlinesf += fit->GetNumberFreeParameters();
4774 else nlinesf += fit->GetNpar();
4810 Int_t ndf = fit->GetNDF();
4812 snprintf(t,64,textstats,fit->GetChisquare());
4813 if (print_fchi2) stats->
AddText(t);
4819 if (print_fval || print_ferrors) {
4821 for (
Int_t ipar=0;ipar<fit->GetNpar();ipar++) {
4822 fit->GetParLimits(ipar,parmin,parmax);
4823 if (print_fval < 2 && parmin*parmax != 0 && parmin >= parmax)
continue;
4824 if (print_ferrors) {
4826 snprintf(t,64,textstats,fit->GetParameter(ipar)
4827 ,fit->GetParError(ipar));
4830 snprintf(t,64,textstats,fit->GetParameter(ipar));
4837 if (!done) functions->
Add(stats);
4867 Int_t i, k, kp, km, npointsMax, banksize, n2, npt;
4868 Int_t maxiterations, finished;
4869 Int_t jtype, ktype, closed;
4870 Double_t sxmin, sxmax, symin, symax;
4873 Double_t ratio_signs, xratio, yratio;
4879 Double_t co, so, ct, st, ctu, stu, xnt;
4880 Double_t dx1, dy1, dx2, dy2, dk1, dk2;
4887 c = t = co = so = ct = st = ctu = stu = dx1 = dy1 = dx2 = dy2 = 0;
4888 xt = yt = xa = xb = ya = yb = u1 = u2 = u3 = tj = sb = 0;
4890 npointsMax = npoints*10;
4894 std::vector<Double_t> qlx(npointsMax);
4895 std::vector<Double_t> qly(npointsMax);
4896 if (qlx.empty() || qly.empty()) {
4897 Error(
"Smooth",
"not enough space in memory");
4904 jtype = (drawtype%1000)-10;
4905 if (jtype > 0) { ktype = jtype; loptx =
kTRUE; }
4906 else ktype = drawtype%1000;
4935 for (i=1;i<npoints;i++) {
4937 if ((
x[i]-
x[i-1])*(
x[i-1]-
x[i-2]) < 0) six++;
4938 if ((
y[i]-
y[i-1])*(
y[i-1]-
y[i-2]) < 0) siy++;
4940 if (
x[i] < sxmin) sxmin =
x[i];
4941 if (
x[i] > sxmax) sxmax =
x[i];
4942 if (
y[i] < symin) symin =
y[i];
4943 if (
y[i] > symax) symax =
y[i];
4948 if (dx1n < 0.01*(sxmax-sxmin) && dy1n < 0.01*(symax-symin)) closed = 1;
4949 if (sxmin == sxmax) {
4952 if (six > 1) ratio_signs = siy/six;
4953 else ratio_signs = 20;
4954 xratio = ratio_signs/(sxmax-sxmin);
4956 if (symin == symax) yratio = 1;
4957 else yratio = 1/(symax-symin);
4961 for (i=0;i<npoints;i++) {
4962 x[i] = (
x[i]-sxmin)*xratio;
4963 y[i] = (
y[i]-symin)*yratio;
4982 if (
x[0] !=
x[npoints-1] ||
y[0] !=
y[npoints-1])
goto L40;
4983 if (
x[npoints-2] ==
x[npoints-1] &&
y[npoints-2] ==
y[npoints-1])
goto L40;
4984 if (
x[0] ==
x[1] &&
y[0] ==
y[1])
goto L40;
5007 if (npt > 1)
goto L310;
5011 if (
x[k-1] ==
x[k-2] &&
y[k-1] ==
y[k-2])
goto L50;
5016 if (npt > 1)
goto L310;
5019 if (k < npoints)
goto L90;
5020 if (!flgic) { kp = 2;
goto L130;}
5023 if (flgis)
goto L150;
5033 if (
x[k-1] ==
x[k] &&
y[k-1] ==
y[k])
goto L80;
5041 if (!flgis)
goto L50;
5056 dx1 =
x[k-1] -
x[km-1];
5057 dy1 =
y[k-1] -
y[km-1];
5058 dk1 = dx1*dx1 + dy1*dy1;
5059 dx2 =
x[kp-1] -
x[k-1];
5060 dy2 =
y[kp-1] -
y[k-1];
5061 dk2 = dx2*dx2 + dy2*dy2;
5062 ctu = dx1*dk2 + dx2*dk1;
5063 stu = dy1*dk2 + dy2*dk1;
5064 xnt = ctu*ctu + stu*stu;
5078 if (flgis)
goto L160;
5082 w3 = 2*(dx1*dy2-dx2*dy1);
5094 w3 = 2*(dx1*dy2-dx2*dy1);
5103 if (k <= 1)
goto L120;
5133 xa = (
a*t-2*dx)/tcube;
5134 xb = (3*dx-(co+
a)*t)/tsquare;
5135 ya = (
b*t-2*dy)/tcube;
5136 yb = (3*dy-(so+
b)*t)/tsquare;
5167 p2 = (u1*tj-u3)*3*tj+u2;
5197 z = s*sth*(s-s*sth)*(w1*sth+w1+w2);
5198 z = z*z/((
a*
a+
b*
b)*(delta*delta));
5199 z = (z+2.642937)*z/((.3715652*z+3.063444)*z+.2441889)-cc;
5203 if (iw > 0)
goto L250;
5204 if (z > err)
goto L240;
5209 if (iw+2 == 0)
goto L190;
5210 if (iw+2 > 0)
goto L290;
5228 theGraph->
Zero(kp,0,sb,err,s,z,maxiterations);
5229 if (kp == 2)
goto L210;
5231 Error(
"Smooth",
"Attempt to plot outside plot limits");
5234 if (iw > 0)
goto L200;
5260 qlx[npt] = sxmin + xt/xratio;
5261 qly[npt] = symin + yt/yratio;
5268 if (npt < banksize)
goto L320;
5269 if (drawtype >= 1000 || ktype > 1) {
5270 Int_t newsize = banksize + n2;
5271 std::vector<Double_t> qtemp(banksize);
5272 for (i=0;i<banksize;i++) qtemp[i] = qlx[i];
5273 qlx.resize(newsize);
5274 for (i=0;i<banksize;i++) qlx[i] = qtemp[i];
5275 for (i=0;i<banksize;i++) qtemp[i] = qly[i];
5276 qly.resize(newsize);
5277 for (i=0;i<banksize;i++) qly[i] = qtemp[i];
5285 if (drawtype >= 1000) {
5286 gPad->PaintFillArea(npt,qlx.data(),qly.data(),
"B");
5290 qlx[npt] = qlx[npt-1];
5291 qlx[npt+1] = qlx[0];
5297 qly[npt] = qly[npt-1];
5298 qly[npt+1] = qly[0];
5300 gPad->PaintFillArea(npt+2,qlx.data(),qly.data());
5303 gPad->PaintPolyLine(npt,qlx.data(),qly.data());
5306 qlx[0] = sxmin + xt/xratio;
5307 qly[0] = symin + yt/yratio;
5309 if (finished > 0)
goto L390;
5310 if (finished < 0) { finished = 0;
goto L110;}
5311 if (s > 0)
goto L180;
5317 for (i=0;i<npoints;i++) {
5318 x[i] = sxmin +
x[i]/xratio;
5319 y[i] = symin +
y[i]/yratio;
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 winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
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 x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void xpos
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void ypos
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmax
Option_t Option_t TPoint TPoint const char y1
static Int_t gHighlightPoint
static TGraph * gHighlightGraph
static std::unique_ptr< TMarker > gHighlightMarker
R__EXTERN TStyle * gStyle
Draw all kinds of Arrows.
virtual Color_t GetLabelColor() const
virtual Color_t GetAxisColor() const
virtual Float_t GetLabelOffset() const
virtual void SetAxisColor(Color_t color=1, Float_t alpha=1.)
Set color of the line axis and tick marks.
virtual Style_t GetLabelFont() const
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels.
virtual Float_t GetLabelSize() const
virtual Float_t GetTickLength() const
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the 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 Style_t GetMarkerStyle() const
Return the marker style.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual Size_t GetMarkerSize() const
Return the marker size.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
static Style_t GetMarkerStyleBase(Style_t style)
Internal helper function that returns the corresponding marker style with line width 1 for the given ...
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 SetTextSize(Float_t tsize=1)
Set the text size.
Bool_t GetMoreLogLabels() const
virtual void SetLimits(Double_t xmin, Double_t xmax)
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 SetTickLength(Float_t ticklength)
virtual void SetMoreLogLabels(Bool_t more=kTRUE)
Set the kMoreLogLabels bit flag.
void SetTickSize(Float_t ticksize)
void Paint(Option_t *chopt="") override
Draw this axis with its current attributes.
void SetLabelSize(Float_t labelsize)
Double_t * GetEX() const override
Double_t * GetEY() const override
TGraph with asymmetric error bars and multiple y error dimensions.
void PaintGraphPolar(TGraph *theGraph, Option_t *option)
Paint this TGraphPolar with its current attributes.
void PaintGraph(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override
Control function to draw a graph.
void PaintGraphErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphErrors with its current attributes.
void PaintGraphAsymmErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphAsymmErrors with its current attributes.
void PaintGraphMultiErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphMultiErrors with its current attributes.
virtual void PaintHighlightPoint(TGraph *theGraph, Option_t *option)
Paint highlight point as TMarker object (open circle)
void PaintGraphReverse(TGraph *theGraph, Option_t *option)
Paint theGraph reverting values along X and/or Y axis. a new graph is created.
void PaintGrapHist(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override
This is a service method used by THistPainter to paint 1D histograms.
static Int_t fgMaxPointsPerLine
Number of points per chunks' line when drawing a graph.
void PaintStats(TGraph *theGraph, TF1 *fit) override
Paint the statistics box with the fit info.
void PaintPolyLineHatches(TGraph *theGraph, Int_t n, const Double_t *x, const Double_t *y)
Paint a polyline with hatches on one side showing an exclusion zone.
void DrawPanelHelper(TGraph *theGraph) override
Display a panel with all histogram drawing options.
char * GetObjectInfoHelper(TGraph *theGraph, Int_t px, Int_t py) const override
void ExecuteEventHelper(TGraph *theGraph, Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
virtual void HighlightPoint(TGraph *theGraph, Int_t hpoint, Int_t distance)
Check on highlight point.
void ComputeLogs(Int_t npoints, Int_t opt)
Compute the logarithm of variables gxwork and gywork according to the value of Options and put the re...
std::vector< Double_t > gxworkl
Int_t DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py) override
Compute distance from point px,py to a graph.
std::vector< Double_t > gxwork
std::vector< Double_t > gywork
void PaintScatter(TScatter *theScatter, Option_t *option) override
Paint a scatter plot.
void Smooth(TGraph *theGraph, Int_t npoints, Double_t *x, Double_t *y, Int_t drawtype)
Smooth a curve given by N points.
std::vector< Double_t > gyworkl
Internal buffers for coordinates. Used for graphs painting.
void SetHighlight(TGraph *theGraph) override
Set highlight (enable/disable) mode for theGraph.
virtual Int_t GetHighlightPoint(TGraph *theGraph) const
Return the highlighted point for theGraph.
void PaintGraphSimple(TGraph *theGraph, Option_t *option)
Paint a simple graph, without errors bars.
void PaintGraphQQ(TGraph *theGraph, Option_t *option)
Paint this graphQQ. No options for the time being.
~TGraphPainter() override
Destructor.
static void SetMaxPointsPerLine(Int_t maxp=50)
Static function to set fgMaxPointsPerLine for graph painting.
void PaintGraphBentErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphBentErrors with its current attributes.
TGraphPainter()
Default constructor.
void PaintHelper(TGraph *theGraph, Option_t *option) override
Paint a any kind of TGraph.
Double_t * GetYpol()
Return points in polar coordinates.
TGraphPolargram * GetPolargram()
void SetPolargram(TGraphPolargram *p)
void SetOptionAxis(Bool_t opt)
Double_t * GetXpol()
Return points in polar coordinates.
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.
void Draw(Option_t *options="") override
Draw Polargram.
This class allows to draw quantile-quantile plots.
A TGraph is an object made of two arrays X and Y with npoints each.
virtual Double_t * GetEXhighd() const
virtual Bool_t IsEditable() const
@ kClipFrame
Clip to the frame boundary.
@ kNoStats
Don't draw stats box.
Double_t GetMinimum() const
virtual Double_t * GetEYlow() const
virtual Double_t * GetEX() const
Double_t GetMaximum() const
virtual Double_t * GetEXlowd() const
virtual void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
Compute the x/y range of the points in this graph.
virtual Double_t * GetEYlowd() const
void Zero(Int_t &k, Double_t AZ, Double_t BZ, Double_t E2, Double_t &X, Double_t &Y, Int_t maxiterations)
Find zero of a continuous function.
TList * GetListOfFunctions() const
virtual Bool_t IsHighlight() const
virtual Double_t * GetEYhighd() const
TAxis * GetXaxis() const
Get x axis of the graph.
virtual Double_t * GetEXhigh() const
virtual Double_t * GetEYhigh() const
TAxis * GetYaxis() const
Get y axis of the graph.
virtual TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases.
virtual Double_t * GetEY() const
virtual void SetHistogram(TH1F *h)
virtual Double_t * GetEXlow() const
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
Get x and y values for point number i.
1-D histogram with a float per channel (see TH1 documentation)}
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a line.
virtual Double_t GetMinimumStored() const
@ kNoTitle
Don't draw the histogram title.
@ kNoStats
Don't draw stats box.
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
virtual void SetMaximum(Double_t maximum=-1111)
virtual Int_t GetNdivisions(Option_t *axis="X") const
Return the number of divisions for "axis".
virtual void SetMinimum(Double_t minimum=-1111)
void Paint(Option_t *option="") override
Control routine to paint any kind of histograms.
virtual Double_t GetMaximumStored() const
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
2-D histogram with a float per channel (see TH1 documentation)}
To draw Mathematical Formula.
Use the TLine constructor to create a simple line.
virtual void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
TObject * Next() override
Return next object in the list. Returns 0 when no more objects in list.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
TObject * Remove(TObject *obj) override
Remove object from the list.
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
virtual TObjLink * FirstLink() const
void AddFirst(TObject *obj) override
Add object at the beginning of the list.
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
void Copy(TObject &named) const override
Copy this to obj.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
TObject * GetObject() const
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * GetTitle() const
Returns title of object.
@ kCannotPick
if object in a pad cannot be picked
@ kCanDelete
if object in a list can be deleted
@ kMustCleanup
if object destructor must call RecursiveRemove()
The palette painting class.
void Paint(Option_t *option="") override
Paint the palette.
virtual void SetNdivisions(Int_t ndiv=10)
virtual void SetLabelFont(Int_t font=42)
virtual void SetLabelOffset(Float_t offset=0.005)
virtual void SetTitleOffset(Float_t offset=1)
virtual void SetLabelColor(Int_t color=1)
virtual void SetTitleSize(Float_t size=0.035)
virtual void SetLabelSize(Float_t size=0.035)
The histogram statistics painter class.
virtual void SetStatFormat(const char *format="6.4g")
Change (i.e. set) the format for printing statistics.
void SetOptStat(Int_t stat=1)
Set the stat option.
virtual const char * GetFitFormat() const
virtual void SetFitFormat(const char *format="5.4g")
Change (i.e. set) the format for printing fit parameters in statistics box.
Int_t GetOptFit() const
Return the fit option.
void SetParent(TObject *obj) override
void SetOptFit(Int_t fit=1)
Set the fit option.
void Paint(Option_t *option="") override
Paint the pave stat.
A Pave (see TPave) with text, lines or/and boxes inside.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
void Clear(Option_t *option="") override
Clear all lines in this pavetext.
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
void Paint(Option_t *option="") override
Paint this pavetext with its current attributes.
virtual TText * GetLine(Int_t number) const
Get Pointer to line number in this pavetext.
const char * GetName() const override
Returns name of object.
virtual void SetName(const char *name="")
virtual void SetBorderSize(Int_t bordersize=4)
Double_t GetX1NDC() const
virtual void SetX2NDC(Double_t x2)
Regular expression class.
A TScatter is able to draw four variables scatter plot on a single plot.
TGraph * GetGraph() const
Get the graph holding X and Y positions.
Double_t GetMaxMarkerSize() const
Get the largest marker size used to paint the markers.
Double_t * GetSize() const
Get the array of marker sizes.
TH2F * GetHistogram() const
Get the graph histogram used for drawing axis.
Double_t * GetColor() const
Get the array of colors.
Double_t GetMinMarkerSize() const
Get the smallest marker size used to paint the markers.
TString Copy() const
Copy a string.
void ToLower()
Change string to lower-case.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void ToUpper()
Change string to upper case.
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Color_t GetLabelColor(Option_t *axis="X") const
Return the label color number in the axis.
Color_t GetStatTextColor() const
Float_t GetTitleX() const
Int_t GetOptTitle() const
Int_t GetNdivisions(Option_t *axis="X") const
Return number of divisions.
Float_t GetStatFontSize() const
Float_t GetBarOffset() const
Float_t GetLabelSize(Option_t *axis="X") const
Return label size.
Float_t GetTickLength(Option_t *axis="X") const
Return tick length.
Style_t GetLabelFont(Option_t *axis="X") const
Return label font.
Float_t GetTitleY() const
Style_t GetTitleFont(Option_t *axis="X") const
Return title font.
Color_t GetTitleFillColor() const
Style_t GetTitleStyle() const
Float_t GetLabelOffset(Option_t *axis="X") const
Return label offset.
Color_t GetStatColor() const
Float_t GetBarWidth() const
void SetDrawBorder(Int_t drawborder=1)
Width_t GetTitleBorderSize() const
Int_t GetColorPalette(Int_t i) const
Return color number i in current palette.
Float_t GetEndErrorSize() const
Int_t GetDrawBorder() const
Width_t GetStatBorderSize() const
Color_t GetTitleTextColor() const
Float_t GetTitleH() const
Style_t GetStatStyle() const
const char * GetFitFormat() const
const char * GetStatFormat() const
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
Style_t GetStatFont() const
Float_t GetTitleFontSize() const
Int_t GetTitleAlign() const
Color_t GetAxisColor(Option_t *axis="X") const
Return the axis color number in the axis.
Float_t GetTitleW() const
Base class for several text objects.
Abstract base class used by ROOT graphics editor.
static TVirtualPadEditor * GetPadEditor(Bool_t load=kTRUE)
Returns the pad editor dialog. Static method.
small helper class to store/restore gPad context in TPad methods
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Prob(Double_t chi2, Int_t ndf)
Computation of the probability for a certain Chi-squared (chi2) and number of degrees of freedom (ndf...
Bool_t IsInside(T xp, T yp, Int_t np, T *x, T *y)
Function which returns kTRUE if point xp,yp lies inside the polygon defined by the np points in array...
Double_t ATan(Double_t)
Returns the principal value of the arc tangent of x, expressed in radians.
constexpr Double_t PiOver2()
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 Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.