694 if (
gPad->GetLogx()) {
695 for (
Int_t i = 0; i < npoints; i++) {
699 for (
Int_t i = 0; i < npoints; i++)
702 if (!opt &&
gPad->GetLogy()) {
703 for (
Int_t i = 0; i < npoints; i++) {
707 for (
Int_t i = 0; i < npoints; i++)
726 if (distance <= 5)
return distance;
730 const Int_t big = 9999;
731 const Int_t kMaxDiff = 10;
741 theX = theGraphPolar->
GetXpol();
742 theY = theGraphPolar->
GetYpol();
744 theX = theGraph->
GetX();
745 theY = theGraph->
GetY();
749 for (i=0;i<theNpoints;i++) {
750 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
751 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
761 if (distance < kMaxDiff)
return distance;
763 for (i=0;i<theNpoints-1;i++) {
766 if (
d < distance) distance =
d;
781 TIter next(functions);
783 if (
f->InheritsFrom(
TF1::Class())) distance =
f->DistancetoPrimitive(-px,py);
784 else distance =
f->DistancetoPrimitive(px,py);
785 if (distance < kMaxDiff) {
786 gPad->SetSelected(
f);
802 Error(
"DrawPanel",
"need to draw graph first");
807 gROOT->ProcessLine(
TString::Format(
"((TCanvas*)0x%zx)->Selected((TVirtualPad*)0x%zx,(TObject*)0x%zx,1)",
808 (
size_t)
gPad->GetCanvas(), (
size_t)
gPad, (
size_t)theGraph));
830 const Int_t kMaxDiff = 10;
831 static Bool_t middle, badcase;
832 static Int_t ipoint, pxp, pyp;
833 static Int_t px1,px2,py1,py2;
834 static Int_t pxold, pyold, px1old, py1old, px2old, py2old;
835 static Int_t dpx, dpy;
836 static std::vector<Int_t>
x,
y;
843 if (!
gPad->IsEditable())
return;
853 theGraph->TAttLine::Modify();
854 px1 =
gPad->XtoAbsPixel(
gPad->GetX1());
855 py1 =
gPad->YtoAbsPixel(
gPad->GetY1());
856 px2 =
gPad->XtoAbsPixel(
gPad->GetX2());
857 py2 =
gPad->YtoAbsPixel(
gPad->GetY2());
861 if (!
x.empty() || !
y.empty())
break;
862 x.resize(theNpoints+1);
863 y.resize(theNpoints+1);
864 for (i=0;i<theNpoints;i++) {
865 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
866 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
867 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
873 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
874 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
875 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
876 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
881 if (
d < kMaxDiff) ipoint =i;
887 if (ipoint < 0)
return;
891 px2old =
gPad->XtoAbsPixel(theX[1]);
892 py2old =
gPad->YtoAbsPixel(theY[1]);
893 }
else if (ipoint == theNpoints-1) {
894 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[theNpoints-2]));
895 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[theNpoints-2]));
899 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint-1]));
900 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint-1]));
901 px2old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint+1]));
902 py2old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint+1]));
904 pxold =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint]));
905 pyold =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint]));
913 for (i=0;i<theNpoints;i++) {
914 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
915 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
917 if (
d < kMaxDiff) middle =
kFALSE;
929 for(i=0;i<theNpoints-1;i++) {
930 gVirtualX->DrawLine(
x[i]+dpx,
y[i]+dpy,
x[i+1]+dpx,
y[i+1]+dpy);
933 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
934 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
935 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
936 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
937 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
938 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
940 pxp =
x[theNpoints-1]+dpx;
941 pyp =
y[theNpoints-1]+dpy;
942 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
943 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
944 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
945 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
950 for(i=0;i<theNpoints-1;i++) {
951 gVirtualX->DrawLine(
x[i]+dpx,
y[i]+dpy,
x[i+1]+dpx,
y[i+1]+dpy);
954 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
955 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
956 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
957 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
958 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
959 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
961 pxp =
x[theNpoints-1]+dpx;
962 pyp =
y[theNpoints-1]+dpy;
963 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
964 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
965 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
966 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
968 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
969 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
970 gVirtualX->DrawLine(pxold-4, pyold-4, pxold+4, pyold-4);
971 gVirtualX->DrawLine(pxold+4, pyold-4, pxold+4, pyold+4);
972 gVirtualX->DrawLine(pxold+4, pyold+4, pxold-4, pyold+4);
973 gVirtualX->DrawLine(pxold-4, pyold+4, pxold-4, pyold-4);
980 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
981 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
982 gVirtualX->DrawLine(pxold-4, pyold-4, pxold+4, pyold-4);
983 gVirtualX->DrawLine(pxold+4, pyold-4, pxold+4, pyold+4);
984 gVirtualX->DrawLine(pxold+4, pyold+4, pxold-4, pyold+4);
985 gVirtualX->DrawLine(pxold-4, pyold+4, pxold-4, pyold-4);
994 dxr = dx/(1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
995 dyr = dy/(1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
1001 ymin - dyr*
gPad->GetBottomMargin(),
1011 for(i=0;i<theNpoints;i++) {
1012 if (badcase)
continue;
1013 if (!
x.empty()) theX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(
x[i]+dpx));
1014 if (!
y.empty()) theY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i]+dpy));
1023 theX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
1024 theY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));
1028 theX[theNpoints-1] = theX[0];
1029 theY[theNpoints-1] = theY[0];
1031 if (ipoint == theNpoints-1) {
1032 theX[0] = theX[theNpoints-1];
1033 theY[0] = theY[theNpoints-1];
1045 if (
gROOT->IsEscaped()) {
1059 dxr = dx/(1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
1060 dyr = dy/(1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
1066 ymin - dyr*
gPad->GetBottomMargin(),
1072 for(i=0;i<theNpoints;i++) {
1073 if (badcase)
continue;
1074 if (!
x.empty()) theX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(
x[i]+dpx));
1075 if (!
y.empty()) theY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i]+dpy));
1078 theX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
1079 theY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));
1083 theX[theNpoints-1] = theX[0];
1084 theY[theNpoints-1] = theY[0];
1086 if (ipoint == theNpoints-1) {
1087 theX[0] = theX[theNpoints-1];
1088 theY[0] = theY[theNpoints-1];
1142 const Int_t kHighlightRange = 50;
1143 static Int_t distanceOld = kHighlightRange;
1146 if ((distance < kHighlightRange) && (distance < distanceOld)) {
1184 if (
gPad->GetLogx()) {
1188 if (
gPad->GetLogy()) {
1192 if ((hx < uxmin) || (hx > uxmax))
return;
1193 if ((hy < uymin) || (hy > uymax))
return;
1217 strlcpy(chopt,
option,80);
1220 char *l1 = strstr(chopt,
"pfc");
1221 char *l2 = strstr(chopt,
"plc");
1222 char *l3 = strstr(chopt,
"pmc");
1223 if (l1 || l2 || l3) {
1232 char *l4 = strstr(chopt,
"rx");
1233 char *l5 = strstr(chopt,
"ry");
1267 TIter next(functions);
1275 if (palette) palette->
Paint();
1289 gPad->PushSelectableObject(theGraph);
1291 Int_t optionLine , optionAxis , optionCurve , optionStar , optionMark;
1292 Int_t optionBar , optionR , optionOne , optionE;
1293 Int_t optionFill , optionZ , optionCurveFill, optionIAxis;
1294 Int_t i, npt, nloop;
1297 Double_t barxmin, barxmax, barymin, barymax;
1304 Error(
"PaintGraph",
"illegal number of points (%d)", npoints);
1311 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1312 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1313 if (opt.
Contains(
"C")) optionCurve = 1;
else optionCurve = 0;
1314 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1315 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1316 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1317 if (opt.
Contains(
"R")) optionR = 1;
else optionR = 0;
1318 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1319 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1320 if (opt.
Contains(
"I")) optionIAxis = 1;
else optionIAxis = 0;
1326 if (optionLine+optionFill+optionCurve+optionStar+optionMark+optionBar+optionE == 0) {
1327 if (!chopt[0]) optionLine=1;
1333 optionCurveFill = 0;
1334 if (optionCurve && optionFill) {
1335 optionCurveFill = 1;
1340 Double_t rwxmin,rwxmax, rwymin, rwymax, maximum, minimum, dx, dy;
1343 rwxmin =
gPad->GetUxmin();
1344 rwxmax =
gPad->GetUxmax();
1345 rwymin =
gPad->GetUymin();
1346 rwymax =
gPad->GetUymax();
1349 if (minimum == -1111) {
1353 if (maximum == -1111) {
1357 uxmin =
gPad->PadtoX(rwxmin);
1358 uxmax =
gPad->PadtoX(rwxmax);
1361 theGraph->
ComputeRange(rwxmin, rwymin, rwxmax, rwymax);
1363 if (rwxmin == rwxmax) rwxmax += 1.;
1364 if (rwymin == rwymax) rwymax += 1.;
1365 dx = 0.1*(rwxmax-rwxmin);
1366 dy = 0.1*(rwymax-rwymin);
1367 uxmin = rwxmin - dx;
1368 uxmax = rwxmax + dx;
1369 minimum = rwymin - dy;
1370 maximum = rwymax + dy;
1374 if (uxmin < 0 && rwxmin >= 0) uxmin = 0.9*rwxmin;
1375 if (uxmax > 0 && rwxmax <= 0) {
1376 if (
gPad->GetLogx()) uxmax = 1.1*rwxmax;
1379 if (minimum < 0 && rwymin >= 0) minimum = 0.9*rwymin;
1380 if (maximum > 0 && rwymax <= 0) {
1384 if (minimum <= 0 && gPad->GetLogy()) minimum = 0.001*maximum;
1385 if (uxmin <= 0 && gPad->GetLogx()) {
1386 if (uxmax > 1000) uxmin = 1;
1387 else uxmin = 0.001*uxmax;
1394 char chopth[8] =
" ";
1395 if (strstr(chopt,
"x+")) strncat(chopth,
"x+",3);
1396 if (strstr(chopt,
"y+")) strncat(chopth,
"y+",3);
1397 if (optionIAxis) strncat(chopth,
"A",2);
1404 if (theNpoints > npt) npt = theNpoints;
1416 if (
gPad->GetLogy()) {
1429 rwxmin =
gPad->GetUxmin();
1430 rwxmax =
gPad->GetUxmax();
1431 rwymin =
gPad->GetUymin();
1432 rwymax =
gPad->GetUymax();
1433 uxmin =
gPad->PadtoX(rwxmin);
1434 uxmax =
gPad->PadtoX(rwxmax);
1439 maximum =
gPad->PadtoY(rwymax);
1440 minimum =
gPad->PadtoY(rwymin);
1444 theGraph->TAttLine::Modify();
1445 theGraph->TAttFill::Modify();
1446 theGraph->TAttMarker::Modify();
1449 gxwork.resize(2*npoints+10);
1450 gywork.resize(2*npoints+10);
1454 if (optionLine || optionFill) {
1460 if (optionFill && (xn !=
x1 || yn !=
y1)) nloop++;
1462 for (i=1;i<=nloop;i++) {
1506 if (optionCurveFill) {
1508 if (xn !=
x1 || yn !=
y1) nloop++;
1512 for (i=1;i<=nloop;i++) {
1537 for (i=1;i<=nloop;i++) {
1541 if (
y[i-1] < minimum ||
y[i-1] > maximum)
continue;
1542 if (
x[i-1] < uxmin ||
x[i-1] > uxmax)
continue;
1568 for (i=1;i<=npoints;i++) {
1583 for (i=1;i<=npoints;i++) {
1598 if(FillSave ==
gPad->GetFrameFillColor()) {
1600 if (
gPad->GetFrameFillColor()==1) {
1602 theGraph->TAttFill::Modify();
1605 theGraph->TAttFill::Modify();
1611 for (i=1;i<npoints;i++) {
1612 if (
x[i] < barxmin) barxmin =
x[i];
1613 if (
x[i] > barxmax) barxmax =
x[i];
1615 bdelta = (barxmax-barxmin)/
Double_t(npoints);
1619 for (i=1;i<npoints;i++) {
1620 if (
y[i] < barymin) barymin =
y[i];
1621 if (
y[i] > barymax) barymax =
y[i];
1623 bdelta = (barymax-barymin)/
Double_t(npoints);
1627 for (i=1;i<=npoints;i++) {
1628 xlow =
x[i-1] - dbar;
1629 xhigh =
x[i-1] + dbar;
1631 if (xlow < uxmin && xhigh < uxmin)
continue;
1632 if (xhigh > uxmax && xlow > uxmax)
continue;
1633 if (xlow < uxmin) xlow = uxmin;
1634 if (xhigh > uxmax) xhigh = uxmax;
1636 else ylow =
gPad->GetUymin();
1650 for (i=1;i<=npoints;i++) {
1652 ylow =
y[i-1] - dbar;
1653 yhigh =
y[i-1] + dbar;
1664 theGraph->TAttFill::Modify();
1708 const char *where =
"PaintGrapHist";
1710 Int_t optionLine , optionAxis , optionCurve, optionStar, optionMark;
1711 Int_t optionBar , optionRot , optionOne , optionOff ;
1712 Int_t optionFill , optionZ;
1713 Int_t optionHist , optionBins , optionMarker;
1715 Int_t drawtype=0, drawborder, drawbordersav;
1721 Double_t xi, xi1, xj, xj1, yi1, yi, yj, yj1, xwmin, ywmin;
1722 Int_t first, last, nbins;
1725 char choptaxis[10] =
" ";
1728 Error(where,
"illegal number of points (%d)", npoints);
1733 if (opt.
Contains(
"H")) optionHist = 1;
else optionHist = 0;
1734 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1735 if (opt.
Contains(
"C")) optionCurve= 1;
else optionCurve= 0;
1736 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1737 if (opt.
Contains(
"R")) optionRot = 1;
else optionRot = 0;
1738 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1739 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1740 if (opt.
Contains(
"N")) optionBins = 1;
else optionBins = 0;
1741 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1742 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1743 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1744 if (opt.
Contains(
"][")) optionOff = 1;
else optionOff = 0;
1745 if (opt.
Contains(
"P0")) optionMark = 10;
1747 Int_t optionFill2 = 0;
1749 optionFill = 0; optionFill2 = 1;
1764 nbins = last - first + 1;
1776 Double_t rounding = (uxmax-uxmin)*1.e-5;
1779 Int_t nx1, nx2, ndivx, ndivy, ndiv;
1792 if (ndivx < 0) strlcat(choptaxis,
"N",10);
1793 if (
gPad->GetGridx()) {
1795 strlcat(choptaxis,
"W",10);
1797 if (
gPad->GetLogx()) {
1801 strlcat(choptaxis,
"G",10);
1811 axis.
PaintAxis(rwxmin,rwymin,rwxmax,rwymin,rwmin,rwmax,ndiv,choptaxis);
1821 strlcat(choptaxis,
"N",10);
1824 if (
gPad->GetGridy()) {
1826 strlcat(choptaxis,
"W",10);
1828 if (
gPad->GetLogy()) {
1832 strlcat(choptaxis,
"G",10);
1841 axis.
PaintAxis(rwxmin,rwymin,rwxmin,rwymax,rwmin,rwmax,ndiv,choptaxis);
1846 theGraph->TAttLine::Modify();
1847 theGraph->TAttFill::Modify();
1848 theGraph->TAttMarker::Modify();
1857 Int_t fwidth =
gPad->GetFrameLineWidth();
1860 if (optionOff) fwidth = 1;
1871 gxwork.resize(2*npoints+10);
1872 gywork.resize(2*npoints+10);
1876 if (optionFill && !optionCurve) {
1884 for (j=first; j<=last;j++) {
1891 xj1 =
x[j]; xj =
x[j-1];
1893 if (j != last)
Error(where,
"X must be in increasing order");
1894 else Error(where,
"X must have N+1 values with option N");
1902 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1903 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1916 if (!fillarea)
gyworkl[0] = ylast;
1927 for (j=first; j<=last;j++) {
1932 yj1 =
y[j]; yj =
y[j-1];
1934 if (j != last)
Error(where,
"Y must be in increasing order");
1935 else Error(where,
"Y must have N+1 values with option N");
1941 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1942 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1949 if (!fillarea)
gyworkl[0] = ylast;
1956 theGraph->TAttLine::Modify();
1957 theGraph->TAttFill::Modify();
1962 if ((optionHist) || !chopt[0]) {
1970 for (i=first; i<=last;i++) {
1975 xi1 =
x[i]; xi =
x[i-1];
1977 if (i != last)
Error(where,
"X must be in increasing order");
1978 else Error(where,
"X must have N+1 values with option N");
1986 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1987 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1999 Int_t nbpoints = npt-2;
2005 for (ip=point1; ip<=nbpoints; ip++) {
2012 Int_t point2 = nbpoints;
2013 for (ip=point2; ip>=point1; ip--) {
2019 nbpoints = point2-point1+1;
2023 if (
gxwork[0] >
gPad->GetUxmin()) { nbpoints++; point1 = 0; }
2024 if (
gxwork[nbpoints] <
gPad->GetUxmax()) nbpoints++;
2027 gPad->PaintPolyLine(nbpoints,
gxworkl.data() + point1,
gyworkl.data() + point1, noClip);
2037 for (i=first; i<=last;i++) {
2042 yi1 =
y[i]; yi =
y[i-1];
2044 if (i != last)
Error(where,
"Y must be in increasing order");
2045 else Error(where,
"Y must have N+1 values with option N");
2051 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
2052 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
2071 if (!optionOne) drawtype = 2;
2076 for (i=first; i<=last;i++) {
2079 gxwork[npt-1] =
wmin+(i-first)*delta+0.5*delta;
2081 xi1 =
x[i]; xi =
x[i-1];
2083 if (i != last)
Error(where,
"X must be in increasing order");
2084 else Error(where,
"X must have N+1 values with option N");
2087 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2118 drawtype = drawtype+10;
2120 for (i=first; i<=last;i++) {
2123 gywork[npt-1] =
wmin+(i-first)*delta+0.5*delta;
2125 yi1 =
y[i]; yi =
y[i-1];
2127 if (i != last)
Error(where,
"Y must be in increasing order");
2128 else Error(where,
"Y must have N+1 values with option N");
2131 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2164 wminstep =
wmin + 0.5*delta;
2166 gPad->GetRangeAxis(ax1,ay1,ax2,ay2);
2170 for (i=first; i<=last;i++) {
2173 gxwork[npt-1] =
wmin+(i-first)*delta+0.5*delta;
2175 xi1 =
x[i]; xi =
x[i-1];
2177 if (i != last)
Error(where,
"X must be in increasing order");
2178 else Error(where,
"X must have N+1 values with option N");
2181 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2183 if (
gxwork[npt-1] < uxmin ||
gxwork[npt-1] > uxmax) { npt--;
continue;}
2186 if ((
gywork[npt-1] < rwymin) || ((
gywork[npt-1] > rwymax) && !optionFill2)) {
2223 for (i=first; i<=last;i++) {
2226 gywork[npt-1] = wminstep+(i-first)*delta+0.5*delta;
2228 yi1 =
y[i]; yi =
y[i-1];
2230 if (i != last)
Error(where,
"Y must be in increasing order");
2231 else Error(where,
"Y must have N+1 values with option N");
2234 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2237 if ((
gxwork[npt-1] < uxmin) || (
gxwork[npt-1] > uxmax)) {
2259 if (optionLine != 0 && npt > 1) {
2270 offset = delta*baroffset; dbar = delta*barwidth;
2274 dbar = (
x[1]-
x[0])*barwidth;
2277 dbar = (
y[1]-
y[0])*barwidth;
2280 drawbordersav = drawborder;
2287 else ylow =
gPad->GetUymin();
2289 for (i=first; i<=last;i++) {
2296 if (xlow < rwxmax && xhigh > rwxmin)
2300 xhigh = xhigh+delta;
2303 xi1 =
x[i]; xi =
x[i-1];
2305 Error(where,
"X must be in increasing order");
2309 dbar = (
x[i+1]-
x[i])*barwidth;
2319 else xlow =
gPad->GetUxmin();
2320 for (i=first; i<=last;i++) {
2328 gPad->PaintBox(xlow,ylow,xhigh,yhigh);
2330 ylow = ylow + delta;
2331 yhigh = yhigh + delta;
2334 yi1 =
y[i]; yi =
y[i-1];
2336 Error(where,
"Y must be in increasing order");
2340 dbar = (
y[i+1]-
y[i])*barwidth;
2353 if ((optionStar) || (optionMark)) optionMarker=1;
2359 for (i=first; i<=last;i++) {
2360 if (!optionBins) xm =
wmin+(i-first)*delta+0.5*delta;
2361 else xm =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2363 if (optionMark != 10) {
2364 if (ym<rwymax && ym > rwymin) {
2370 if (ym<rwymax && ym >= rwymin) {
2387 wminstep =
wmin + 0.5*delta;
2388 for (i=first; i<=last;i++) {
2389 if (!optionBins) ym = wminstep+(i-first)*delta+0.5*delta;
2390 else ym =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2392 if (optionMark != 10) {
2393 if (xm<rwxmax && xm > rwxmin) {
2399 if (xm<rwxmax && xm >= rwxmin) {
2434 std::vector<Double_t> xline, yline;
2439 const Int_t kBASEMARKER=8;
2440 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};
2441 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};
2460 const char *arrowOpt =
nullptr;
2461 if (strchr(
option,
'>')) arrowOpt =
">";
2462 if (strstr(
option,
"|>")) arrowOpt =
"|>";
2487 xline.resize(2*theNpoints);
2488 yline.resize(2*theNpoints);
2489 if (xline.empty() || yline.empty()) {
2490 Error(
"PaintGraphAsymmErrors",
"too many points, out of memory");
2497 theGraph->TAttLine::Modify();
2512 Double_t sbase = symbolsize*kBASEMARKER;
2516 if (mark >= 20 && mark <= 49) {
2527 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2532 Bool_t DrawXLeft, DrawXRight, DrawYUp, DrawYLow;
2534 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup, yup1, yup2, ylow, ylow1, ylow2;
2535 for (
Int_t i=0;i<theNpoints;i++) {
2540 x =
gPad->XtoPad(theX[i]);
2541 y =
gPad->YtoPad(theY[i]);
2545 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
2546 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
2547 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
2548 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
2550 if (x < gPad->GetUxmin())
continue;
2551 if (
x >
gPad->GetUxmax())
continue;
2552 if (y < gPad->GetUymin())
continue;
2553 if (
y >
gPad->GetUymax())
continue;
2573 xl2 =
gPad->XtoPad(theX[i] - exl);
2575 xr2 =
gPad->XtoPad(theX[i] + exh);
2576 if (xl1 < xl2) DrawXLeft =
kFALSE;
2577 if (xr1 > xr2) DrawXRight =
kFALSE;
2591 yup2 =
gPad->YtoPad(theY[i] + eyh);
2593 ylow2 =
gPad->YtoPad(theY[i] - eyl);
2594 if (yup2 < yup1) DrawYUp =
kFALSE;
2595 if (ylow2 > ylow1) DrawYLow =
kFALSE;
2599 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2600 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2608 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2609 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2610 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2611 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2612 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2613 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2614 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2615 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2616 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2617 else box.PaintBox(x1b, y1b, x2b, y2b);
2625 yline[if1-1] = yup2;
2626 yline[if2-1] = ylow2;
2632 if (exl != 0. || exh != 0.) {
2634 if (exl != 0. && DrawXLeft)
arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
2635 if (exh != 0. && DrawXRight)
arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
2638 if (exl != 0. && DrawXLeft)
gPad->PaintLine(xl1,
y,xl2,
y);
2639 if (exh != 0. && DrawXRight)
gPad->PaintLine(xr1,
y,xr2,
y);
2643 if (exl != 0. && DrawXLeft) {
2644 xb[0] = xl2+tx; yb[0] =
y-ty;
2645 xb[1] = xl2; yb[1] =
y-ty;
2646 xb[2] = xl2; yb[2] =
y+ty;
2647 xb[3] = xl2+tx; yb[3] =
y+ty;
2648 gPad->PaintPolyLine(4, xb, yb);
2650 if (exh != 0. && DrawXRight) {
2651 xb[0] = xr2-tx; yb[0] =
y-ty;
2652 xb[1] = xr2; yb[1] =
y-ty;
2653 xb[2] = xr2; yb[2] =
y+ty;
2654 xb[3] = xr2-tx; yb[3] =
y+ty;
2655 gPad->PaintPolyLine(4, xb, yb);
2658 if (DrawXLeft)
gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
2659 if (DrawXRight)
gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
2665 if (eyl != 0. || eyh != 0.) {
2667 if (eyh != 0. && DrawYUp) {
2668 if (yup2 == yup)
arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
2669 else gPad->PaintLine(
x,yup1,
x,yup2);
2671 if (eyl != 0. && DrawYLow) {
2672 if (ylow2 == ylow)
arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
2673 else gPad->PaintLine(
x,ylow1,
x,ylow2);
2677 if (eyh != 0. && DrawYUp)
gPad->PaintLine(
x,yup1,
x,yup2);
2678 if (eyl != 0. && DrawYLow)
gPad->PaintLine(
x,ylow1,
x,ylow2);
2682 if (eyh != 0. && yup2 == yup && DrawYUp) {
2683 xb[0] =
x-tx; yb[0] = yup2-ty;
2684 xb[1] =
x-tx; yb[1] = yup2;
2685 xb[2] =
x+tx; yb[2] = yup2;
2686 xb[3] =
x+tx; yb[3] = yup2-ty;
2687 gPad->PaintPolyLine(4, xb, yb);
2689 if (eyl != 0. && ylow2 == ylow && DrawYLow) {
2690 xb[0] =
x-tx; yb[0] = ylow2+ty;
2691 xb[1] =
x-tx; yb[1] = ylow2;
2692 xb[2] =
x+tx; yb[2] = ylow2;
2693 xb[3] =
x+tx; yb[3] = ylow2+ty;
2694 gPad->PaintPolyLine(4, xb, yb);
2697 if (eyh != 0. && yup2 == yup && DrawYUp)
gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
2698 if (eyl != 0. && ylow2 == ylow && DrawYLow)
gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
2712 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
2713 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
2714 gPad->SetLogx(logx);
2715 gPad->SetLogy(logy);
2731 Int_t NYErrors = tg->GetNYErrors();
2732 if (NYErrors <= 0) {
2740 std::vector<TString> options(NYErrors + 1);
2749 while ((firstSemicolon = tsOpt.
First(
';')) !=
kNPOS && filled <= NYErrors) {
2750 options[filled] = tsOpt(0, firstSemicolon);
2751 tsOpt = tsOpt(firstSemicolon + 1, tsOpt.
Length());
2755 if (filled <= NYErrors) {
2756 options[filled] = tsOpt.
Copy();
2760 for (
Int_t i = filled; i <= NYErrors; i++)
2763 std::vector<Double_t> xline;
2764 std::vector<std::vector<Double_t>> yline(NYErrors);
2769 const Int_t kBASEMARKER = 8;
2770 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};
2771 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};
2772 Int_t theNpoints = tg->GetN();
2776 Double_t *theExH = tg->GetEXhigh();
2777 std::vector<Double_t *> theEyL(NYErrors);
2778 std::vector<Double_t *> theEyH(NYErrors);
2781 for (
Int_t j = 0; j < NYErrors; j++) {
2782 theEyL[j] = tg->GetEYlow(j);
2783 theEyH[j] = tg->GetEYhigh(j);
2784 theEyExists &= (theEyL[j] && theEyH[j]);
2787 if (!theX || !theY || !theExL || !theExH || !theEyExists)
2790 std::vector<Bool_t> DrawErrors(NYErrors);
2795 std::vector<Bool_t> Braticks(NYErrors);
2796 std::vector<Bool_t> Brackets(NYErrors);
2797 std::vector<Bool_t> EndLines(NYErrors);
2798 std::vector<Char_t *> ArrowOpt(NYErrors);
2799 std::vector<Bool_t> Option5(NYErrors);
2800 std::vector<Bool_t> Option4(NYErrors);
2801 std::vector<Bool_t> Option3(NYErrors);
2803 std::vector<Bool_t> Option2(NYErrors);
2804 std::vector<Bool_t> Option0(NYErrors);
2806 std::vector<Double_t> Scale(NYErrors);
2808 const TRegexp ScaleRegExp(
"s=*[0-9]\\.*[0-9]");
2810 for (
Int_t j = 0; j < NYErrors; j++) {
2811 if (options[j + 1].Contains(
"s=")) {
2812 sscanf(strstr(options[j + 1].Data(),
"s="),
"s=%lf", &Scale[j]);
2813 options[j + 1].ReplaceAll(options[j + 1](ScaleRegExp),
"");
2817 DrawErrors[j] = !options[j + 1].Contains(
"x");
2818 AnyErrors |= DrawErrors[j];
2819 Braticks[j] = options[j + 1].Contains(
"[]");
2820 Brackets[j] = options[j + 1].Contains(
"||") || Braticks[j];
2821 EndLines[j] = !options[j + 1].Contains(
"z");
2823 if (options[j + 1].Contains(
"|>"))
2824 ArrowOpt[j] = (
Char_t *)
"|>";
2825 else if (options[j + 1].Contains(
">"))
2826 ArrowOpt[j] = (
Char_t *)
">";
2828 ArrowOpt[j] =
nullptr;
2830 Option5[j] = options[j + 1].Contains(
"5");
2831 Option4[j] = options[j + 1].Contains(
"4");
2832 Option3[j] = options[j + 1].Contains(
"3") || Option4[j];
2833 AnyOption3 |= Option3[j];
2834 Option2[j] = options[j + 1].Contains(
"2") || Option5[j];
2835 Option0[j] = options[j + 1].Contains(
"0");
2836 AnyOption0 |= Option0[j];
2838 NoErrorsX &= (Option3[j] || Option2[j]);
2839 Option0X |= !(Option3[j] || Option2[j]) && Option0[j];
2840 DrawMarker |= !(Brackets[j] || Option3[j] || Option2[j]);
2843 Bool_t Draw0PointsX = !options[0].Contains(
"x0") && (
gPad->GetLogx() == 0);
2844 Bool_t Draw0PointsY = !options[0].Contains(
"y0") && (
gPad->GetLogy() == 0);
2845 options[0].ReplaceAll(
"x0",
"");
2846 options[0].ReplaceAll(
"y0",
"");
2848 Bool_t DrawErrorsX = !options[0].Contains(
"x");
2849 Bool_t BraticksX = options[0].Contains(
"[]");
2850 Bool_t BracketsX = options[0].Contains(
"||") || BraticksX;
2851 Bool_t EndLinesX = !options[0].Contains(
"z");
2853 Char_t *ArrowOptX =
nullptr;
2854 if (options[0].Contains(
"|>"))
2855 ArrowOptX = (
Char_t *)
"|>";
2856 else if (options[0].Contains(
">"))
2857 ArrowOptX = (
Char_t *)
">";
2860 if (options[0].Contains(
"s=")) {
2861 sscanf(strstr(options[0].Data(),
"s="),
"s=%lf", &ScaleX);
2862 options[0].ReplaceAll(options[0](ScaleRegExp),
"");
2865 if (!AnyErrors && !DrawErrorsX) {
2870 Bool_t DrawAxis = options[0].Contains(
"a");
2871 Bool_t IndividualStyles = options[0].Contains(
"s");
2876 Int_t NPointsInside = AnyOption0 ? theNpoints : 0;
2879 for (
Int_t i = 0; i < theNpoints && !AnyOption0; i++) {
2880 x =
gPad->XtoPad(theX[i]);
2881 y =
gPad->YtoPad(theY[i]);
2883 if ((
x >=
gPad->GetUxmin()) && (x <= gPad->GetUxmax()) && (
y >=
gPad->GetUymin()) && (y <= gPad->GetUymax()) &&
2884 (Draw0PointsX || theX[i] != 0.) && (Draw0PointsY || theY[i] != 0.))
2889 xline.resize(2 * NPointsInside);
2891 if (xline.empty()) {
2892 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2897 if2 = 2 * NPointsInside;
2900 for (
Int_t j = 0; j < NYErrors; j++) {
2901 if (Option3[j] && DrawErrors[j]) {
2902 yline[j].resize(2 * NPointsInside);
2904 if (yline[j].empty()) {
2905 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2911 tg->TAttLine::Modify();
2914 arrow.SetLineWidth(tg->GetLineWidth());
2915 arrow.SetLineColor(tg->GetLineColor());
2916 arrow.SetFillColor(tg->GetFillColor());
2920 box.SetLineWidth(tg->GetLineWidth());
2921 box.SetLineColor(tg->GetLineColor());
2922 box.SetFillColor(tg->GetFillColor());
2923 box.SetFillStyle(tg->GetFillStyle());
2925 Double_t symbolsize = tg->GetMarkerSize();
2926 Double_t sbase = symbolsize * kBASEMARKER;
2931 if (mark >= 20 && mark <= 49) {
2932 cx = cxx[mark - 20];
2933 cy = cyy[mark - 20];
2942 Float_t asize = 0.6 * symbolsize * kBASEMARKER /
gPad->GetWh();
2947 Double_t xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
2948 for (
Int_t i = 0; i < theNpoints; i++) {
2949 x =
gPad->XtoPad(theX[i]);
2950 y =
gPad->YtoPad(theY[i]);
2953 (
x <
gPad->GetUxmin()) || (
x >
gPad->GetUxmax()) || (y < gPad->GetUymin()) || (
y >
gPad->GetUymax());
2955 if ((isOutside && !AnyOption0) || (!Draw0PointsX && theX[i] == 0.) || (!Draw0PointsY && theY[i] == 0.))
2960 if (x < gPad->GetUxmin())
2961 x =
gPad->GetUxmin();
2962 if (
x >
gPad->GetUxmax())
2963 x =
gPad->GetUxmax();
2964 if (y < gPad->GetUymin())
2965 y =
gPad->GetUymin();
2966 if (
y >
gPad->GetUymax())
2967 y =
gPad->GetUymax();
2977 for (
Int_t j = 0; j < NYErrors; j++) {
2982 if (Option2[j] && (!isOutside || Option0[j])) {
2983 if (IndividualStyles) {
2984 box.SetLineWidth(tg->GetLineWidth(j));
2985 box.SetLineColor(tg->GetLineColor(j));
2986 box.SetFillColor(tg->GetFillColor(j));
2987 box.SetFillStyle(tg->GetFillStyle(j));
2990 x1b =
gPad->XtoPad(theX[i] - Scale[j] * theExL[i]);
2991 y1b =
gPad->YtoPad(theY[i] - theEyL[j][i]);
2992 x2b =
gPad->XtoPad(theX[i] + Scale[j] * theExH[i]);
2993 y2b =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2994 if (x1b < gPad->GetUxmin())
2995 x1b =
gPad->GetUxmin();
2996 if (x1b >
gPad->GetUxmax())
2997 x1b =
gPad->GetUxmax();
2998 if (y1b < gPad->GetUymin())
2999 y1b =
gPad->GetUymin();
3000 if (y1b >
gPad->GetUymax())
3001 y1b =
gPad->GetUymax();
3002 if (x2b < gPad->GetUxmin())
3003 x2b =
gPad->GetUxmin();
3004 if (x2b >
gPad->GetUxmax())
3005 x2b =
gPad->GetUxmax();
3006 if (y2b < gPad->GetUymin())
3007 y2b =
gPad->GetUymin();
3008 if (y2b >
gPad->GetUymax())
3009 y2b =
gPad->GetUymax();
3011 box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3013 box.PaintBox(x1b, y1b, x2b, y2b);
3018 if (!isOutside || Option0[j]) {
3019 yline[j][if1 - 2] =
gPad->YtoPad(theY[i] + theEyH[j][i]);
3020 yline[j][if2] =
gPad->YtoPad(theY[i] - theEyL[j][i]);
3022 yline[j][if1 - 2] =
gPad->GetUymin();
3023 yline[j][if2] =
gPad->GetUymin();
3027 if (IndividualStyles) {
3028 tg->GetAttLine(j)->Modify();
3030 arrow.SetLineWidth(tg->GetLineWidth(j));
3031 arrow.SetLineColor(tg->GetLineColor(j));
3032 arrow.SetFillColor(tg->GetFillColor(j));
3035 ylow1 =
y - s2y * cy;
3036 ylow2 =
gPad->YtoPad(theY[i] - theEyL[j][i]);
3037 if (ylow2 < gPad->GetUymin())
3038 ylow2 =
gPad->GetUymin();
3039 if (ylow2 < ylow1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
3041 arrow.PaintArrow(
x, ylow1,
x, ylow2, asize, ArrowOpt[j]);
3044 gPad->PaintLine(
x, ylow1,
x, ylow2);
3055 gPad->PaintPolyLine(4, xb, yb);
3057 gPad->PaintLine(
x - tx, ylow2,
x + tx, ylow2);
3062 yup1 =
y + s2y * cy;
3063 yup2 =
gPad->YtoPad(theY[i] + theEyH[j][i]);
3064 if (yup2 >
gPad->GetUymax())
3065 yup2 =
gPad->GetUymax();
3066 if (yup2 > yup1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
3068 arrow.PaintArrow(
x, yup1,
x, yup2, asize, ArrowOpt[j]);
3071 gPad->PaintLine(
x, yup1,
x, yup2);
3082 gPad->PaintPolyLine(4, xb, yb);
3084 gPad->PaintLine(
x - tx, yup2,
x + tx, yup2);
3091 if (IndividualStyles) {
3092 tg->TAttLine::Modify();
3094 arrow.SetLineWidth(tg->GetLineWidth());
3095 arrow.SetLineColor(tg->GetLineColor());
3096 arrow.SetFillColor(tg->GetFillColor());
3100 xl2 =
gPad->XtoPad(theX[i] - ScaleX * theExL[i]);
3101 if (xl1 > xl2 && !NoErrorsX && (!isOutside || Option0X)) {
3103 arrow.PaintArrow(xl1,
y, xl2,
y, asize, ArrowOptX);
3106 gPad->PaintLine(xl1,
y, xl2,
y);
3117 gPad->PaintPolyLine(4, xb, yb);
3119 gPad->PaintLine(xl2,
y - ty, xl2,
y + ty);
3125 xr2 =
gPad->XtoPad(theX[i] + ScaleX * theExH[i]);
3126 if (xr1 < xr2 && !NoErrorsX && (!isOutside || Option0X)) {
3128 arrow.PaintArrow(xr1,
y, xr2,
y, asize, ArrowOptX);
3131 gPad->PaintLine(xr1,
y, xr2,
y);
3142 gPad->PaintPolyLine(4, xb, yb);
3144 gPad->PaintLine(xr2,
y - ty, xr2,
y + ty);
3156 tg->TAttFill::Copy(tgDummy);
3157 tg->TAttLine::Copy(tgDummy);
3158 tg->TAttMarker::Copy(tgDummy);
3160 for (
Int_t j = 0; j < NYErrors; j++)
3161 if (Option3[j] && DrawErrors[j]) {
3162 if (IndividualStyles) {
3163 tg->GetAttFill(j)->
Copy(tgDummy);
3164 tg->GetAttLine(j)->Copy(tgDummy);
3172 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"FC");
3174 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"F");
3175 gPad->SetLogx(logx);
3176 gPad->SetLogy(logy);
3187 std::vector<Double_t> xline, yline;
3192 const Int_t kBASEMARKER=8;
3193 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};
3194 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};
3217 const char *arrowOpt =
nullptr;
3218 if (strchr(
option,
'>')) arrowOpt =
">";
3219 if (strstr(
option,
"|>")) arrowOpt =
"|>";
3244 xline.resize(2*theNpoints);
3245 yline.resize(2*theNpoints);
3246 if (xline.empty() || yline.empty()) {
3247 Error(
"PaintGraphBentErrors",
"too many points, out of memory");
3254 theGraph->TAttLine::Modify();
3269 Double_t sbase = symbolsize*kBASEMARKER;
3273 if (mark >= 20 && mark <= 49) {
3284 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3289 Bool_t DrawXLeft, DrawXRight, DrawYUp, DrawYLow;
3291 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup, yup1, yup2, ylow, ylow1, ylow2;
3293 for (
Int_t i=0;i<theNpoints;i++) {
3298 x =
gPad->XtoPad(theX[i]);
3299 y =
gPad->YtoPad(theY[i]);
3300 bxl =
gPad->YtoPad(theY[i]+theEXlowd[i]);
3301 bxh =
gPad->YtoPad(theY[i]+theEXhighd[i]);
3302 byl =
gPad->XtoPad(theX[i]+theEYlowd[i]);
3303 byh =
gPad->XtoPad(theX[i]+theEYhighd[i]);
3307 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3308 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3309 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3310 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3312 if (x < gPad->GetUxmin())
continue;
3313 if (
x >
gPad->GetUxmax())
continue;
3314 if (y < gPad->GetUymin())
continue;
3315 if (
y >
gPad->GetUymax())
continue;
3341 xl2 =
gPad->XtoPad(theX[i] - exl);
3343 xr2 =
gPad->XtoPad(theX[i] + exh);
3344 if (xl1 < xl2) DrawXLeft =
kFALSE;
3345 if (xr1 > xr2) DrawXRight =
kFALSE;
3365 yup2 =
gPad->YtoPad(theY[i] + eyh);
3367 ylow2 =
gPad->YtoPad(theY[i] - eyl);
3368 if (yup2 < yup1) DrawYUp =
kFALSE;
3369 if (ylow2 > ylow1) DrawYLow =
kFALSE;
3373 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3374 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3376 if (xrevlog) {bs = bxl; bxl = bxh; bxh = bs;}
3377 if (yrevlog) {bs = byl; byl = byh; byh = bs;}
3385 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3386 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3387 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3388 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3389 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3390 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3391 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3392 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3393 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3394 else box.PaintBox(x1b, y1b, x2b, y2b);
3402 yline[if1-1] = yup2;
3403 yline[if2-1] = ylow2;
3409 if (exl != 0. || exh != 0.) {
3411 if (exl != 0. && DrawXLeft)
arrow.PaintArrow(xl1,
y,xl2,bxl,asize,arrowOpt);
3412 if (exh != 0. && DrawXRight)
arrow.PaintArrow(xr1,
y,xr2,bxh,asize,arrowOpt);
3415 if (exl != 0. && DrawXLeft)
gPad->PaintLine(xl1,
y,xl2,bxl);
3416 if (exh != 0. && DrawXRight)
gPad->PaintLine(xr1,
y,xr2,bxh);
3420 if (exl != 0. && DrawXLeft) {
3421 xb[0] = xl2+tx; yb[0] = bxl-ty;
3422 xb[1] = xl2; yb[1] = bxl-ty;
3423 xb[2] = xl2; yb[2] = bxl+ty;
3424 xb[3] = xl2+tx; yb[3] = bxl+ty;
3425 gPad->PaintPolyLine(4, xb, yb);
3427 if (exh != 0. && DrawXRight) {
3428 xb[0] = xr2-tx; yb[0] = bxh-ty;
3429 xb[1] = xr2; yb[1] = bxh-ty;
3430 xb[2] = xr2; yb[2] = bxh+ty;
3431 xb[3] = xr2-tx; yb[3] = bxh+ty;
3432 gPad->PaintPolyLine(4, xb, yb);
3435 if (DrawXLeft)
gPad->PaintLine(xl2,bxl-ty,xl2,bxl+ty);
3436 if (DrawXRight)
gPad->PaintLine(xr2,bxh-ty,xr2,bxh+ty);
3442 if (eyl != 0. || eyh != 0.) {
3444 if (eyh != 0. && DrawYUp) {
3445 if (yup2 == yup)
arrow.PaintArrow(
x,yup1,byh,yup2,asize,arrowOpt);
3446 else gPad->PaintLine(
x,yup1,byh,yup2);
3448 if (eyl != 0. && DrawYLow) {
3449 if (ylow2 == ylow)
arrow.PaintArrow(
x,ylow1,byl,ylow2,asize,arrowOpt);
3450 else gPad->PaintLine(
x,ylow1,byl,ylow2);
3454 if (eyh != 0. && DrawYUp)
gPad->PaintLine(
x,yup1,byh,yup2);
3455 if (eyl != 0. && DrawYLow)
gPad->PaintLine(
x,ylow1,byl,ylow2);
3459 if (eyh != 0. && yup2 == yup && DrawYUp) {
3460 xb[0] = byh-tx; yb[0] = yup2-ty;
3461 xb[1] = byh-tx; yb[1] = yup2;
3462 xb[2] = byh+tx; yb[2] = yup2;
3463 xb[3] = byh+tx; yb[3] = yup2-ty;
3464 gPad->PaintPolyLine(4, xb, yb);
3466 if (eyl != 0. && ylow2 == ylow && DrawYLow) {
3467 xb[0] = byl-tx; yb[0] = ylow2+ty;
3468 xb[1] = byl-tx; yb[1] = ylow2;
3469 xb[2] = byl+tx; yb[2] = ylow2;
3470 xb[3] = byl+tx; yb[3] = ylow2+ty;
3471 gPad->PaintPolyLine(4, xb, yb);
3474 if (eyh != 0. && yup2 == yup && DrawYUp)
gPad->PaintLine(byh-tx,yup2,byh+tx,yup2);
3475 if (eyl != 0. && ylow2 == ylow && DrawYLow)
gPad->PaintLine(byl-tx,ylow2,byl+tx,ylow2);
3490 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3491 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3492 gPad->SetLogx(logx);
3493 gPad->SetLogy(logy);
3504 std::vector<Double_t> xline, yline;
3509 const Int_t kBASEMARKER=8;
3510 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};
3511 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};
3528 const char *arrowOpt =
nullptr;
3529 if (strchr(
option,
'>')) arrowOpt =
">";
3530 if (strstr(
option,
"|>")) arrowOpt =
"|>";
3555 xline.resize(2*theNpoints);
3556 yline.resize(2*theNpoints);
3557 if (xline.empty() || yline.empty()) {
3558 Error(
"PaintGraphErrors",
"too many points, out of memory");
3565 theGraph->TAttLine::Modify();
3581 Double_t sbase = symbolsize*kBASEMARKER;
3585 if (mark >= 20 && mark <= 49) {
3596 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3601 Bool_t DrawXLeft, DrawXRight, DrawYUp, DrawYLow;
3603 Double_t x,
y,
ex,
ey, xl1, xl2, xr1, xr2, yup, yup1, yup2, ylow, ylow1, ylow2;
3604 for (
Int_t i=0;i<theNpoints;i++) {
3609 x =
gPad->XtoPad(theX[i]);
3610 y =
gPad->YtoPad(theY[i]);
3614 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3615 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3616 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3617 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3619 if (x < gPad->GetUxmin())
continue;
3620 if (
x >
gPad->GetUxmax())
continue;
3621 if (y < gPad->GetUymin())
continue;
3622 if (
y >
gPad->GetUymax())
continue;
3640 xl2 =
gPad->XtoPad(theX[i] -
ex);
3642 xr2 =
gPad->XtoPad(theX[i] +
ex);
3643 if (xl1 < xl2) DrawXLeft =
kFALSE;
3644 if (xr1 > xr2) DrawXRight =
kFALSE;
3658 yup2 =
gPad->YtoPad(theY[i] +
ey);
3660 ylow2 =
gPad->YtoPad(theY[i] -
ey);
3661 if (yup2 < yup1) DrawYUp =
kFALSE;
3662 if (ylow2 > ylow1) DrawYLow =
kFALSE;
3666 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3667 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3675 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3676 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3677 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3678 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3679 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3680 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3681 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3682 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3683 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3684 else box.PaintBox(x1b, y1b, x2b, y2b);
3692 yline[if1-1] = yup2;
3693 yline[if2-1] = ylow2;
3701 if (DrawXLeft)
arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
3702 if (DrawXRight)
arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
3705 if (DrawXLeft)
gPad->PaintLine(xl1,
y,xl2,
y);
3706 if (DrawXRight)
gPad->PaintLine(xr1,
y,xr2,
y);
3711 xb[0] = xl2+tx; yb[0] =
y-ty;
3712 xb[1] = xl2; yb[1] =
y-ty;
3713 xb[2] = xl2; yb[2] =
y+ty;
3714 xb[3] = xl2+tx; yb[3] =
y+ty;
3715 gPad->PaintPolyLine(4, xb, yb);
3718 xb[0] = xr2-tx; yb[0] =
y-ty;
3719 xb[1] = xr2; yb[1] =
y-ty;
3720 xb[2] = xr2; yb[2] =
y+ty;
3721 xb[3] = xr2-tx; yb[3] =
y+ty;
3722 gPad->PaintPolyLine(4, xb, yb);
3725 if (DrawXLeft)
gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
3726 if (DrawXRight)
gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
3735 if (yup2 == yup)
arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
3736 else gPad->PaintLine(
x,yup1,
x,yup2);
3739 if (ylow2 == ylow)
arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
3740 else gPad->PaintLine(
x,ylow1,
x,ylow2);
3744 if (DrawYUp)
gPad->PaintLine(
x,yup1,
x,yup2);
3745 if (DrawYLow)
gPad->PaintLine(
x,ylow1,
x,ylow2);
3749 if (yup2 == yup && DrawYUp) {
3750 xb[0] =
x-tx; yb[0] = yup2-ty;
3751 xb[1] =
x-tx; yb[1] = yup2;
3752 xb[2] =
x+tx; yb[2] = yup2;
3753 xb[3] =
x+tx; yb[3] = yup2-ty;
3754 gPad->PaintPolyLine(4, xb, yb);
3756 if (ylow2 == ylow && DrawYLow) {
3757 xb[0] =
x-tx; yb[0] = ylow2+ty;
3758 xb[1] =
x-tx; yb[1] = ylow2;
3759 xb[2] =
x+tx; yb[2] = ylow2;
3760 xb[3] =
x+tx; yb[3] = ylow2+ty;
3761 gPad->PaintPolyLine(4, xb, yb);
3764 if (yup2 == yup && DrawYUp)
gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
3765 if (ylow2 == ylow && DrawYLow)
gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
3780 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3781 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3782 gPad->SetLogx(logx);
3783 gPad->SetLogy(logy);
3795 Int_t theNpoints = theGraphPolar->
GetN();
3813 polargram_opt.
Append(
"N");
3818 polargram_opt.
Append(
"O");
3832 thePolargram =
nullptr;
3833 if (!thePolargram) {
3835 TIter padObjIter(
gPad->GetListOfPrimitives());
3836 while (
auto obj = padObjIter()) {
3846 if (!thePolargram) {
3851 thePolargram->
Draw(polargram_opt.
Data());
3855 rwrmax = thePolargram->
GetRMax(),
3856 rwtmin = thePolargram->
GetTMin(),
3857 rwtmax = thePolargram->
GetTMax();
3864 Double_t radiusNDC = rwrmax - rwrmin;
3873 if (thePolargram->
IsGrad())
3876 for (
Int_t i = 0; i < theNpoints; i++) {
3877 Double_t eymin, eymax, exmin,exmax;
3878 exmin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3880 eymin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3882 exmax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3884 eymax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3886 theGraphPolar->TAttLine::Modify();
3887 if (exmin != exmax || eymin != eymax)
gPad->PaintLine(exmin,eymin,exmax,eymax);
3891 for (
Int_t i = 0; i < theNpoints; i++) {
3892 Double_t rad = (theY[i]-rwrmin)/radiusNDC;
3895 theGraphPolar->TAttLine::Modify();
3896 if (phimin != phimax) thePolargram->
PaintCircle(0,0,rad,phimin,phimax,0);
3902 if (!
gPad->GetLogx() && !
gPad->GetLogy()) {
3903 Double_t a,
b,
c = 1,
x1,
x2,
y1,
y2, discr, norm1, norm2, xts, yts;
3911 if (thePolargram->
IsGrad())
3913 for (
Int_t i = 0; i < theNpoints; i++) {
3916 xt = (theY[i]-rwrmin)/radiusNDC*
TMath::Cos(
c*(theX[i]-rwtmin)/thetaNDC);
3917 yt = (theY[i]-rwrmin)/radiusNDC*
TMath::Sin(
c*(theX[i]-rwtmin)/thetaNDC);
3918 norm = sqrt(xt*xt+yt*yt);
3923 if (!previouspointin) {
3928 a = (yt-yts)/(xt-xts);
3930 discr = 4*(
a*
a-
b*
b+1);
3931 x1 = (-2*
a*
b+sqrt(discr))/(2*(
a*
a+1));
3932 x2 = (-2*
a*
b-sqrt(discr))/(2*(
a*
a+1));
3935 norm1 = sqrt((
x1-xt)*(
x1-xt)+(
y1-yt)*(
y1-yt));
3936 norm2 = sqrt((
x2-xt)*(
x2-xt)+(
y2-yt)*(
y2-yt));
3937 previouspointin =
kFALSE;
3939 if (norm1 < norm2) {
3949 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3954 if (j>=1 && !previouspointin) {
3955 a = (yt-theYpol[j])/(xt-theXpol[j]);
3956 b = theYpol[j]-
a*theXpol[j];
3957 previouspointin =
kTRUE;
3958 discr = 4*(
a*
a-
b*
b+1);
3959 x1 = (-2*
a*
b+sqrt(discr))/(2*(
a*
a+1));
3960 x2 = (-2*
a*
b-sqrt(discr))/(2*(
a*
a+1));
3963 norm1 = sqrt((
x1-xt)*(
x1-xt)+(
y1-yt)*(
y1-yt));
3964 norm2 = sqrt((
x2-xt)*(
x2-xt)+(
y2-yt)*(
y2-yt));
3966 if (norm1 < norm2) {
3973 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3980 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3983 for (
Int_t i = 0; i < theNpoints; i++) {
3987 PaintGraph(theGraphPolar, theNpoints, theXpol, theYpol, opt);
3995 TIter next(
gPad->GetListOfPrimitives());
3996 while (
auto obj = next()) {
3999 if (obj->GetName() && !strcmp(obj->GetName(),
"title")) {
4005 if (title)
delete title;
4011 if (ht <= 0) ht = 0.05;
4032 if (talh < 1) talh = 1;
else if (talh > 3) talh = 3;
4034 if (talv < 1) talv = 1;
else if (talv > 3) talv = 3;
4059 ptitle->
Paint(
"blNDC");
4076 TF1 *theF = theGraphQQ->
GetF();
4079 Error(
"TGraphQQ::Paint",
"2nd dataset or theoretical function not specified");
4094 Double_t yxmin, xymin, yxmax, xymax;
4100 TLine line1, line2, line3;
4103 yxmin = (theYq2-theYq1)*(
xmin-theXq1)/(theXq2-theXq1) + theYq1;
4105 xymin = (theXq2-theXq1)*(
ymin-theYq1)/(theYq2-theYq1) + theXq1;
4111 line2.
PaintLine(xqmin, yqmin, xqmax, yqmax);
4113 yxmax = (theYq2-theYq1)*(
xmax-theXq1)/(theXq2-theXq1) + theYq1;
4115 xymax = (theXq2-theXq1)*(
ymax-theYq1)/(theYq2-theYq1) + theXq1;
4158 if (lxp) opth.
Append(
"x+");
4159 if (lyp) opth.
Append(
"y+");
4184 XA1 =
gPad->GetUxmin();
4185 XA2 =
gPad->GetUxmax();
4186 YA1 =
gPad->GetUymin();
4187 YA2 =
gPad->GetUymax();
4224 if (
gPad->GetGridx()) {
4225 if (
gPad->GetLogy()) {
4228 GL = (YA2 - YA1) / (
gPad->GetY2() -
gPad->GetY1());
4236 TGaxis *theReversedXaxis;
4237 if (
gPad->GetLogx()) {
4250 theReversedXaxis =
new TGaxis(
gPad->GetUxmax(),
4264 theReversedXaxis->
Paint();
4268 if (
gPad->GetLogx()) {
4272 for (i=0; i<
N; i++) rX[i] = dX-
X[i];
4276 if (rEXhigh && EXlow)
for (i=0; i<
N; i++) rEXhigh[i] = EXlow[i];
4277 if (rEXlow && EXhigh)
for (i=0; i<
N; i++) rEXlow[i] = EXhigh[i];
4280 if (rEXhighd && EXlowd)
for (i=0; i<
N; i++) rEXhighd[i] = EXlowd[i];
4281 if (rEXlowd && EXhighd)
for (i=0; i<
N; i++) rEXlowd[i] = EXhighd[i];
4292 if (
gPad->GetGridy()) {
4293 if (
gPad->GetLogx()) {
4296 GL = (XA2 - XA1) / (
gPad->GetX2() -
gPad->GetX1());
4304 TGaxis *theReversedYaxis;
4305 if (
gPad->GetLogy()) {
4331 theReversedYaxis->
Paint();
4335 if (
gPad->GetLogy()) {
4339 for (i=0; i<
N; i++) rY[i] = dY-Y[i];
4343 if (rEYhigh && EYlow)
for (i=0; i<
N; i++) rEYhigh[i] = EYlow[i];
4344 if (rEYlow && EYhigh)
for (i=0; i<
N; i++) rEYlow[i] = EYhigh[i];
4347 if (rEYhighd && EYlowd)
for (i=0; i<
N; i++) rEYhighd[i] = EYlowd[i];
4348 if (rEYlowd && EYhighd)
for (i=0; i<
N; i++) rEYlowd[i] = EYhighd[i];
4352 if (rEYlowd)
for (i=0; i<
N; i++) rEYlowd[i] = -rEYlowd[i];
4353 if (rEYhighd)
for (i=0; i<
N; i++) rEYhighd[i] = -rEYhighd[i];
4356 if (rEXlowd)
for (i=0; i<
N; i++) rEXlowd[i] = -rEXlowd[i];
4357 if (rEXhighd)
for (i=0; i<
N; i++) rEXhighd[i] = -rEXhighd[i];
4382 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
4387 double *theColor = theScatter->
GetColor();
4388 double *theSize = theScatter->
GetSize();
4392 double minx = DBL_MAX;
4393 double maxx = -DBL_MAX;
4394 double miny = DBL_MAX;
4395 double maxy = -DBL_MAX;
4396 double minc = DBL_MAX;
4397 double maxc = -DBL_MAX;
4398 double mins = DBL_MAX;
4399 double maxs = -DBL_MAX;
4400 for (
int i=0; i<
n; i++) {
4418 if (theX[0] == 0.) {
4428 if (theY[0] == 0.) {
4439 if (theColor[0] == 0.) {
4444 minc = theColor[0] -
d;
4445 maxc = theColor[0] +
d;
4451 if (theSize[0] == 0.) {
4456 mins = theSize[0] -
d;
4457 maxs = theSize[0] +
d;
4463 if (optionAxis)
h->
Paint(
" ");
4464 if (
h->GetMinimum() !=
h->GetMaximum()) {
4465 if (minc<h->GetMinimum()) minc =
h->GetMinimum();
4466 if (maxc>
h->GetMaximum()) maxc =
h->GetMaximum();
4478 functions->
Remove(palette);
4479 delete palette; palette =
nullptr;
4483 functions->
Remove(palette);
4484 delete palette; palette =
nullptr;
4505 palette->
SetTitle(
h->GetZaxis()->GetTitle());
4511 if (palette) palette->
Paint();
4516 int logx =
gPad->GetLogx();
4517 int logy =
gPad->GetLogy();
4518 int logz =
gPad->GetLogz();
4519 if (theColor && logz) {
4520 if (minc>0) minc = log10(minc);
4521 if (maxc>0) maxc = log10(maxc);
4524 theScatter->TAttMarker::Modify();
4527 for (
int i=0; i<
n; i++) {
4530 if (theColor[i]>0)
c = log10(theColor[i]);
4535 if (
c<minc)
continue;
4536 if (
c>maxc)
continue;
4538 if (nc > nbcol-1) nc = nbcol-1;
4542 ms = (MaxMarkerSize-MinMarkerSize)*((theSize[i]-mins)/(maxs-mins))+MinMarkerSize;
4545 if (theColor || theSize) theScatter->TAttMarker::Modify();
4547 if (theX[i]>0)
x = log10(theX[i]);
4553 if (theY[i]>0)
y = log10(theY[i]);
4558 gPad->PaintPolyMarker(1,&
x,&
y);
4579 if (!functions)
return;
4588 obj->Paint(lnk->GetOption());
4608 std::vector<Double_t> xf(2*
n);
4609 std::vector<Double_t> yf(2*
n);
4610 std::vector<Double_t> xt(
n);
4611 std::vector<Double_t> yt(
n);
4612 Double_t x1,
x2,
y1,
y2, x3, y3, xm, ym,
a, a1, a2, a3;
4615 Int_t ix1,iy1,ix2,iy2;
4619 gPad->GetPadPar(x1p,y1p,x2p,y2p);
4620 ix1 = (
Int_t)(iw*x1p);
4621 iy1 = (
Int_t)(ih*y1p);
4622 ix2 = (
Int_t)(iw*x2p);
4623 iy2 = (
Int_t)(ih*y2p);
4635 gPad->GetRange(rx1,ry1,rx2,ry2);
4636 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
4637 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
4641 xf[0] = rx*(
x[0]-rx1)+x1ndc;
4642 yf[0] = ry*(
y[0]-ry1)+y1ndc;
4644 for (i=1; i<
n; i++) {
4645 if (
x[i]==
x[i-1] &&
y[i]==
y[i-1])
continue;
4647 xf[nf] = rx*(
x[i]-rx1)+x1ndc;
4648 if (xf[i]==xf[i-1]) xf[i] += 0.000001;
4649 yf[nf] = ry*(
y[i]-ry1)+y1ndc;
4668 if (xf[nf]==xf[nf-1]) {
4673 if (xf[nf]>=xf[nf-1]) {
4682 for (i=1; i<nf; i++) {
4694 if (xi1<xi0) a1 = a1+3.14159;
4700 if (xi0<xi2) a2 = a2+3.14159;
4715 if ((xm-xi0)*(x3-xi0)<0 && (ym-yi0)*(y3-yi0)<0) {
4719 if ((xm==
x1) && (ym==
y1)) {
4728 if (xf[nf]==xf[0] && yf[nf]==yf[0]) {
4729 xm = (xt[nf]+xt[0])*0.5;
4730 ym = (yt[nf]+yt[0])*0.5;
4738 if ((xm-xf[0])*(x3-xf[0])<0 && (ym-yf[0])*(y3-yf[0])<0) {
4752 for (i=nf2; i>0; i--) {
4753 for (j=i-1; j>0; j--) {
4754 if (xt[i-1]==xt[i] || xt[j-1]==xt[j])
continue;
4755 c1 = (yt[i-1]-yt[i])/(xt[i-1]-xt[i]);
4756 b1 = yt[i]-
c1*xt[i];
4757 c2 = (yt[j-1]-yt[j])/(xt[j-1]-xt[j]);
4758 b2 = yt[j]-
c2*xt[j];
4760 xc = (b2-b1)/(
c1-
c2);
4766 nf++; xf[nf] = xt[i]; yf[nf] = yt[i];
4767 nf++; xf[nf] = xc ; yf[nf] = yc;
4785 nf++; xf[nf] = xt[0]; yf[nf] = yt[0];
4788 for (i=0; i<nf+1; i++) {
4789 xf[i] = (1/rx)*(xf[i]-x1ndc)+rx1;
4790 yf[i] = (1/ry)*(yf[i]-y1ndc)+ry1;
4794 gPad->PaintFillArea(nf+1,xf.data(),yf.data());
4795 theGraph->TAttLine::Modify();
4808 TIter next(functions);
4809 while (
auto obj = next()) {
4819 if (!dofit) fit =
nullptr;
4821 if (dofit == 1) dofit = 111;
4823 Int_t print_fval = dofit%10;
4824 Int_t print_ferrors = (dofit/10)%10;
4825 Int_t print_fchi2 = (dofit/100)%10;
4826 Int_t print_fprob = (dofit/1000)%10;
4827 Int_t nlinesf = print_fval + print_fchi2 + print_fprob;
4829 if (print_fval < 2) nlinesf += fit->GetNumberFreeParameters();
4830 else nlinesf += fit->GetNpar();