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++) {
1504 if (optionCurveFill) {
1506 if (xn !=
x1 || yn !=
y1) nloop++;
1510 for (i=1;i<=nloop;i++) {
1535 for (i=1;i<=nloop;i++) {
1539 if (
y[i-1] < minimum ||
y[i-1] > maximum)
continue;
1540 if (
x[i-1] < uxmin ||
x[i-1] > uxmax)
continue;
1566 for (i=1;i<=npoints;i++) {
1581 for (i=1;i<=npoints;i++) {
1596 if(FillSave ==
gPad->GetFrameFillColor()) {
1598 if (
gPad->GetFrameFillColor()==1) {
1600 theGraph->TAttFill::Modify();
1603 theGraph->TAttFill::Modify();
1609 for (i=1;i<npoints;i++) {
1610 if (
x[i] < barxmin) barxmin =
x[i];
1611 if (
x[i] > barxmax) barxmax =
x[i];
1613 bdelta = (barxmax-barxmin)/
Double_t(npoints);
1617 for (i=1;i<npoints;i++) {
1618 if (
y[i] < barymin) barymin =
y[i];
1619 if (
y[i] > barymax) barymax =
y[i];
1621 bdelta = (barymax-barymin)/
Double_t(npoints);
1625 for (i=1;i<=npoints;i++) {
1626 xlow =
x[i-1] - dbar;
1627 xhigh =
x[i-1] + dbar;
1629 if (xlow < uxmin && xhigh < uxmin)
continue;
1630 if (xhigh > uxmax && xlow > uxmax)
continue;
1631 if (xlow < uxmin) xlow = uxmin;
1632 if (xhigh > uxmax) xhigh = uxmax;
1634 else ylow =
gPad->GetUymin();
1648 for (i=1;i<=npoints;i++) {
1650 ylow =
y[i-1] - dbar;
1651 yhigh =
y[i-1] + dbar;
1662 theGraph->TAttFill::Modify();
1706 const char *where =
"PaintGrapHist";
1708 Int_t optionLine , optionAxis , optionCurve, optionStar, optionMark;
1709 Int_t optionBar , optionRot , optionOne , optionOff ;
1710 Int_t optionFill , optionZ;
1711 Int_t optionHist , optionBins , optionMarker;
1713 Int_t drawtype=0, drawborder, drawbordersav;
1719 Double_t xi, xi1, xj, xj1, yi1, yi, yj, yj1, xwmin, ywmin;
1720 Int_t first, last, nbins;
1723 char choptaxis[10] =
" ";
1726 Error(where,
"illegal number of points (%d)", npoints);
1731 if (opt.
Contains(
"H")) optionHist = 1;
else optionHist = 0;
1732 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1733 if (opt.
Contains(
"C")) optionCurve= 1;
else optionCurve= 0;
1734 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1735 if (opt.
Contains(
"R")) optionRot = 1;
else optionRot = 0;
1736 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1737 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1738 if (opt.
Contains(
"N")) optionBins = 1;
else optionBins = 0;
1739 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1740 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1741 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1742 if (opt.
Contains(
"][")) optionOff = 1;
else optionOff = 0;
1743 if (opt.
Contains(
"P0")) optionMark = 10;
1745 Int_t optionFill2 = 0;
1747 optionFill = 0; optionFill2 = 1;
1762 nbins = last - first + 1;
1774 Double_t rounding = (uxmax-uxmin)*1.e-5;
1777 Int_t nx1, nx2, ndivx, ndivy, ndiv;
1790 if (ndivx < 0) strlcat(choptaxis,
"N",10);
1791 if (
gPad->GetGridx()) {
1793 strlcat(choptaxis,
"W",10);
1795 if (
gPad->GetLogx()) {
1799 strlcat(choptaxis,
"G",10);
1809 axis.
PaintAxis(rwxmin,rwymin,rwxmax,rwymin,rwmin,rwmax,ndiv,choptaxis);
1819 strlcat(choptaxis,
"N",10);
1822 if (
gPad->GetGridy()) {
1824 strlcat(choptaxis,
"W",10);
1826 if (
gPad->GetLogy()) {
1830 strlcat(choptaxis,
"G",10);
1839 axis.
PaintAxis(rwxmin,rwymin,rwxmin,rwymax,rwmin,rwmax,ndiv,choptaxis);
1844 theGraph->TAttLine::Modify();
1845 theGraph->TAttFill::Modify();
1846 theGraph->TAttMarker::Modify();
1855 Int_t fwidth =
gPad->GetFrameLineWidth();
1858 if (optionOff) fwidth = 1;
1869 gxwork.resize(2*npoints+10);
1870 gywork.resize(2*npoints+10);
1874 if (optionFill && !optionCurve) {
1882 for (j=first; j<=last;j++) {
1889 xj1 =
x[j]; xj =
x[j-1];
1891 if (j != last)
Error(where,
"X must be in increasing order");
1892 else Error(where,
"X must have N+1 values with option N");
1900 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1901 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1914 if (!fillarea)
gyworkl[0] = ylast;
1925 for (j=first; j<=last;j++) {
1930 yj1 =
y[j]; yj =
y[j-1];
1932 if (j != last)
Error(where,
"Y must be in increasing order");
1933 else Error(where,
"Y must have N+1 values with option N");
1939 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1940 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1947 if (!fillarea)
gyworkl[0] = ylast;
1954 theGraph->TAttLine::Modify();
1955 theGraph->TAttFill::Modify();
1960 if ((optionHist) || !chopt[0]) {
1968 for (i=first; i<=last;i++) {
1973 xi1 =
x[i]; xi =
x[i-1];
1975 if (i != last)
Error(where,
"X must be in increasing order");
1976 else Error(where,
"X must have N+1 values with option N");
1984 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1985 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1997 Int_t nbpoints = npt-2;
2003 for (ip=point1; ip<=nbpoints; ip++) {
2010 Int_t point2 = nbpoints;
2011 for (ip=point2; ip>=point1; ip--) {
2017 nbpoints = point2-point1+1;
2021 if (
gxwork[0] >
gPad->GetUxmin()) { nbpoints++; point1 = 0; }
2022 if (
gxwork[nbpoints] <
gPad->GetUxmax()) nbpoints++;
2025 gPad->PaintPolyLine(nbpoints,
gxworkl.data() + point1,
gyworkl.data() + point1, noClip);
2035 for (i=first; i<=last;i++) {
2040 yi1 =
y[i]; yi =
y[i-1];
2042 if (i != last)
Error(where,
"Y must be in increasing order");
2043 else Error(where,
"Y must have N+1 values with option N");
2049 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
2050 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
2069 if (!optionOne) drawtype = 2;
2074 for (i=first; i<=last;i++) {
2077 gxwork[npt-1] =
wmin+(i-first)*delta+0.5*delta;
2079 xi1 =
x[i]; xi =
x[i-1];
2081 if (i != last)
Error(where,
"X must be in increasing order");
2082 else Error(where,
"X must have N+1 values with option N");
2085 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2116 drawtype = drawtype+10;
2118 for (i=first; i<=last;i++) {
2121 gywork[npt-1] =
wmin+(i-first)*delta+0.5*delta;
2123 yi1 =
y[i]; yi =
y[i-1];
2125 if (i != last)
Error(where,
"Y must be in increasing order");
2126 else Error(where,
"Y must have N+1 values with option N");
2129 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2162 wminstep =
wmin + 0.5*delta;
2164 gPad->GetRangeAxis(ax1,ay1,ax2,ay2);
2168 for (i=first; i<=last;i++) {
2171 gxwork[npt-1] =
wmin+(i-first)*delta+0.5*delta;
2173 xi1 =
x[i]; xi =
x[i-1];
2175 if (i != last)
Error(where,
"X must be in increasing order");
2176 else Error(where,
"X must have N+1 values with option N");
2179 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2181 if (
gxwork[npt-1] < uxmin ||
gxwork[npt-1] > uxmax) { npt--;
continue;}
2184 if ((
gywork[npt-1] < rwymin) || ((
gywork[npt-1] > rwymax) && !optionFill2)) {
2221 for (i=first; i<=last;i++) {
2224 gywork[npt-1] = wminstep+(i-first)*delta+0.5*delta;
2226 yi1 =
y[i]; yi =
y[i-1];
2228 if (i != last)
Error(where,
"Y must be in increasing order");
2229 else Error(where,
"Y must have N+1 values with option N");
2232 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2235 if ((
gxwork[npt-1] < uxmin) || (
gxwork[npt-1] > uxmax)) {
2257 if (optionLine != 0 && npt > 1) {
2268 offset = delta*baroffset; dbar = delta*barwidth;
2272 dbar = (
x[1]-
x[0])*barwidth;
2275 dbar = (
y[1]-
y[0])*barwidth;
2278 drawbordersav = drawborder;
2285 else ylow =
gPad->GetUymin();
2287 for (i=first; i<=last;i++) {
2294 if (xlow < rwxmax && xhigh > rwxmin)
2298 xhigh = xhigh+delta;
2301 xi1 =
x[i]; xi =
x[i-1];
2303 Error(where,
"X must be in increasing order");
2307 dbar = (
x[i+1]-
x[i])*barwidth;
2317 else xlow =
gPad->GetUxmin();
2318 for (i=first; i<=last;i++) {
2326 gPad->PaintBox(xlow,ylow,xhigh,yhigh);
2328 ylow = ylow + delta;
2329 yhigh = yhigh + delta;
2332 yi1 =
y[i]; yi =
y[i-1];
2334 Error(where,
"Y must be in increasing order");
2338 dbar = (
y[i+1]-
y[i])*barwidth;
2351 if ((optionStar) || (optionMark)) optionMarker=1;
2357 for (i=first; i<=last;i++) {
2358 if (!optionBins) xm =
wmin+(i-first)*delta+0.5*delta;
2359 else xm =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2361 if (optionMark != 10) {
2362 if (ym<rwymax && ym > rwymin) {
2368 if (ym<rwymax && ym >= rwymin) {
2385 wminstep =
wmin + 0.5*delta;
2386 for (i=first; i<=last;i++) {
2387 if (!optionBins) ym = wminstep+(i-first)*delta+0.5*delta;
2388 else ym =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2390 if (optionMark != 10) {
2391 if (xm<rwxmax && xm > rwxmin) {
2397 if (xm<rwxmax && xm >= rwxmin) {
2432 std::vector<Double_t> xline, yline;
2437 const Int_t kBASEMARKER=8;
2438 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};
2439 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};
2458 const char *arrowOpt =
nullptr;
2459 if (strchr(
option,
'>')) arrowOpt =
">";
2460 if (strstr(
option,
"|>")) arrowOpt =
"|>";
2485 xline.resize(2*theNpoints);
2486 yline.resize(2*theNpoints);
2487 if (xline.empty() || yline.empty()) {
2488 Error(
"PaintGraphAsymmErrors",
"too many points, out of memory");
2495 theGraph->TAttLine::Modify();
2510 Double_t sbase = symbolsize*kBASEMARKER;
2514 if (mark >= 20 && mark <= 49) {
2525 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2530 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
2531 for (
Int_t i=0;i<theNpoints;i++) {
2532 x =
gPad->XtoPad(theX[i]);
2533 y =
gPad->YtoPad(theY[i]);
2537 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
2538 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
2539 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
2540 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
2542 if (x < gPad->GetUxmin())
continue;
2543 if (
x >
gPad->GetUxmax())
continue;
2544 if (y < gPad->GetUymin())
continue;
2545 if (
y >
gPad->GetUymax())
continue;
2565 xl2 =
gPad->XtoPad(theX[i] - exl);
2567 xr2 =
gPad->XtoPad(theX[i] + exh);
2581 yup2 =
gPad->YtoPad(theY[i] + eyh);
2583 ylow2 =
gPad->YtoPad(theY[i] - eyl);
2585 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2586 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2594 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2595 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2596 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2597 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2598 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2599 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2600 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2601 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2602 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2603 else box.PaintBox(x1b, y1b, x2b, y2b);
2611 yline[if1-1] = yup2;
2612 yline[if2-1] = ylow2;
2618 if (exl != 0. || exh != 0.) {
2620 if (exl != 0.)
arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
2621 if (exh != 0.)
arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
2624 if (exl != 0.)
gPad->PaintLine(xl1,
y,xl2,
y);
2625 if (exh != 0.)
gPad->PaintLine(xr1,
y,xr2,
y);
2630 xb[0] = xl2+tx; yb[0] =
y-ty;
2631 xb[1] = xl2; yb[1] =
y-ty;
2632 xb[2] = xl2; yb[2] =
y+ty;
2633 xb[3] = xl2+tx; yb[3] =
y+ty;
2634 gPad->PaintPolyLine(4, xb, yb);
2637 xb[0] = xr2-tx; yb[0] =
y-ty;
2638 xb[1] = xr2; yb[1] =
y-ty;
2639 xb[2] = xr2; yb[2] =
y+ty;
2640 xb[3] = xr2-tx; yb[3] =
y+ty;
2641 gPad->PaintPolyLine(4, xb, yb);
2644 gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
2645 gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
2651 if (eyl != 0. || eyh != 0.) {
2653 if (eyh != 0.)
arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
2654 if (eyl != 0.)
arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
2657 if (eyh != 0.)
gPad->PaintLine(
x,yup1,
x,yup2);
2658 if (eyl != 0.)
gPad->PaintLine(
x,ylow1,
x,ylow2);
2663 xb[0] =
x-tx; yb[0] = yup2-ty;
2664 xb[1] =
x-tx; yb[1] = yup2;
2665 xb[2] =
x+tx; yb[2] = yup2;
2666 xb[3] =
x+tx; yb[3] = yup2-ty;
2667 gPad->PaintPolyLine(4, xb, yb);
2670 xb[0] =
x-tx; yb[0] = ylow2+ty;
2671 xb[1] =
x-tx; yb[1] = ylow2;
2672 xb[2] =
x+tx; yb[2] = ylow2;
2673 xb[3] =
x+tx; yb[3] = ylow2+ty;
2674 gPad->PaintPolyLine(4, xb, yb);
2677 if (eyh != 0.)
gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
2678 if (eyl != 0.)
gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
2692 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
2693 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
2694 gPad->SetLogx(logx);
2695 gPad->SetLogy(logy);
2711 Int_t NYErrors = tg->GetNYErrors();
2712 if (NYErrors <= 0) {
2720 std::vector<TString> options(NYErrors + 1);
2729 while ((firstSemicolon = tsOpt.
First(
';')) !=
kNPOS && filled <= NYErrors) {
2730 options[filled] = tsOpt(0, firstSemicolon);
2731 tsOpt = tsOpt(firstSemicolon + 1, tsOpt.
Length());
2735 if (filled <= NYErrors) {
2736 options[filled] = tsOpt.
Copy();
2740 for (
Int_t i = filled; i <= NYErrors; i++)
2743 std::vector<Double_t> xline;
2744 std::vector<std::vector<Double_t>> yline(NYErrors);
2749 const Int_t kBASEMARKER = 8;
2750 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};
2751 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};
2752 Int_t theNpoints = tg->GetN();
2756 Double_t *theExH = tg->GetEXhigh();
2757 std::vector<Double_t *> theEyL(NYErrors);
2758 std::vector<Double_t *> theEyH(NYErrors);
2761 for (
Int_t j = 0; j < NYErrors; j++) {
2762 theEyL[j] = tg->GetEYlow(j);
2763 theEyH[j] = tg->GetEYhigh(j);
2764 theEyExists &= (theEyL[j] && theEyH[j]);
2767 if (!theX || !theY || !theExL || !theExH || !theEyExists)
2770 std::vector<Bool_t> DrawErrors(NYErrors);
2775 std::vector<Bool_t> Braticks(NYErrors);
2776 std::vector<Bool_t> Brackets(NYErrors);
2777 std::vector<Bool_t> EndLines(NYErrors);
2778 std::vector<Char_t *> ArrowOpt(NYErrors);
2779 std::vector<Bool_t> Option5(NYErrors);
2780 std::vector<Bool_t> Option4(NYErrors);
2781 std::vector<Bool_t> Option3(NYErrors);
2783 std::vector<Bool_t> Option2(NYErrors);
2784 std::vector<Bool_t> Option0(NYErrors);
2786 std::vector<Double_t> Scale(NYErrors);
2788 const TRegexp ScaleRegExp(
"s=*[0-9]\\.*[0-9]");
2790 for (
Int_t j = 0; j < NYErrors; j++) {
2791 if (options[j + 1].Contains(
"s=")) {
2792 sscanf(strstr(options[j + 1].Data(),
"s="),
"s=%lf", &Scale[j]);
2793 options[j + 1].ReplaceAll(options[j + 1](ScaleRegExp),
"");
2797 DrawErrors[j] = !options[j + 1].Contains(
"x");
2798 AnyErrors |= DrawErrors[j];
2799 Braticks[j] = options[j + 1].Contains(
"[]");
2800 Brackets[j] = options[j + 1].Contains(
"||") || Braticks[j];
2801 EndLines[j] = !options[j + 1].Contains(
"z");
2803 if (options[j + 1].Contains(
"|>"))
2804 ArrowOpt[j] = (
Char_t *)
"|>";
2805 else if (options[j + 1].Contains(
">"))
2806 ArrowOpt[j] = (
Char_t *)
">";
2808 ArrowOpt[j] =
nullptr;
2810 Option5[j] = options[j + 1].Contains(
"5");
2811 Option4[j] = options[j + 1].Contains(
"4");
2812 Option3[j] = options[j + 1].Contains(
"3") || Option4[j];
2813 AnyOption3 |= Option3[j];
2814 Option2[j] = options[j + 1].Contains(
"2") || Option5[j];
2815 Option0[j] = options[j + 1].Contains(
"0");
2816 AnyOption0 |= Option0[j];
2818 NoErrorsX &= (Option3[j] || Option2[j]);
2819 Option0X |= !(Option3[j] || Option2[j]) && Option0[j];
2820 DrawMarker |= !(Brackets[j] || Option3[j] || Option2[j]);
2823 Bool_t Draw0PointsX = !options[0].Contains(
"x0") && (
gPad->GetLogx() == 0);
2824 Bool_t Draw0PointsY = !options[0].Contains(
"y0") && (
gPad->GetLogy() == 0);
2825 options[0].ReplaceAll(
"x0",
"");
2826 options[0].ReplaceAll(
"y0",
"");
2828 Bool_t DrawErrorsX = !options[0].Contains(
"x");
2829 Bool_t BraticksX = options[0].Contains(
"[]");
2830 Bool_t BracketsX = options[0].Contains(
"||") || BraticksX;
2831 Bool_t EndLinesX = !options[0].Contains(
"z");
2833 Char_t *ArrowOptX =
nullptr;
2834 if (options[0].Contains(
"|>"))
2835 ArrowOptX = (
Char_t *)
"|>";
2836 else if (options[0].Contains(
">"))
2837 ArrowOptX = (
Char_t *)
">";
2840 if (options[0].Contains(
"s=")) {
2841 sscanf(strstr(options[0].Data(),
"s="),
"s=%lf", &ScaleX);
2842 options[0].ReplaceAll(options[0](ScaleRegExp),
"");
2845 if (!AnyErrors && !DrawErrorsX) {
2850 Bool_t DrawAxis = options[0].Contains(
"a");
2851 Bool_t IndividualStyles = options[0].Contains(
"s");
2856 Int_t NPointsInside = AnyOption0 ? theNpoints : 0;
2859 for (
Int_t i = 0; i < theNpoints && !AnyOption0; i++) {
2860 x =
gPad->XtoPad(theX[i]);
2861 y =
gPad->YtoPad(theY[i]);
2863 if ((
x >=
gPad->GetUxmin()) && (x <= gPad->GetUxmax()) && (
y >=
gPad->GetUymin()) && (y <= gPad->GetUymax()) &&
2864 (Draw0PointsX || theX[i] != 0.) && (Draw0PointsY || theY[i] != 0.))
2869 xline.resize(2 * NPointsInside);
2871 if (xline.empty()) {
2872 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2877 if2 = 2 * NPointsInside;
2880 for (
Int_t j = 0; j < NYErrors; j++) {
2881 if (Option3[j] && DrawErrors[j]) {
2882 yline[j].resize(2 * NPointsInside);
2884 if (yline[j].empty()) {
2885 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2891 tg->TAttLine::Modify();
2894 arrow.SetLineWidth(tg->GetLineWidth());
2895 arrow.SetLineColor(tg->GetLineColor());
2896 arrow.SetFillColor(tg->GetFillColor());
2900 box.SetLineWidth(tg->GetLineWidth());
2901 box.SetLineColor(tg->GetLineColor());
2902 box.SetFillColor(tg->GetFillColor());
2903 box.SetFillStyle(tg->GetFillStyle());
2905 Double_t symbolsize = tg->GetMarkerSize();
2906 Double_t sbase = symbolsize * kBASEMARKER;
2911 if (mark >= 20 && mark <= 49) {
2912 cx = cxx[mark - 20];
2913 cy = cyy[mark - 20];
2922 Float_t asize = 0.6 * symbolsize * kBASEMARKER /
gPad->GetWh();
2927 Double_t xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
2928 for (
Int_t i = 0; i < theNpoints; i++) {
2929 x =
gPad->XtoPad(theX[i]);
2930 y =
gPad->YtoPad(theY[i]);
2933 (
x <
gPad->GetUxmin()) || (
x >
gPad->GetUxmax()) || (y < gPad->GetUymin()) || (
y >
gPad->GetUymax());
2935 if ((isOutside && !AnyOption0) || (!Draw0PointsX && theX[i] == 0.) || (!Draw0PointsY && theY[i] == 0.))
2940 if (x < gPad->GetUxmin())
2941 x =
gPad->GetUxmin();
2942 if (
x >
gPad->GetUxmax())
2943 x =
gPad->GetUxmax();
2944 if (y < gPad->GetUymin())
2945 y =
gPad->GetUymin();
2946 if (
y >
gPad->GetUymax())
2947 y =
gPad->GetUymax();
2957 for (
Int_t j = 0; j < NYErrors; j++) {
2962 if (Option2[j] && (!isOutside || Option0[j])) {
2963 if (IndividualStyles) {
2964 box.SetLineWidth(tg->GetLineWidth(j));
2965 box.SetLineColor(tg->GetLineColor(j));
2966 box.SetFillColor(tg->GetFillColor(j));
2967 box.SetFillStyle(tg->GetFillStyle(j));
2970 x1b =
gPad->XtoPad(theX[i] - Scale[j] * theExL[i]);
2971 y1b =
gPad->YtoPad(theY[i] - theEyL[j][i]);
2972 x2b =
gPad->XtoPad(theX[i] + Scale[j] * theExH[i]);
2973 y2b =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2974 if (x1b < gPad->GetUxmin())
2975 x1b =
gPad->GetUxmin();
2976 if (x1b >
gPad->GetUxmax())
2977 x1b =
gPad->GetUxmax();
2978 if (y1b < gPad->GetUymin())
2979 y1b =
gPad->GetUymin();
2980 if (y1b >
gPad->GetUymax())
2981 y1b =
gPad->GetUymax();
2982 if (x2b < gPad->GetUxmin())
2983 x2b =
gPad->GetUxmin();
2984 if (x2b >
gPad->GetUxmax())
2985 x2b =
gPad->GetUxmax();
2986 if (y2b < gPad->GetUymin())
2987 y2b =
gPad->GetUymin();
2988 if (y2b >
gPad->GetUymax())
2989 y2b =
gPad->GetUymax();
2991 box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2993 box.PaintBox(x1b, y1b, x2b, y2b);
2998 if (!isOutside || Option0[j]) {
2999 yline[j][if1 - 2] =
gPad->YtoPad(theY[i] + theEyH[j][i]);
3000 yline[j][if2] =
gPad->YtoPad(theY[i] - theEyL[j][i]);
3002 yline[j][if1 - 2] =
gPad->GetUymin();
3003 yline[j][if2] =
gPad->GetUymin();
3007 if (IndividualStyles) {
3008 tg->GetAttLine(j)->Modify();
3010 arrow.SetLineWidth(tg->GetLineWidth(j));
3011 arrow.SetLineColor(tg->GetLineColor(j));
3012 arrow.SetFillColor(tg->GetFillColor(j));
3015 ylow1 =
y - s2y * cy;
3016 ylow2 =
gPad->YtoPad(theY[i] - theEyL[j][i]);
3017 if (ylow2 < gPad->GetUymin())
3018 ylow2 =
gPad->GetUymin();
3019 if (ylow2 < ylow1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
3021 arrow.PaintArrow(
x, ylow1,
x, ylow2, asize, ArrowOpt[j]);
3024 gPad->PaintLine(
x, ylow1,
x, ylow2);
3035 gPad->PaintPolyLine(4, xb, yb);
3037 gPad->PaintLine(
x - tx, ylow2,
x + tx, ylow2);
3042 yup1 =
y + s2y * cy;
3043 yup2 =
gPad->YtoPad(theY[i] + theEyH[j][i]);
3044 if (yup2 >
gPad->GetUymax())
3045 yup2 =
gPad->GetUymax();
3046 if (yup2 > yup1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
3048 arrow.PaintArrow(
x, yup1,
x, yup2, asize, ArrowOpt[j]);
3051 gPad->PaintLine(
x, yup1,
x, yup2);
3062 gPad->PaintPolyLine(4, xb, yb);
3064 gPad->PaintLine(
x - tx, yup2,
x + tx, yup2);
3071 if (IndividualStyles) {
3072 tg->TAttLine::Modify();
3074 arrow.SetLineWidth(tg->GetLineWidth());
3075 arrow.SetLineColor(tg->GetLineColor());
3076 arrow.SetFillColor(tg->GetFillColor());
3080 xl2 =
gPad->XtoPad(theX[i] - ScaleX * theExL[i]);
3081 if (xl1 > xl2 && !NoErrorsX && (!isOutside || Option0X)) {
3083 arrow.PaintArrow(xl1,
y, xl2,
y, asize, ArrowOptX);
3086 gPad->PaintLine(xl1,
y, xl2,
y);
3097 gPad->PaintPolyLine(4, xb, yb);
3099 gPad->PaintLine(xl2,
y - ty, xl2,
y + ty);
3105 xr2 =
gPad->XtoPad(theX[i] + ScaleX * theExH[i]);
3106 if (xr1 < xr2 && !NoErrorsX && (!isOutside || Option0X)) {
3108 arrow.PaintArrow(xr1,
y, xr2,
y, asize, ArrowOptX);
3111 gPad->PaintLine(xr1,
y, xr2,
y);
3122 gPad->PaintPolyLine(4, xb, yb);
3124 gPad->PaintLine(xr2,
y - ty, xr2,
y + ty);
3136 tg->TAttFill::Copy(tgDummy);
3137 tg->TAttLine::Copy(tgDummy);
3138 tg->TAttMarker::Copy(tgDummy);
3140 for (
Int_t j = 0; j < NYErrors; j++)
3141 if (Option3[j] && DrawErrors[j]) {
3142 if (IndividualStyles) {
3143 tg->GetAttFill(j)->
Copy(tgDummy);
3144 tg->GetAttLine(j)->Copy(tgDummy);
3152 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"FC");
3154 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"F");
3155 gPad->SetLogx(logx);
3156 gPad->SetLogy(logy);
3167 std::vector<Double_t> xline, yline;
3172 const Int_t kBASEMARKER=8;
3173 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};
3174 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};
3197 const char *arrowOpt =
nullptr;
3198 if (strchr(
option,
'>')) arrowOpt =
">";
3199 if (strstr(
option,
"|>")) arrowOpt =
"|>";
3224 xline.resize(2*theNpoints);
3225 yline.resize(2*theNpoints);
3226 if (xline.empty() || yline.empty()) {
3227 Error(
"PaintGraphBentErrors",
"too many points, out of memory");
3234 theGraph->TAttLine::Modify();
3249 Double_t sbase = symbolsize*kBASEMARKER;
3253 if (mark >= 20 && mark <= 49) {
3264 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3269 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
3271 for (
Int_t i=0;i<theNpoints;i++) {
3272 x =
gPad->XtoPad(theX[i]);
3273 y =
gPad->YtoPad(theY[i]);
3274 bxl =
gPad->YtoPad(theY[i]+theEXlowd[i]);
3275 bxh =
gPad->YtoPad(theY[i]+theEXhighd[i]);
3276 byl =
gPad->XtoPad(theX[i]+theEYlowd[i]);
3277 byh =
gPad->XtoPad(theX[i]+theEYhighd[i]);
3281 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3282 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3283 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3284 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3286 if (x < gPad->GetUxmin())
continue;
3287 if (
x >
gPad->GetUxmax())
continue;
3288 if (y < gPad->GetUymin())
continue;
3289 if (
y >
gPad->GetUymax())
continue;
3315 xl2 =
gPad->XtoPad(theX[i] - exl);
3317 xr2 =
gPad->XtoPad(theX[i] + exh);
3337 yup2 =
gPad->YtoPad(theY[i] + eyh);
3339 ylow2 =
gPad->YtoPad(theY[i] - eyl);
3341 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3342 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3344 if (xrevlog) {bs = bxl; bxl = bxh; bxh = bs;}
3345 if (yrevlog) {bs = byl; byl = byh; byh = bs;}
3353 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3354 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3355 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3356 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3357 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3358 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3359 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3360 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3361 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3362 else box.PaintBox(x1b, y1b, x2b, y2b);
3370 yline[if1-1] = yup2;
3371 yline[if2-1] = ylow2;
3377 if (exl != 0. || exh != 0.) {
3379 if (exl != 0.)
arrow.PaintArrow(xl1,
y,xl2,bxl,asize,arrowOpt);
3380 if (exh != 0.)
arrow.PaintArrow(xr1,
y,xr2,bxh,asize,arrowOpt);
3383 if (exl != 0.)
gPad->PaintLine(xl1,
y,xl2,bxl);
3384 if (exh != 0.)
gPad->PaintLine(xr1,
y,xr2,bxh);
3389 xb[0] = xl2+tx; yb[0] = bxl-ty;
3390 xb[1] = xl2; yb[1] = bxl-ty;
3391 xb[2] = xl2; yb[2] = bxl+ty;
3392 xb[3] = xl2+tx; yb[3] = bxl+ty;
3393 gPad->PaintPolyLine(4, xb, yb);
3396 xb[0] = xr2-tx; yb[0] = bxh-ty;
3397 xb[1] = xr2; yb[1] = bxh-ty;
3398 xb[2] = xr2; yb[2] = bxh+ty;
3399 xb[3] = xr2-tx; yb[3] = bxh+ty;
3400 gPad->PaintPolyLine(4, xb, yb);
3403 gPad->PaintLine(xl2,bxl-ty,xl2,bxl+ty);
3404 gPad->PaintLine(xr2,bxh-ty,xr2,bxh+ty);
3410 if (eyl != 0. || eyh != 0.) {
3412 if (eyh != 0.)
arrow.PaintArrow(
x,yup1,byh,yup2,asize,arrowOpt);
3413 if (eyl != 0.)
arrow.PaintArrow(
x,ylow1,byl,ylow2,asize,arrowOpt);
3416 if (eyh != 0.)
gPad->PaintLine(
x,yup1,byh,yup2);
3417 if (eyl != 0.)
gPad->PaintLine(
x,ylow1,byl,ylow2);
3422 xb[0] = byh-tx; yb[0] = yup2-ty;
3423 xb[1] = byh-tx; yb[1] = yup2;
3424 xb[2] = byh+tx; yb[2] = yup2;
3425 xb[3] = byh+tx; yb[3] = yup2-ty;
3426 gPad->PaintPolyLine(4, xb, yb);
3429 xb[0] = byl-tx; yb[0] = ylow2+ty;
3430 xb[1] = byl-tx; yb[1] = ylow2;
3431 xb[2] = byl+tx; yb[2] = ylow2;
3432 xb[3] = byl+tx; yb[3] = ylow2+ty;
3433 gPad->PaintPolyLine(4, xb, yb);
3436 if (eyh != 0.)
gPad->PaintLine(byh-tx,yup2,byh+tx,yup2);
3437 if (eyl != 0.)
gPad->PaintLine(byl-tx,ylow2,byl+tx,ylow2);
3452 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3453 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3454 gPad->SetLogx(logx);
3455 gPad->SetLogy(logy);
3466 std::vector<Double_t> xline, yline;
3471 const Int_t kBASEMARKER=8;
3472 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};
3473 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};
3490 const char *arrowOpt =
nullptr;
3491 if (strchr(
option,
'>')) arrowOpt =
">";
3492 if (strstr(
option,
"|>")) arrowOpt =
"|>";
3517 xline.resize(2*theNpoints);
3518 yline.resize(2*theNpoints);
3519 if (xline.empty() || yline.empty()) {
3520 Error(
"PaintGraphErrors",
"too many points, out of memory");
3527 theGraph->TAttLine::Modify();
3543 Double_t sbase = symbolsize*kBASEMARKER;
3547 if (mark >= 20 && mark <= 49) {
3558 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3563 Double_t x,
y,
ex,
ey, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
3564 for (
Int_t i=0;i<theNpoints;i++) {
3565 x =
gPad->XtoPad(theX[i]);
3566 y =
gPad->YtoPad(theY[i]);
3570 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3571 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3572 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3573 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3575 if (x < gPad->GetUxmin())
continue;
3576 if (
x >
gPad->GetUxmax())
continue;
3577 if (y < gPad->GetUymin())
continue;
3578 if (
y >
gPad->GetUymax())
continue;
3596 xl2 =
gPad->XtoPad(theX[i] -
ex);
3598 xr2 =
gPad->XtoPad(theX[i] +
ex);
3612 yup2 =
gPad->YtoPad(theY[i] +
ey);
3614 ylow2 =
gPad->YtoPad(theY[i] -
ey);
3616 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3617 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3625 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3626 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3627 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3628 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3629 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3630 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3631 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3632 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3633 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3634 else box.PaintBox(x1b, y1b, x2b, y2b);
3642 yline[if1-1] = yup2;
3643 yline[if2-1] = ylow2;
3651 arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
3652 arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
3655 gPad->PaintLine(xl1,
y,xl2,
y);
3656 gPad->PaintLine(xr1,
y,xr2,
y);
3660 xb[0] = xl2+tx; yb[0] =
y-ty;
3661 xb[1] = xl2; yb[1] =
y-ty;
3662 xb[2] = xl2; yb[2] =
y+ty;
3663 xb[3] = xl2+tx; yb[3] =
y+ty;
3664 gPad->PaintPolyLine(4, xb, yb);
3665 xb[0] = xr2-tx; yb[0] =
y-ty;
3666 xb[1] = xr2; yb[1] =
y-ty;
3667 xb[2] = xr2; yb[2] =
y+ty;
3668 xb[3] = xr2-tx; yb[3] =
y+ty;
3669 gPad->PaintPolyLine(4, xb, yb);
3671 gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
3672 gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
3680 arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
3681 arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
3684 gPad->PaintLine(
x,yup1,
x,yup2);
3685 gPad->PaintLine(
x,ylow1,
x,ylow2);
3689 xb[0] =
x-tx; yb[0] = yup2-ty;
3690 xb[1] =
x-tx; yb[1] = yup2;
3691 xb[2] =
x+tx; yb[2] = yup2;
3692 xb[3] =
x+tx; yb[3] = yup2-ty;
3693 gPad->PaintPolyLine(4, xb, yb);
3694 xb[0] =
x-tx; yb[0] = ylow2+ty;
3695 xb[1] =
x-tx; yb[1] = ylow2;
3696 xb[2] =
x+tx; yb[2] = ylow2;
3697 xb[3] =
x+tx; yb[3] = ylow2+ty;
3698 gPad->PaintPolyLine(4, xb, yb);
3700 gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
3701 gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
3716 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3717 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3718 gPad->SetLogx(logx);
3719 gPad->SetLogy(logy);
3731 Double_t rwrmin, rwrmax, rwtmin, rwtmax;
3735 Int_t theNpoints = theGraphPolar->
GetN();
3741 if (theNpoints<1)
return;
3756 if (thePolargram)
if (!
gPad->FindObject(thePolargram->
GetName())) thePolargram=
nullptr;
3757 if (!thePolargram) {
3770 if (!thePolargram) {
3772 rwrmin = theY[0]; rwrmax = theY[theNpoints-1];
3773 rwtmin = theX[0]; rwtmax = theX[theNpoints-1];
3775 for (ipt = 0; ipt < theNpoints; ipt++) {
3778 if (theX[ipt] -theEX[ipt] < rwtmin) rwtmin = theX[ipt]-theEX[ipt];
3779 if (theX[ipt] +theEX[ipt] > rwtmax) rwtmax = theX[ipt]+theEX[ipt];
3781 if (theX[ipt] < rwtmin) rwtmin=theX[ipt];
3782 if (theX[ipt] > rwtmax) rwtmax=theX[ipt];
3785 if (theY[ipt] -theEY[ipt] < rwrmin) rwrmin = theY[ipt]-theEY[ipt];
3786 if (theY[ipt] +theEY[ipt] > rwrmax) rwrmax = theY[ipt]+theEY[ipt];
3788 if (theY[ipt] < rwrmin) rwrmin=theY[ipt];
3789 if (theY[ipt] > rwrmax) rwrmax=theY[ipt];
3793 if (rwrmin == rwrmax) rwrmax += 1.;
3794 if (rwtmin == rwtmax) rwtmax += 1.;
3801 rwtmax += dt/theNpoints;
3803 rwrmin = thePolargram->
GetRMin();
3804 rwrmax = thePolargram->
GetRMax();
3805 rwtmin = thePolargram->
GetTMin();
3806 rwtmax = thePolargram->
GetTMax();
3811 thePolargram =
new TGraphPolargram(
"Polargram",rwrmin,rwrmax,rwtmin,rwtmax);
3815 if (nolabel) thePolargram->
Draw(
"N");
3816 else thePolargram->
Draw(
"");
3825 Double_t radiusNDC = rwrmax-rwrmin;
3835 for (i=0; i<theNpoints; i++) {
3836 Double_t eymin, eymax, exmin,exmax;
3837 exmin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3839 eymin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3841 exmax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3843 eymax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3845 theGraphPolar->TAttLine::Modify();
3846 if (exmin != exmax || eymin != eymax)
gPad->PaintLine(exmin,eymin,exmax,eymax);
3850 for (i=0; i<theNpoints; i++) {
3851 Double_t rad = (theY[i]-rwrmin)/radiusNDC;
3854 theGraphPolar->TAttLine::Modify();
3855 if (phimin != phimax) thePolargram->
PaintCircle(0,0,rad,phimin,phimax,0);
3861 if (!(
gPad->GetLogx()) && !(
gPad->GetLogy())) {
3862 Double_t a,
b,
c=1,
x1,
x2,
y1,
y2, discr, norm1, norm2, xts, yts;
3870 for (i=0; i<theNpoints; i++) {
3873 xt = (theY[i]-rwrmin)/radiusNDC*
TMath::Cos(
c*(theX[i]-rwtmin)/thetaNDC);
3874 yt = (theY[i]-rwrmin)/radiusNDC*
TMath::Sin(
c*(theX[i]-rwtmin)/thetaNDC);
3875 norm = sqrt(xt*xt+yt*yt);
3880 if (!previouspointin) {
3885 a = (yt-yts)/(xt-xts);
3887 discr = 4*(
a*
a-
b*
b+1);
3888 x1 = (-2*
a*
b+sqrt(discr))/(2*(
a*
a+1));
3889 x2 = (-2*
a*
b-sqrt(discr))/(2*(
a*
a+1));
3892 norm1 = sqrt((
x1-xt)*(
x1-xt)+(
y1-yt)*(
y1-yt));
3893 norm2 = sqrt((
x2-xt)*(
x2-xt)+(
y2-yt)*(
y2-yt));
3894 previouspointin =
kFALSE;
3896 if (norm1 < norm2) {
3906 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3911 if (j>=1 && !previouspointin) {
3912 a = (yt-theYpol[j])/(xt-theXpol[j]);
3913 b = theYpol[j]-
a*theXpol[j];
3914 previouspointin =
kTRUE;
3915 discr = 4*(
a*
a-
b*
b+1);
3916 x1 = (-2*
a*
b+sqrt(discr))/(2*(
a*
a+1));
3917 x2 = (-2*
a*
b-sqrt(discr))/(2*(
a*
a+1));
3920 norm1 = sqrt((
x1-xt)*(
x1-xt)+(
y1-yt)*(
y1-yt));
3921 norm2 = sqrt((
x2-xt)*(
x2-xt)+(
y2-yt)*(
y2-yt));
3923 if (norm1 < norm2) {
3930 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3937 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3940 for (i=0; i<theNpoints; i++) {
3944 PaintGraph(theGraphPolar, theNpoints, theXpol, theYpol,opt);
3952 TIter next(
gPad->GetListOfPrimitives());
3953 while (
auto obj = next()) {
3957 if (strcmp(title->
GetName(),
"title")) {title =
nullptr;
continue;}
3961 if (title)
delete title;
3967 if (ht <= 0) ht = 0.05;
3988 if (talh < 1) talh = 1;
else if (talh > 3) talh = 3;
3990 if (talv < 1) talv = 1;
else if (talv > 3) talv = 3;
4032 TF1 *theF = theGraphQQ->
GetF();
4035 Error(
"TGraphQQ::Paint",
"2nd dataset or theoretical function not specified");
4050 Double_t yxmin, xymin, yxmax, xymax;
4056 TLine line1, line2, line3;
4059 yxmin = (theYq2-theYq1)*(
xmin-theXq1)/(theXq2-theXq1) + theYq1;
4061 xymin = (theXq2-theXq1)*(
ymin-theYq1)/(theYq2-theYq1) + theXq1;
4067 line2.
PaintLine(xqmin, yqmin, xqmax, yqmax);
4069 yxmax = (theYq2-theYq1)*(
xmax-theXq1)/(theXq2-theXq1) + theYq1;
4071 xymax = (theXq2-theXq1)*(
ymax-theYq1)/(theYq2-theYq1) + theXq1;
4114 if (lxp) opth.
Append(
"x+");
4115 if (lyp) opth.
Append(
"y+");
4140 XA1 =
gPad->GetUxmin();
4141 XA2 =
gPad->GetUxmax();
4142 YA1 =
gPad->GetUymin();
4143 YA2 =
gPad->GetUymax();
4180 if (
gPad->GetGridx()) {
4181 if (
gPad->GetLogy()) {
4184 GL = (YA2 - YA1) / (
gPad->GetY2() -
gPad->GetY1());
4192 TGaxis *theReversedXaxis;
4193 if (
gPad->GetLogx()) {
4206 theReversedXaxis =
new TGaxis(
gPad->GetUxmax(),
4220 theReversedXaxis->
Paint();
4224 if (
gPad->GetLogx()) {
4228 for (i=0; i<
N; i++) rX[i] = dX-
X[i];
4232 if (rEXhigh && EXlow)
for (i=0; i<
N; i++) rEXhigh[i] = EXlow[i];
4233 if (rEXlow && EXhigh)
for (i=0; i<
N; i++) rEXlow[i] = EXhigh[i];
4236 if (rEXhighd && EXlowd)
for (i=0; i<
N; i++) rEXhighd[i] = EXlowd[i];
4237 if (rEXlowd && EXhighd)
for (i=0; i<
N; i++) rEXlowd[i] = EXhighd[i];
4248 if (
gPad->GetGridy()) {
4249 if (
gPad->GetLogx()) {
4252 GL = (XA2 - XA1) / (
gPad->GetX2() -
gPad->GetX1());
4260 TGaxis *theReversedYaxis;
4261 if (
gPad->GetLogy()) {
4287 theReversedYaxis->
Paint();
4291 if (
gPad->GetLogy()) {
4295 for (i=0; i<
N; i++) rY[i] = dY-Y[i];
4299 if (rEYhigh && EYlow)
for (i=0; i<
N; i++) rEYhigh[i] = EYlow[i];
4300 if (rEYlow && EYhigh)
for (i=0; i<
N; i++) rEYlow[i] = EYhigh[i];
4303 if (rEYhighd && EYlowd)
for (i=0; i<
N; i++) rEYhighd[i] = EYlowd[i];
4304 if (rEYlowd && EYhighd)
for (i=0; i<
N; i++) rEYlowd[i] = EYhighd[i];
4308 if (rEYlowd)
for (i=0; i<
N; i++) rEYlowd[i] = -rEYlowd[i];
4309 if (rEYhighd)
for (i=0; i<
N; i++) rEYhighd[i] = -rEYhighd[i];
4312 if (rEXlowd)
for (i=0; i<
N; i++) rEXlowd[i] = -rEXlowd[i];
4313 if (rEXhighd)
for (i=0; i<
N; i++) rEXhighd[i] = -rEXhighd[i];
4338 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
4343 double *theColor = theScatter->
GetColor();
4344 double *theSize = theScatter->
GetSize();
4348 double minx = DBL_MAX;
4349 double maxx = -DBL_MAX;
4350 double miny = DBL_MAX;
4351 double maxy = -DBL_MAX;
4352 double minc = DBL_MAX;
4353 double maxc = -DBL_MAX;
4354 double mins = DBL_MAX;
4355 double maxs = -DBL_MAX;
4356 for (
int i=0; i<
n; i++) {
4374 if (theX[0] == 0.) {
4384 if (theY[0] == 0.) {
4395 if (theColor[0] == 0.) {
4400 minc = theColor[0] -
d;
4401 maxc = theColor[0] +
d;
4407 if (theSize[0] == 0.) {
4412 mins = theSize[0] -
d;
4413 maxs = theSize[0] +
d;
4419 if (optionAxis)
h->
Paint(
" ");
4430 functions->
Remove(palette);
4431 delete palette; palette =
nullptr;
4435 functions->
Remove(palette);
4436 delete palette; palette =
nullptr;
4459 if (palette) palette->
Paint();
4464 int logx =
gPad->GetLogx();
4465 int logy =
gPad->GetLogy();
4466 int logz =
gPad->GetLogz();
4467 if (theColor && logz) {
4468 if (minc>0) minc = log10(minc);
4469 if (maxc>0) maxc = log10(maxc);
4472 theScatter->TAttMarker::Modify();
4475 for (
int i=0; i<
n; i++) {
4478 if (theColor[i]>0)
c = log10(theColor[i]);
4484 if (nc > nbcol-1) nc = nbcol-1;
4488 ms = (MaxMarkerSize-MinMarkerSize)*((theSize[i]-mins)/(maxs-mins))+MinMarkerSize;
4491 if (theColor || theSize) theScatter->TAttMarker::Modify();
4493 if (theX[i]>0)
x = log10(theX[i]);
4499 if (theY[i]>0)
y = log10(theY[i]);
4504 gPad->PaintPolyMarker(1,&
x,&
y);
4525 if (!functions)
return;
4534 obj->Paint(lnk->GetOption());
4554 std::vector<Double_t> xf(2*
n);
4555 std::vector<Double_t> yf(2*
n);
4556 std::vector<Double_t> xt(
n);
4557 std::vector<Double_t> yt(
n);
4558 Double_t x1,
x2,
y1,
y2, x3, y3, xm, ym,
a, a1, a2, a3;
4561 Int_t ix1,iy1,ix2,iy2;
4565 gPad->GetPadPar(x1p,y1p,x2p,y2p);
4566 ix1 = (
Int_t)(iw*x1p);
4567 iy1 = (
Int_t)(ih*y1p);
4568 ix2 = (
Int_t)(iw*x2p);
4569 iy2 = (
Int_t)(ih*y2p);
4581 gPad->GetRange(rx1,ry1,rx2,ry2);
4582 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
4583 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
4587 xf[0] = rx*(
x[0]-rx1)+x1ndc;
4588 yf[0] = ry*(
y[0]-ry1)+y1ndc;
4590 for (i=1; i<
n; i++) {
4591 if (
x[i]==
x[i-1] &&
y[i]==
y[i-1])
continue;
4593 xf[nf] = rx*(
x[i]-rx1)+x1ndc;
4594 if (xf[i]==xf[i-1]) xf[i] += 0.000001;
4595 yf[nf] = ry*(
y[i]-ry1)+y1ndc;
4614 if (xf[nf]==xf[nf-1]) {
4619 if (xf[nf]>=xf[nf-1]) {
4628 for (i=1; i<nf; i++) {
4640 if (xi1<xi0) a1 = a1+3.14159;
4646 if (xi0<xi2) a2 = a2+3.14159;
4661 if ((xm-xi0)*(x3-xi0)<0 && (ym-yi0)*(y3-yi0)<0) {
4665 if ((xm==
x1) && (ym==
y1)) {
4674 if (xf[nf]==xf[0] && yf[nf]==yf[0]) {
4675 xm = (xt[nf]+xt[0])*0.5;
4676 ym = (yt[nf]+yt[0])*0.5;
4684 if ((xm-xf[0])*(x3-xf[0])<0 && (ym-yf[0])*(y3-yf[0])<0) {
4698 for (i=nf2; i>0; i--) {
4699 for (j=i-1; j>0; j--) {
4700 if (xt[i-1]==xt[i] || xt[j-1]==xt[j])
continue;
4701 c1 = (yt[i-1]-yt[i])/(xt[i-1]-xt[i]);
4702 b1 = yt[i]-
c1*xt[i];
4703 c2 = (yt[j-1]-yt[j])/(xt[j-1]-xt[j]);
4704 b2 = yt[j]-
c2*xt[j];
4706 xc = (b2-b1)/(
c1-
c2);
4712 nf++; xf[nf] = xt[i]; yf[nf] = yt[i];
4713 nf++; xf[nf] = xc ; yf[nf] = yc;
4731 nf++; xf[nf] = xt[0]; yf[nf] = yt[0];
4734 for (i=0; i<nf+1; i++) {
4735 xf[i] = (1/rx)*(xf[i]-x1ndc)+rx1;
4736 yf[i] = (1/ry)*(yf[i]-y1ndc)+ry1;
4740 gPad->PaintFillArea(nf+1,xf.data(),yf.data());
4741 theGraph->TAttLine::Modify();
4754 TIter next(functions);
4755 while (
auto obj = next()) {
4765 if (!dofit) fit =
nullptr;
4767 if (dofit == 1) dofit = 111;
4769 Int_t print_fval = dofit%10;
4770 Int_t print_ferrors = (dofit/10)%10;
4771 Int_t print_fchi2 = (dofit/100)%10;
4772 Int_t print_fprob = (dofit/1000)%10;
4773 Int_t nlinesf = print_fval + print_fchi2 + print_fprob;
4775 if (print_fval < 2) nlinesf += fit->GetNumberFreeParameters();
4776 else nlinesf += fit->GetNpar();
4812 Int_t ndf = fit->GetNDF();
4814 snprintf(t,64,textstats,fit->GetChisquare());
4815 if (print_fchi2) stats->
AddText(t);
4821 if (print_fval || print_ferrors) {
4823 for (
Int_t ipar=0;ipar<fit->GetNpar();ipar++) {
4824 fit->GetParLimits(ipar,parmin,parmax);
4825 if (print_fval < 2 && parmin*parmax != 0 && parmin >= parmax)
continue;
4826 if (print_ferrors) {
4828 snprintf(t,64,textstats,fit->GetParameter(ipar)
4829 ,fit->GetParError(ipar));
4832 snprintf(t,64,textstats,fit->GetParameter(ipar));
4839 if (!done) functions->
Add(stats);
4869 Int_t i, k, kp, km, npointsMax, banksize, n2, npt;
4870 Int_t maxiterations, finished;
4871 Int_t jtype, ktype, closed;
4872 Double_t sxmin, sxmax, symin, symax;
4875 Double_t ratio_signs, xratio, yratio;
4881 Double_t co, so, ct, st, ctu, stu, xnt;
4882 Double_t dx1, dy1, dx2, dy2, dk1, dk2;
4889 c = t = co = so = ct = st = ctu = stu = dx1 = dy1 = dx2 = dy2 = 0;
4890 xt = yt = xa = xb = ya = yb = u1 = u2 = u3 = tj = sb = 0;
4892 npointsMax = npoints*10;
4896 std::vector<Double_t> qlx(npointsMax);
4897 std::vector<Double_t> qly(npointsMax);
4898 if (qlx.empty() || qly.empty()) {
4899 Error(
"Smooth",
"not enough space in memory");
4906 jtype = (drawtype%1000)-10;
4907 if (jtype > 0) { ktype = jtype; loptx =
kTRUE; }
4908 else ktype = drawtype%1000;
4937 for (i=1;i<npoints;i++) {
4939 if ((
x[i]-
x[i-1])*(
x[i-1]-
x[i-2]) < 0) six++;
4940 if ((
y[i]-
y[i-1])*(
y[i-1]-
y[i-2]) < 0) siy++;
4942 if (
x[i] < sxmin) sxmin =
x[i];
4943 if (
x[i] > sxmax) sxmax =
x[i];
4944 if (
y[i] < symin) symin =
y[i];
4945 if (
y[i] > symax) symax =
y[i];
4950 if (dx1n < 0.01*(sxmax-sxmin) && dy1n < 0.01*(symax-symin)) closed = 1;
4951 if (sxmin == sxmax) {
4954 if (six > 1) ratio_signs = siy/six;
4955 else ratio_signs = 20;
4956 xratio = ratio_signs/(sxmax-sxmin);
4958 if (symin == symax) yratio = 1;
4959 else yratio = 1/(symax-symin);
4963 for (i=0;i<npoints;i++) {
4964 x[i] = (
x[i]-sxmin)*xratio;
4965 y[i] = (
y[i]-symin)*yratio;
4984 if (
x[0] !=
x[npoints-1] ||
y[0] !=
y[npoints-1])
goto L40;
4985 if (
x[npoints-2] ==
x[npoints-1] &&
y[npoints-2] ==
y[npoints-1])
goto L40;
4986 if (
x[0] ==
x[1] &&
y[0] ==
y[1])
goto L40;
5009 if (npt > 1)
goto L310;
5013 if (
x[k-1] ==
x[k-2] &&
y[k-1] ==
y[k-2])
goto L50;
5018 if (npt > 1)
goto L310;
5021 if (k < npoints)
goto L90;
5022 if (!flgic) { kp = 2;
goto L130;}
5025 if (flgis)
goto L150;
5035 if (
x[k-1] ==
x[k] &&
y[k-1] ==
y[k])
goto L80;
5043 if (!flgis)
goto L50;
5058 dx1 =
x[k-1] -
x[km-1];
5059 dy1 =
y[k-1] -
y[km-1];
5060 dk1 = dx1*dx1 + dy1*dy1;
5061 dx2 =
x[kp-1] -
x[k-1];
5062 dy2 =
y[kp-1] -
y[k-1];
5063 dk2 = dx2*dx2 + dy2*dy2;
5064 ctu = dx1*dk2 + dx2*dk1;
5065 stu = dy1*dk2 + dy2*dk1;
5066 xnt = ctu*ctu + stu*stu;
5080 if (flgis)
goto L160;
5084 w3 = 2*(dx1*dy2-dx2*dy1);
5096 w3 = 2*(dx1*dy2-dx2*dy1);
5105 if (k <= 1)
goto L120;
5135 xa = (
a*t-2*dx)/tcube;
5136 xb = (3*dx-(co+
a)*t)/tsquare;
5137 ya = (
b*t-2*dy)/tcube;
5138 yb = (3*dy-(so+
b)*t)/tsquare;
5169 p2 = (u1*tj-u3)*3*tj+u2;
5199 z = s*sth*(s-s*sth)*(w1*sth+w1+w2);
5200 z = z*z/((
a*
a+
b*
b)*(delta*delta));
5201 z = (z+2.642937)*z/((.3715652*z+3.063444)*z+.2441889)-cc;
5205 if (iw > 0)
goto L250;
5206 if (z > err)
goto L240;
5211 if (iw+2 == 0)
goto L190;
5212 if (iw+2 > 0)
goto L290;
5230 theGraph->
Zero(kp,0,sb,err,s,z,maxiterations);
5231 if (kp == 2)
goto L210;
5233 Error(
"Smooth",
"Attempt to plot outside plot limits");
5236 if (iw > 0)
goto L200;
5262 qlx[npt] = sxmin + xt/xratio;
5263 qly[npt] = symin + yt/yratio;
5270 if (npt < banksize)
goto L320;
5271 if (drawtype >= 1000 || ktype > 1) {
5272 Int_t newsize = banksize + n2;
5273 std::vector<Double_t> qtemp(banksize);
5274 for (i=0;i<banksize;i++) qtemp[i] = qlx[i];
5275 qlx.resize(newsize);
5276 for (i=0;i<banksize;i++) qlx[i] = qtemp[i];
5277 for (i=0;i<banksize;i++) qtemp[i] = qly[i];
5278 qly.resize(newsize);
5279 for (i=0;i<banksize;i++) qly[i] = qtemp[i];
5287 if (drawtype >= 1000) {
5288 gPad->PaintFillArea(npt,qlx.data(),qly.data(),
"B");
5292 qlx[npt] = qlx[npt-1];
5293 qlx[npt+1] = qlx[0];
5299 qly[npt] = qly[npt-1];
5300 qly[npt+1] = qly[0];
5302 gPad->PaintFillArea(npt+2,qlx.data(),qly.data());
5305 gPad->PaintPolyLine(npt,qlx.data(),qly.data());
5308 qlx[0] = sxmin + xt/xratio;
5309 qly[0] = symin + yt/yratio;
5311 if (finished > 0)
goto L390;
5312 if (finished < 0) { finished = 0;
goto L110;}
5313 if (s > 0)
goto L180;
5319 for (i=0;i<npoints;i++) {
5320 x[i] = sxmin +
x[i]/xratio;
5321 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)
Sets the border size of the TPave box and shadow.
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.