524 if (
gPad->GetLogx()) {
525 for (i=0;i<npoints;i++) {
530 if (!opt &&
gPad->GetLogy()) {
531 for (i=0;i<npoints;i++) {
552 if (distance <= 5)
return distance;
556 const Int_t big = 9999;
557 const Int_t kMaxDiff = 10;
564 if (px <= puxmin)
return big;
565 if (py >= puymin)
return big;
566 if (px >= puxmax)
return big;
567 if (py <= puymax)
return big;
570 Int_t i, pxp, pyp, d;
577 theX = theGraphPolar->
GetXpol();
578 theY = theGraphPolar->
GetYpol();
580 theX = theGraph->
GetX();
581 theY = theGraph->
GetY();
584 for (i=0;i<theNpoints;i++) {
585 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
586 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
588 if (d < distance) distance = d;
590 if (distance < kMaxDiff)
return distance;
592 for (i=0;i<theNpoints-1;i++) {
595 if (d < distance) distance = d;
610 TIter next(functions);
611 while ((f = (
TObject*) next())) {
615 if (dist < kMaxDiff) {
616 gPad->SetSelected(f);
632 Error(
"DrawPanel",
"need to draw graph first");
637 gROOT->ProcessLine(
Form(
"((TCanvas*)0x%lx)->Selected((TVirtualPad*)0x%lx,(TObject*)0x%lx,1)",
660 const Int_t kMaxDiff = 10;
661 static Bool_t middle, badcase;
662 static Int_t ipoint, pxp, pyp;
663 static Int_t px1,px2,py1,py2;
664 static Int_t pxold, pyold, px1old, py1old, px2old, py2old;
665 static Int_t dpx, dpy;
673 if (!
gPad->IsEditable())
return;
683 theGraph->TAttLine::Modify();
684 px1 =
gPad->XtoAbsPixel(
gPad->GetX1());
685 py1 =
gPad->YtoAbsPixel(
gPad->GetY1());
686 px2 =
gPad->XtoAbsPixel(
gPad->GetX2());
687 py2 =
gPad->YtoAbsPixel(
gPad->GetY2());
692 x =
new Int_t[theNpoints+1];
693 y =
new Int_t[theNpoints+1];
694 for (i=0;i<theNpoints;i++) {
695 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
696 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
697 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
703 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
704 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
705 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
706 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
711 if (d < kMaxDiff) ipoint =i;
717 if (ipoint < 0)
return;
721 px2old =
gPad->XtoAbsPixel(theX[1]);
722 py2old =
gPad->YtoAbsPixel(theY[1]);
723 }
else if (ipoint == theNpoints-1) {
724 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[theNpoints-2]));
725 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[theNpoints-2]));
729 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint-1]));
730 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint-1]));
731 px2old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint+1]));
732 py2old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint+1]));
734 pxold =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint]));
735 pyold =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint]));
743 for (i=0;i<theNpoints;i++) {
744 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
745 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
747 if (d < kMaxDiff) middle =
kFALSE;
759 for(i=0;i<theNpoints-1;i++) {
760 gVirtualX->DrawLine(x[i]+dpx,
y[i]+dpy, x[i+1]+dpx,
y[i+1]+dpy);
763 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
764 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
765 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
766 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
767 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
768 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
770 pxp = x[theNpoints-1]+dpx;
771 pyp =
y[theNpoints-1]+dpy;
772 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
773 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
774 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
775 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
780 for(i=0;i<theNpoints-1;i++) {
781 gVirtualX->DrawLine(x[i]+dpx,
y[i]+dpy, x[i+1]+dpx,
y[i+1]+dpy);
784 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
785 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
786 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
787 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
788 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
789 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
791 pxp = x[theNpoints-1]+dpx;
792 pyp =
y[theNpoints-1]+dpy;
793 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
794 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
795 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
796 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
798 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
799 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
800 gVirtualX->DrawLine(pxold-4, pyold-4, pxold+4, pyold-4);
801 gVirtualX->DrawLine(pxold+4, pyold-4, pxold+4, pyold+4);
802 gVirtualX->DrawLine(pxold+4, pyold+4, pxold-4, pyold+4);
803 gVirtualX->DrawLine(pxold-4, pyold+4, pxold-4, pyold-4);
810 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
811 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
812 gVirtualX->DrawLine(pxold-4, pyold-4, pxold+4, pyold-4);
813 gVirtualX->DrawLine(pxold+4, pyold-4, pxold+4, pyold+4);
814 gVirtualX->DrawLine(pxold+4, pyold+4, pxold-4, pyold+4);
815 gVirtualX->DrawLine(pxold-4, pyold+4, pxold-4, pyold-4);
818 xmin =
gPad->GetUxmin();
819 xmax =
gPad->GetUxmax();
820 ymin =
gPad->GetUymin();
821 ymax =
gPad->GetUymax();
824 dxr = dx/(1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
825 dyr = dy/(1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
830 gPad->Range(xmin - dxr*
gPad->GetLeftMargin(),
831 ymin - dyr*
gPad->GetBottomMargin(),
832 xmax + dxr*
gPad->GetRightMargin(),
833 ymax + dyr*
gPad->GetTopMargin());
834 gPad->RangeAxis(xmin, ymin, xmax, ymax);
841 for(i=0;i<theNpoints;i++) {
842 if (badcase)
continue;
843 if (x) theX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(x[i]+dpx));
844 if (
y) theY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i]+dpy));
853 theX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
854 theY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));
858 theX[theNpoints-1] = theX[0];
859 theY[theNpoints-1] = theY[0];
861 if (ipoint == theNpoints-1) {
862 theX[0] = theX[theNpoints-1];
863 theY[0] = theY[theNpoints-1];
875 if (
gROOT->IsEscaped()) {
883 xmin =
gPad->GetUxmin();
884 xmax =
gPad->GetUxmax();
885 ymin =
gPad->GetUymin();
886 ymax =
gPad->GetUymax();
889 dxr = dx/(1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
890 dyr = dy/(1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
895 gPad->Range(xmin - dxr*
gPad->GetLeftMargin(),
896 ymin - dyr*
gPad->GetBottomMargin(),
897 xmax + dxr*
gPad->GetRightMargin(),
898 ymax + dyr*
gPad->GetTopMargin());
899 gPad->RangeAxis(xmin, ymin, xmax, ymax);
902 for(i=0;i<theNpoints;i++) {
903 if (badcase)
continue;
904 if (x) theX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(x[i]+dpx));
905 if (
y) theY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i]+dpy));
908 theX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
909 theY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));
913 theX[theNpoints-1] = theX[0];
914 theY[theNpoints-1] = theY[0];
916 if (ipoint == theNpoints-1) {
917 theX[0] = theX[theNpoints-1];
918 theY[0] = theY[theNpoints-1];
946 strlcpy(chopt,option,80);
949 char *l1 = strstr(chopt,
"pfc");
950 char *l2 = strstr(chopt,
"plc");
951 char *l3 = strstr(chopt,
"pmc");
952 if (l1 || l2 || l3) {
961 char *l4 = strstr(chopt,
"rx");
962 char *l5 = strstr(chopt,
"ry");
995 gPad->PushSelectableObject(theGraph);
997 Int_t optionLine , optionAxis , optionCurve , optionStar , optionMark;
998 Int_t optionBar , optionR , optionOne , optionE;
999 Int_t optionFill , optionZ , optionCurveFill, optionIAxis;
1000 Int_t i, npt, nloop;
1003 Double_t barxmin, barxmax, barymin, barymax;
1010 Error(
"PaintGraph",
"illegal number of points (%d)", npoints);
1017 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1018 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1019 if (opt.
Contains(
"C")) optionCurve = 1;
else optionCurve = 0;
1020 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1021 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1022 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1023 if (opt.
Contains(
"R")) optionR = 1;
else optionR = 0;
1024 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1025 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1026 if (opt.
Contains(
"I")) optionIAxis = 1;
else optionIAxis = 0;
1032 if (optionLine+optionFill+optionCurve+optionStar+optionMark+optionBar+optionE == 0) {
1033 if (!chopt[0]) optionLine=1;
1039 optionCurveFill = 0;
1040 if (optionCurve && optionFill) {
1041 optionCurveFill = 1;
1046 Double_t rwxmin,rwxmax, rwymin, rwymax, maximum, minimum, dx, dy;
1049 rwxmin =
gPad->GetUxmin();
1050 rwxmax =
gPad->GetUxmax();
1051 rwymin =
gPad->GetUymin();
1052 rwymax =
gPad->GetUymax();
1055 if (minimum == -1111) {
1059 if (maximum == -1111) {
1063 uxmin =
gPad->PadtoX(rwxmin);
1064 uxmax =
gPad->PadtoX(rwxmax);
1067 theGraph->
ComputeRange(rwxmin, rwymin, rwxmax, rwymax);
1069 if (rwxmin == rwxmax) rwxmax += 1.;
1070 if (rwymin == rwymax) rwymax += 1.;
1071 dx = 0.1*(rwxmax-rwxmin);
1072 dy = 0.1*(rwymax-rwymin);
1073 uxmin = rwxmin - dx;
1074 uxmax = rwxmax + dx;
1075 minimum = rwymin - dy;
1076 maximum = rwymax + dy;
1080 if (uxmin < 0 && rwxmin >= 0) uxmin = 0.9*rwxmin;
1081 if (uxmax > 0 && rwxmax <= 0) {
1082 if (
gPad->GetLogx()) uxmax = 1.1*rwxmax;
1085 if (minimum < 0 && rwymin >= 0) minimum = 0.9*rwymin;
1086 if (maximum > 0 && rwymax <= 0) {
1090 if (minimum <= 0 && gPad->GetLogy()) minimum = 0.001*maximum;
1091 if (uxmin <= 0 && gPad->GetLogx()) {
1092 if (uxmax > 1000) uxmin = 1;
1093 else uxmin = 0.001*uxmax;
1100 char chopth[8] =
" ";
1101 if (strstr(chopt,
"x+")) strncat(chopth,
"x+",2);
1102 if (strstr(chopt,
"y+")) strncat(chopth,
"y+",2);
1103 if (optionIAxis) strncat(chopth,
"A",1);
1110 if (theNpoints > npt) npt = theNpoints;
1121 if (
gPad->GetLogy()) {
1141 TIter next(functions);
1142 while ((f = (
TObject*) next())) {
1151 rwxmin =
gPad->GetUxmin();
1152 rwxmax =
gPad->GetUxmax();
1153 rwymin =
gPad->GetUymin();
1154 rwymax =
gPad->GetUymax();
1155 uxmin =
gPad->PadtoX(rwxmin);
1156 uxmax =
gPad->PadtoX(rwxmax);
1161 maximum =
gPad->PadtoY(rwymax);
1162 minimum =
gPad->PadtoY(rwymin);
1166 theGraph->TAttLine::Modify();
1167 theGraph->TAttFill::Modify();
1168 theGraph->TAttMarker::Modify();
1176 if (optionLine || optionFill) {
1182 if (optionFill && (xn != x1 || yn != y1)) nloop++;
1184 for (i=1;i<=nloop;i++) {
1225 if (optionCurveFill) {
1227 if (xn != x1 || yn != y1) nloop++;
1231 for (i=1;i<=nloop;i++) {
1256 for (i=1;i<=nloop;i++) {
1260 if (y[i-1] < minimum || y[i-1] > maximum)
continue;
1261 if (x[i-1] < uxmin || x[i-1] > uxmax)
continue;
1287 for (i=1;i<=npoints;i++) {
1302 for (i=1;i<=npoints;i++) {
1319 for (i=1;i<npoints;i++) {
1320 if (x[i] < barxmin) barxmin = x[i];
1321 if (x[i] > barxmax) barxmax = x[i];
1323 bdelta = (barxmax-barxmin)/
Double_t(npoints);
1327 for (i=1;i<npoints;i++) {
1328 if (y[i] < barymin) barymin = y[i];
1329 if (y[i] > barymax) barymax = y[i];
1331 bdelta = (barymax-barymin)/
Double_t(npoints);
1335 for (i=1;i<=npoints;i++) {
1336 xlow = x[i-1] - dbar;
1337 xhigh = x[i-1] + dbar;
1339 if (xlow < uxmin) xlow = uxmin;
1340 if (xhigh > uxmax) xhigh = uxmax;
1342 else ylow =
gPad->GetUymin();
1356 for (i=1;i<=npoints;i++) {
1358 ylow = y[i-1] - dbar;
1359 yhigh = y[i-1] + dbar;
1412 const char *where =
"PaintGrapHist";
1414 Int_t optionLine , optionAxis , optionCurve, optionStar, optionMark;
1415 Int_t optionBar , optionRot , optionOne , optionOff ;
1416 Int_t optionFill , optionZ;
1417 Int_t optionHist , optionBins , optionMarker;
1419 Int_t drawtype=0, drawborder, drawbordersav;
1425 Double_t xi, xi1, xj, xj1, yi1, yi, yj, yj1, xwmin, ywmin;
1429 char choptaxis[10] =
" ";
1432 Error(where,
"illegal number of points (%d)", npoints);
1437 if (opt.
Contains(
"H")) optionHist = 1;
else optionHist = 0;
1438 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1439 if (opt.
Contains(
"C")) optionCurve= 1;
else optionCurve= 0;
1440 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1441 if (opt.
Contains(
"R")) optionRot = 1;
else optionRot = 0;
1442 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1443 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1444 if (opt.
Contains(
"N")) optionBins = 1;
else optionBins = 0;
1445 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1446 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1447 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1448 if (opt.
Contains(
"][")) optionOff = 1;
else optionOff = 0;
1449 if (opt.
Contains(
"P0")) optionMark = 10;
1451 Int_t optionFill2 = 0;
1453 optionFill = 0; optionFill2 = 1;
1468 nbins = last - first + 1;
1480 Double_t rounding = (uxmax-uxmin)*1.
e-5;
1483 Int_t nx1, nx2, ndivx, ndivy, ndiv;
1496 if (ndivx < 0) strlcat(choptaxis,
"N",10);
1497 if (
gPad->GetGridx()) {
1499 strlcat(choptaxis,
"W",10);
1501 if (
gPad->GetLogx()) {
1505 strlcat(choptaxis,
"G",10);
1515 axis->
PaintAxis(rwxmin,rwymin,rwxmax,rwymin,rwmin,rwmax,ndiv,choptaxis);
1525 strlcat(choptaxis,
"N",10);
1528 if (
gPad->GetGridy()) {
1530 strlcat(choptaxis,
"W",10);
1532 if (
gPad->GetLogy()) {
1536 strlcat(choptaxis,
"G",10);
1545 axis->
PaintAxis(rwxmin,rwymin,rwxmin,rwymax,rwmin,rwmax,ndiv,choptaxis);
1551 theGraph->TAttLine::Modify();
1552 theGraph->TAttFill::Modify();
1553 theGraph->TAttMarker::Modify();
1557 if (!optionRot) {wmin = x[0]; wmax = x[1];}
1558 else {wmin = y[0]; wmax = y[1];}
1560 if (!optionBins) delta = (wmax - wmin)/
Double_t(nbins);
1562 Int_t fwidth =
gPad->GetFrameLineWidth();
1565 if (optionOff) fwidth = 1;
1581 if (optionFill && !optionCurve) {
1589 for (j=first; j<=last;j++) {
1592 gxwork[npt] = wmin+((j-first+1)*delta);
1596 xj1 = x[j]; xj = x[j-1];
1598 if (j != last)
Error(where,
"X must be in increasing order");
1599 else Error(where,
"X must have N+1 values with option N");
1604 gywork[npt-1] = y[j-1];
1605 gywork[npt] = y[j-1];
1606 if (gywork[npt] < vymin) {gywork[npt] = vymin; gywork[npt-1] = vymin;}
1607 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1608 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1611 gywork[npt-1] = gywork[0];
1615 if (gywork[0] < vymin) {gywork[0] = vymin; gywork[npt-1] = vymin;}
1621 if (!fillarea)
gyworkl[0] = ylast;
1632 for (j=first; j<=last;j++) {
1635 gywork[npt] = wmin+((j-first+1)*delta);
1637 yj1 = y[j]; yj = y[j-1];
1639 if (j != last)
Error(where,
"Y must be in increasing order");
1640 else Error(where,
"Y must have N+1 values with option N");
1645 gxwork[npt-1] = x[j-1]; gxwork[npt] = x[j-1];
1646 if ((gxwork[npt-1] >= uxmin-rounding && gxwork[npt-1] <= uxmax+rounding) ||
1647 (gxwork[npt] >= uxmin-rounding && gxwork[npt] <= uxmax+rounding)) npt += 2;
1650 gxwork[npt-1] = gxwork[0];
1654 if (!fillarea)
gyworkl[0] = ylast;
1661 theGraph->TAttLine::Modify();
1662 theGraph->TAttFill::Modify();
1667 if ((optionHist) || !chopt[0]) {
1673 for (i=first; i<=last;i++) {
1676 gxwork[npt] = wmin+((i-first+1)*delta);
1678 xi1 = x[i]; xi = x[i-1];
1680 if (i != last)
Error(where,
"X must be in increasing order");
1681 else Error(where,
"X must have N+1 values with option N");
1689 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1690 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1702 Int_t nbpoints = npt-2;
1708 for (ip=point1; ip<=nbpoints; ip++) {
1715 Int_t point2 = nbpoints;
1716 for (ip=point2; ip>=point1; ip--) {
1722 nbpoints = point2-point1+1;
1726 if (
gxwork[0] >
gPad->GetUxmin()) { nbpoints++; point1 = 0; }
1727 if (
gxwork[nbpoints] <
gPad->GetUxmax()) nbpoints++;
1739 for (i=first; i<=last;i++) {
1742 gywork[npt] = wmin+((i-first+1)*delta);
1744 yi1 = y[i]; yi = y[i-1];
1746 if (i != last)
Error(where,
"Y must be in increasing order");
1747 else Error(where,
"Y must have N+1 values with option N");
1753 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1754 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1773 if (!optionOne) drawtype = 2;
1778 for (i=first; i<=last;i++) {
1781 gxwork[npt-1] = wmin+(i-first)*delta+0.5*delta;
1783 xi1 = x[i]; xi = x[i-1];
1785 if (i != last)
Error(where,
"X must be in increasing order");
1786 else Error(where,
"X must have N+1 values with option N");
1789 gxwork[npt-1] = x[i-1] + 0.5*(x[i]-x[i-1]);
1820 drawtype = drawtype+10;
1822 for (i=first; i<=last;i++) {
1825 gywork[npt-1] = wmin+(i-first)*delta+0.5*delta;
1827 yi1 = y[i]; yi = y[i-1];
1829 if (i != last)
Error(where,
"Y must be in increasing order");
1830 else Error(where,
"Y must have N+1 values with option N");
1833 gywork[npt-1] = y[i-1] + 0.5*(y[i]-y[i-1]);
1865 wminstep = wmin + 0.5*
delta;
1867 gPad->GetRangeAxis(ax1,ay1,ax2,ay2);
1871 for (i=first; i<=last;i++) {
1874 gxwork[npt-1] = wmin+(i-first)*delta+0.5*delta;
1876 xi1 = x[i]; xi = x[i-1];
1878 if (i != last)
Error(where,
"X must be in increasing order");
1879 else Error(where,
"X must have N+1 values with option N");
1882 gxwork[npt-1] = x[i-1] + 0.5*(x[i]-x[i-1]);
1884 if (
gxwork[npt-1] < uxmin ||
gxwork[npt-1] > uxmax) { npt--;
continue;}
1887 if ((
gywork[npt-1] < rwymin) || ((
gywork[npt-1] > rwymax) && !optionFill2)) {
1926 for (i=first; i<=last;i++) {
1929 gywork[npt-1] = wminstep+(i-first)*delta+0.5*delta;
1931 yi1 = y[i]; yi = y[i-1];
1933 if (i != last)
Error(where,
"Y must be in increasing order");
1934 else Error(where,
"Y must have N+1 values with option N");
1937 gywork[npt-1] = y[i-1] + 0.5*(y[i]-y[i-1]);
1940 if ((
gxwork[npt-1] < uxmin) || (
gxwork[npt-1] > uxmax)) {
1962 if (optionLine != 0 && npt > 1) {
1973 offset = delta*baroffset; dbar = delta*barwidth;
1976 offset = (x[1]-x[0])*baroffset;
1977 dbar = (x[1]-x[0])*barwidth;
1979 offset = (y[1]-y[0])*baroffset;
1980 dbar = (y[1]-y[0])*barwidth;
1983 drawbordersav = drawborder;
1987 xhigh = wmin+offset+dbar;
1990 else ylow =
gPad->GetUymin();
1992 for (i=first; i<=last;i++) {
1999 if (xlow < rwxmax && xhigh > rwxmin)
2003 xhigh = xhigh+
delta;
2006 xi1 = x[i]; xi = x[i-1];
2008 Error(where,
"X must be in increasing order");
2011 offset = (x[i+1]-x[i])*baroffset;
2012 dbar = (x[i+1]-x[i])*barwidth;
2013 xlow = x[i] + offset;
2014 xhigh = x[i] + offset + dbar;
2019 ylow = wmin + offset;
2020 yhigh = wmin + offset + dbar;
2022 else xlow =
gPad->GetUxmin();
2023 for (i=first; i<=last;i++) {
2031 gPad->PaintBox(xlow,ylow,xhigh,yhigh);
2033 ylow = ylow +
delta;
2034 yhigh = yhigh +
delta;
2037 yi1 = y[i]; yi = y[i-1];
2039 Error(where,
"Y must be in increasing order");
2042 offset = (y[i+1]-y[i])*baroffset;
2043 dbar = (y[i+1]-y[i])*barwidth;
2044 ylow = y[i] + offset;
2045 yhigh = y[i] + offset + dbar;
2056 if ((optionStar) || (optionMark)) optionMarker=1;
2062 for (i=first; i<=last;i++) {
2063 if (!optionBins) xm = wmin+(i-first)*delta+0.5*delta;
2064 else xm = x[i-1] + 0.5*(x[i]-x[i-1]);
2066 if (optionMark != 10) {
2067 if (ym<rwymax && ym > rwymin) {
2073 if (ym<rwymax && ym >= rwymin) {
2090 wminstep = wmin + 0.5*
delta;
2091 for (i=first; i<=last;i++) {
2092 if (!optionBins) ym = wminstep+(i-first)*delta+0.5*delta;
2093 else ym = y[i-1] + 0.5*(y[i]-y[i-1]);
2095 if (optionMark != 10) {
2096 if (xm<rwxmax && xm > rwxmin) {
2102 if (xm<rwxmax && xm >= rwxmin) {
2142 const Int_t kBASEMARKER=8;
2143 Double_t s2x, s2y, symbolsize, sbase;
2144 Double_t x,
y, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2, tx, ty;
2145 static Float_t cxx[15] = {1,1,0.6,0.6,1,1,0.6,0.5,1,0.6,0.6,1,0.6,1,1};
2146 static Float_t cyy[15] = {1,1,1,1,1,1,1,1,1,0.5,0.6,1,1,1,1};
2155 if (strchr(option,
'X') || strchr(option,
'x')) {
PaintGraphSimple(theGraph, option);
return;}
2158 if (strstr(option,
"||") || strstr(option,
"[]")) {
2160 if (strstr(option,
"[]")) braticks =
kTRUE;
2163 if (strchr(option,
'z')) endLines =
kFALSE;
2164 if (strchr(option,
'Z')) endLines =
kFALSE;
2165 const char *arrowOpt = 0;
2166 if (strchr(option,
'>')) arrowOpt =
">";
2167 if (strstr(option,
"|>")) arrowOpt =
"|>";
2170 if (strchr(option,
'a')) axis =
kTRUE;
2171 if (strchr(option,
'A')) axis =
kTRUE;
2179 if (strchr(option,
'0')) option0 =
kTRUE;
2180 if (strchr(option,
'2')) option2 =
kTRUE;
2181 if (strchr(option,
'3')) option3 =
kTRUE;
2182 if (strchr(option,
'4')) {option3 =
kTRUE; option4 =
kTRUE;}
2183 if (strchr(option,
'5')) {option2 =
kTRUE; option5 =
kTRUE;}
2186 xline =
new Double_t[2*theNpoints];
2187 yline =
new Double_t[2*theNpoints];
2188 if (!xline || !yline) {
2189 Error(
"Paint",
"too many points, out of memory");
2196 theGraph->TAttLine::Modify();
2211 sbase = symbolsize*kBASEMARKER;
2215 if (mark >= 20 && mark <= 34) {
2224 tx =
gPad->PixeltoX(dxend) -
gPad->PixeltoX(0);
2225 ty =-
gPad->PixeltoY(dxend) +
gPad->PixeltoY(0);
2226 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2229 for (
Int_t i=0;i<theNpoints;i++) {
2230 x =
gPad->XtoPad(theX[i]);
2231 y =
gPad->YtoPad(theY[i]);
2234 if (x < gPad->GetUxmin()) x =
gPad->GetUxmin();
2235 if (x >
gPad->GetUxmax()) x =
gPad->GetUxmax();
2236 if (y < gPad->GetUymin()) y =
gPad->GetUymin();
2237 if (y >
gPad->GetUymax()) y =
gPad->GetUymax();
2239 if (x < gPad->GetUxmin())
continue;
2240 if (x >
gPad->GetUxmax())
continue;
2241 if (y < gPad->GetUymin())
continue;
2242 if (y >
gPad->GetUymax())
continue;
2246 xl2 =
gPad->XtoPad(theX[i] - theEXlow[i]);
2250 x1b =
gPad->XtoPad(theX[i] - theEXlow[i]);
2251 y1b =
gPad->YtoPad(theY[i] - theEYlow[i]);
2252 x2b =
gPad->XtoPad(theX[i] + theEXhigh[i]);
2253 y2b =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2254 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2255 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2256 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2257 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2258 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2259 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2260 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2261 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2262 if (option5) box.
PaintBox(x1b, y1b, x2b, y2b,
"l");
2263 else box.
PaintBox(x1b, y1b, x2b, y2b);
2271 yline[if1-1] =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2272 yline[if2-1] =
gPad->YtoPad(theY[i] - theEYlow[i]);
2280 arrow.
PaintArrow(xl1,y,xl2,y,asize,arrowOpt);
2282 if (!brackets)
gPad->PaintLine(xl1,y,xl2,y);
2285 xb[0] = xl2+tx; yb[0] = y-ty;
2286 xb[1] = xl2; yb[1] = y-ty;
2287 xb[2] = xl2; yb[2] = y+ty;
2288 xb[3] = xl2+tx; yb[3] = y+ty;
2289 gPad->PaintPolyLine(4, xb, yb);
2291 gPad->PaintLine(xl2,y-ty,xl2,y+ty);
2297 xr2 =
gPad->XtoPad(theX[i] + theEXhigh[i]);
2300 arrow.
PaintArrow(xr1,y,xr2,y,asize,arrowOpt);
2302 if (!brackets)
gPad->PaintLine(xr1,y,xr2,y);
2305 xb[0] = xr2-tx; yb[0] = y-ty;
2306 xb[1] = xr2; yb[1] = y-ty;
2307 xb[2] = xr2; yb[2] = y+ty;
2308 xb[3] = xr2-tx; yb[3] = y+ty;
2309 gPad->PaintPolyLine(4, xb, yb);
2311 gPad->PaintLine(xr2,y-ty,xr2,y+ty);
2317 yup2 =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2318 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2321 arrow.
PaintArrow(x,yup1,x,yup2,asize,arrowOpt);
2323 if (!brackets)
gPad->PaintLine(x,yup1,x,yup2);
2326 xb[0] = x-tx; yb[0] = yup2-ty;
2327 xb[1] = x-tx; yb[1] = yup2;
2328 xb[2] = x+tx; yb[2] = yup2;
2329 xb[3] = x+tx; yb[3] = yup2-ty;
2330 gPad->PaintPolyLine(4, xb, yb);
2332 gPad->PaintLine(x-tx,yup2,x+tx,yup2);
2338 ylow2 =
gPad->YtoPad(theY[i] - theEYlow[i]);
2339 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2340 if (ylow2 < ylow1) {
2342 arrow.
PaintArrow(x,ylow1,x,ylow2,asize,arrowOpt);
2344 if (!brackets)
gPad->PaintLine(x,ylow1,x,ylow2);
2347 xb[0] = x-tx; yb[0] = ylow2+ty;
2348 xb[1] = x-tx; yb[1] = ylow2;
2349 xb[2] = x+tx; yb[2] = ylow2;
2350 xb[3] = x+tx; yb[3] = ylow2+ty;
2351 gPad->PaintPolyLine(4, xb, yb);
2353 gPad->PaintLine(x-tx,ylow2,x+tx,ylow2);
2367 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline, yline,
"FC");
2368 else PaintGraph(theGraph, 2*theNpoints, xline, yline,
"F");
2369 gPad->SetLogx(logx);
2370 gPad->SetLogy(logy);
2389 const Int_t kBASEMARKER=8;
2390 Double_t s2x, s2y, symbolsize, sbase;
2391 Double_t x,
y, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2, tx, ty;
2393 static Float_t cxx[15] = {1,1,0.6,0.6,1,1,0.6,0.5,1,0.6,0.6,1,0.6,1,1};
2394 static Float_t cyy[15] = {1,1,1,1,1,1,1,1,1,0.5,0.6,1,1,1,1};
2407 if (strchr(option,
'X') || strchr(option,
'x')) {
PaintGraphSimple(theGraph, option);
return;}
2410 if (strstr(option,
"||") || strstr(option,
"[]")) {
2412 if (strstr(option,
"[]")) braticks =
kTRUE;
2415 if (strchr(option,
'z')) endLines =
kFALSE;
2416 if (strchr(option,
'Z')) endLines =
kFALSE;
2417 const char *arrowOpt = 0;
2418 if (strchr(option,
'>')) arrowOpt =
">";
2419 if (strstr(option,
"|>")) arrowOpt =
"|>";
2422 if (strchr(option,
'a')) axis =
kTRUE;
2423 if (strchr(option,
'A')) axis =
kTRUE;
2431 if (strchr(option,
'0')) option0 =
kTRUE;
2432 if (strchr(option,
'2')) option2 =
kTRUE;
2433 if (strchr(option,
'3')) option3 =
kTRUE;
2434 if (strchr(option,
'4')) {option3 =
kTRUE; option4 =
kTRUE;}
2435 if (strchr(option,
'5')) {option2 =
kTRUE; option5 =
kTRUE;}
2438 xline =
new Double_t[2*theNpoints];
2439 yline =
new Double_t[2*theNpoints];
2440 if (!xline || !yline) {
2441 Error(
"Paint",
"too many points, out of memory");
2448 theGraph->TAttLine::Modify();
2463 sbase = symbolsize*kBASEMARKER;
2467 if (mark >= 20 && mark <= 34) {
2476 tx =
gPad->PixeltoX(dxend) -
gPad->PixeltoX(0);
2477 ty =-
gPad->PixeltoY(dxend) +
gPad->PixeltoY(0);
2478 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2481 for (
Int_t i=0;i<theNpoints;i++) {
2482 x =
gPad->XtoPad(theX[i]);
2483 y =
gPad->YtoPad(theY[i]);
2484 bxl =
gPad->YtoPad(theY[i]+theEXlowd[i]);
2485 bxh =
gPad->YtoPad(theY[i]+theEXhighd[i]);
2486 byl =
gPad->XtoPad(theX[i]+theEYlowd[i]);
2487 byh =
gPad->XtoPad(theX[i]+theEYhighd[i]);
2490 if (x < gPad->GetUxmin()) x =
gPad->GetUxmin();
2491 if (x >
gPad->GetUxmax()) x =
gPad->GetUxmax();
2492 if (y < gPad->GetUymin()) y =
gPad->GetUymin();
2493 if (y >
gPad->GetUymax()) y =
gPad->GetUymax();
2495 if (x < gPad->GetUxmin())
continue;
2496 if (x >
gPad->GetUxmax())
continue;
2497 if (y < gPad->GetUymin())
continue;
2498 if (y >
gPad->GetUymax())
continue;
2504 x1b =
gPad->XtoPad(theX[i] - theEXlow[i]);
2505 y1b =
gPad->YtoPad(theY[i] - theEYlow[i]);
2506 x2b =
gPad->XtoPad(theX[i] + theEXhigh[i]);
2507 y2b =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2508 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2509 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2510 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2511 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2512 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2513 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2514 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2515 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2516 if (option5) box.
PaintBox(x1b, y1b, x2b, y2b,
"l");
2517 else box.
PaintBox(x1b, y1b, x2b, y2b);
2525 yline[if1-1] =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2526 yline[if2-1] =
gPad->YtoPad(theY[i] - theEYlow[i]);
2533 xl2 =
gPad->XtoPad(theX[i] - theEXlow[i]);
2536 arrow.
PaintArrow(xl1,y,xl2,bxl,asize,arrowOpt);
2538 if (!brackets)
gPad->PaintLine(xl1,y,xl2,bxl);
2541 xb[0] = xl2+tx; yb[0] = bxl-ty;
2542 xb[1] = xl2; yb[1] = bxl-ty;
2543 xb[2] = xl2; yb[2] = bxl+ty;
2544 xb[3] = xl2+tx; yb[3] = bxl+ty;
2545 gPad->PaintPolyLine(4, xb, yb);
2547 gPad->PaintLine(xl2,bxl-ty,xl2,bxl+ty);
2553 xr2 =
gPad->XtoPad(theX[i] + theEXhigh[i]);
2556 arrow.
PaintArrow(xr1,y,xr2,bxh,asize,arrowOpt);
2558 if (!brackets)
gPad->PaintLine(xr1,y,xr2,bxh);
2561 xb[0] = xr2-tx; yb[0] = bxh-ty;
2562 xb[1] = xr2; yb[1] = bxh-ty;
2563 xb[2] = xr2; yb[2] = bxh+ty;
2564 xb[3] = xr2-tx; yb[3] = bxh+ty;
2565 gPad->PaintPolyLine(4, xb, yb);
2567 gPad->PaintLine(xr2,bxh-ty,xr2,bxh+ty);
2573 yup2 =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2574 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2577 arrow.
PaintArrow(x,yup1,byh,yup2,asize,arrowOpt);
2579 if (!brackets)
gPad->PaintLine(x,yup1,byh,yup2);
2582 xb[0] = byh-tx; yb[0] = yup2-ty;
2583 xb[1] = byh-tx; yb[1] = yup2;
2584 xb[2] = byh+tx; yb[2] = yup2;
2585 xb[3] = byh+tx; yb[3] = yup2-ty;
2586 gPad->PaintPolyLine(4, xb, yb);
2588 gPad->PaintLine(byh-tx,yup2,byh+tx,yup2);
2594 ylow2 =
gPad->YtoPad(theY[i] - theEYlow[i]);
2595 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2596 if (ylow2 < ylow1) {
2598 arrow.
PaintArrow(x,ylow1,byl,ylow2,asize,arrowOpt);
2600 if (!brackets)
gPad->PaintLine(x,ylow1,byl,ylow2);
2603 xb[0] = byl-tx; yb[0] = ylow2+ty;
2604 xb[1] = byl-tx; yb[1] = ylow2;
2605 xb[2] = byl+tx; yb[2] = ylow2;
2606 xb[3] = byl+tx; yb[3] = ylow2+ty;
2607 gPad->PaintPolyLine(4, xb, yb);
2609 gPad->PaintLine(byl-tx,ylow2,byl+tx,ylow2);
2623 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline, yline,
"FC");
2624 else PaintGraph(theGraph, 2*theNpoints, xline, yline,
"F");
2625 gPad->SetLogx(logx);
2626 gPad->SetLogy(logy);
2645 const Int_t kBASEMARKER=8;
2646 Double_t s2x, s2y, symbolsize, sbase;
2647 Double_t x,
y,
ex,
ey, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2, tx, ty;
2648 static Float_t cxx[15] = {1,1,0.6,0.6,1,1,0.6,0.5,1,0.6,0.6,1,0.6,1,1};
2649 static Float_t cyy[15] = {1,1,1,1,1,1,1,1,1,0.5,0.6,1,1,1,1};
2656 if (strchr(option,
'X') || strchr(option,
'x')) {
PaintGraphSimple(theGraph, option);
return;}
2659 if (strstr(option,
"||") || strstr(option,
"[]")) {
2661 if (strstr(option,
"[]")) braticks =
kTRUE;
2664 if (strchr(option,
'z')) endLines =
kFALSE;
2665 if (strchr(option,
'Z')) endLines =
kFALSE;
2666 const char *arrowOpt = 0;
2667 if (strchr(option,
'>')) arrowOpt =
">";
2668 if (strstr(option,
"|>")) arrowOpt =
"|>";
2671 if (strchr(option,
'a')) axis =
kTRUE;
2672 if (strchr(option,
'A')) axis =
kTRUE;
2680 if (strchr(option,
'0')) option0 =
kTRUE;
2681 if (strchr(option,
'2')) option2 =
kTRUE;
2682 if (strchr(option,
'3')) option3 =
kTRUE;
2683 if (strchr(option,
'4')) {option3 =
kTRUE; option4 =
kTRUE;}
2684 if (strchr(option,
'5')) {option2 =
kTRUE; option5 =
kTRUE;}
2687 xline =
new Double_t[2*theNpoints];
2688 yline =
new Double_t[2*theNpoints];
2689 if (!xline || !yline) {
2690 Error(
"Paint",
"too many points, out of memory");
2697 theGraph->TAttLine::Modify();
2712 sbase = symbolsize*kBASEMARKER;
2716 if (mark >= 20 && mark <= 34) {
2725 tx =
gPad->PixeltoX(dxend) -
gPad->PixeltoX(0);
2726 ty =-
gPad->PixeltoY(dxend) +
gPad->PixeltoY(0);
2727 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2730 for (
Int_t i=0;i<theNpoints;i++) {
2731 x =
gPad->XtoPad(theX[i]);
2732 y =
gPad->YtoPad(theY[i]);
2735 if (x < gPad->GetUxmin()) x =
gPad->GetUxmin();
2736 if (x >
gPad->GetUxmax()) x =
gPad->GetUxmax();
2737 if (y < gPad->GetUymin()) y =
gPad->GetUymin();
2738 if (y >
gPad->GetUymax()) y =
gPad->GetUymax();
2740 if (x < gPad->GetUxmin())
continue;
2741 if (x >
gPad->GetUxmax())
continue;
2742 if (y < gPad->GetUymin())
continue;
2743 if (y >
gPad->GetUymax())
continue;
2751 x1b =
gPad->XtoPad(theX[i] - ex);
2752 y1b =
gPad->YtoPad(theY[i] - ey);
2753 x2b =
gPad->XtoPad(theX[i] + ex);
2754 y2b =
gPad->YtoPad(theY[i] + ey);
2755 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2756 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2757 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2758 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2759 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2760 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2761 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2762 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2763 if (option5) box.
PaintBox(x1b, y1b, x2b, y2b,
"l");
2764 else box.
PaintBox(x1b, y1b, x2b, y2b);
2772 yline[if1-1] =
gPad->YtoPad(theY[i] + ey);
2773 yline[if2-1] =
gPad->YtoPad(theY[i] - ey);
2780 xl2 =
gPad->XtoPad(theX[i] - ex);
2783 arrow.
PaintArrow(xl1,y,xl2,y,asize,arrowOpt);
2785 if (!brackets)
gPad->PaintLine(xl1,y,xl2,y);
2788 xb[0] = xl2+tx; yb[0] = y-ty;
2789 xb[1] = xl2; yb[1] = y-ty;
2790 xb[2] = xl2; yb[2] = y+ty;
2791 xb[3] = xl2+tx; yb[3] = y+ty;
2792 gPad->PaintPolyLine(4, xb, yb);
2794 gPad->PaintLine(xl2,y-ty,xl2,y+ty);
2800 xr2 =
gPad->XtoPad(theX[i] + ex);
2803 arrow.
PaintArrow(xr1,y,xr2,y,asize,arrowOpt);
2805 if (!brackets)
gPad->PaintLine(xr1,y,xr2,y);
2808 xb[0] = xr2-tx; yb[0] = y-ty;
2809 xb[1] = xr2; yb[1] = y-ty;
2810 xb[2] = xr2; yb[2] = y+ty;
2811 xb[3] = xr2-tx; yb[3] = y+ty;
2812 gPad->PaintPolyLine(4, xb, yb);
2814 gPad->PaintLine(xr2,y-ty,xr2,y+ty);
2820 yup2 =
gPad->YtoPad(theY[i] + ey);
2821 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2824 arrow.
PaintArrow(x,yup1,x,yup2,asize,arrowOpt);
2826 if (!brackets)
gPad->PaintLine(x,yup1,x,yup2);
2829 xb[0] = x-tx; yb[0] = yup2-ty;
2830 xb[1] = x-tx; yb[1] = yup2;
2831 xb[2] = x+tx; yb[2] = yup2;
2832 xb[3] = x+tx; yb[3] = yup2-ty;
2833 gPad->PaintPolyLine(4, xb, yb);
2835 gPad->PaintLine(x-tx,yup2,x+tx,yup2);
2841 ylow2 =
gPad->YtoPad(theY[i] - ey);
2842 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2843 if (ylow2 < ylow1) {
2845 arrow.
PaintArrow(x,ylow1,x,ylow2,asize,arrowOpt);
2847 if (!brackets)
gPad->PaintLine(x,ylow1,x,ylow2);
2850 xb[0] = x-tx; yb[0] = ylow2+ty;
2851 xb[1] = x-tx; yb[1] = ylow2;
2852 xb[2] = x+tx; yb[2] = ylow2;
2853 xb[3] = x+tx; yb[3] = ylow2+ty;
2854 gPad->PaintPolyLine(4, xb, yb);
2856 gPad->PaintLine(x-tx,ylow2,x+tx,ylow2);
2870 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline, yline,
"FC");
2871 else PaintGraph(theGraph, 2*theNpoints, xline, yline,
"F");
2872 gPad->SetLogx(logx);
2873 gPad->SetLogy(logy);
2887 Double_t rwrmin, rwrmax, rwtmin, rwtmax;
2891 Int_t theNpoints = theGraphPolar->
GetN();
2897 if (theNpoints<1)
return;
2912 if (thePolargram)
if (!
gPad->FindObject(thePolargram->
GetName())) thePolargram=0;
2913 if (!thePolargram) {
2916 while (
TObject* AnyObj = padObjIter.Next()) {
2917 if (
TString(AnyObj->ClassName()).CompareTo(
"TGraphPolargram",
2926 if (!thePolargram) {
2928 rwrmin = theY[0]; rwrmax = theY[theNpoints-1];
2929 rwtmin = theX[0]; rwtmax = theX[theNpoints-1];
2931 for (ipt = 0; ipt < theNpoints; ipt++) {
2934 if (theX[ipt] -theEX[ipt] < rwtmin) rwtmin = theX[ipt]-theEX[ipt];
2935 if (theX[ipt] +theEX[ipt] > rwtmax) rwtmax = theX[ipt]+theEX[ipt];
2937 if (theX[ipt] < rwtmin) rwtmin=theX[ipt];
2938 if (theX[ipt] > rwtmax) rwtmax=theX[ipt];
2941 if (theY[ipt] -theEY[ipt] < rwrmin) rwrmin = theY[ipt]-theEY[ipt];
2942 if (theY[ipt] +theEY[ipt] > rwrmax) rwrmax = theY[ipt]+theEY[ipt];
2944 if (theY[ipt] < rwrmin) rwrmin=theY[ipt];
2945 if (theY[ipt] > rwrmax) rwrmax=theY[ipt];
2949 if (rwrmin == rwrmax) rwrmax += 1.;
2950 if (rwtmin == rwtmax) rwtmax += 1.;
2957 rwtmax += dt/theNpoints;
2959 rwrmin = thePolargram->
GetRMin();
2960 rwrmax = thePolargram->
GetRMax();
2961 rwtmin = thePolargram->
GetTMin();
2962 rwtmax = thePolargram->
GetTMax();
2967 thePolargram =
new TGraphPolargram(
"Polargram",rwrmin,rwrmax,rwtmin,rwtmax);
2971 if (nolabel) thePolargram->
Draw(
"N");
2972 else thePolargram->
Draw(
"");
2981 Double_t radiusNDC = rwrmax-rwrmin;
2991 for (i=0; i<theNpoints; i++) {
2992 Double_t eymin, eymax, exmin,exmax;
2993 exmin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
2995 eymin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
2997 exmax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
2999 eymax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3001 theGraphPolar->TAttLine::Modify();
3002 if (exmin != exmax || eymin != eymax)
gPad->PaintLine(exmin,eymin,exmax,eymax);
3006 for (i=0; i<theNpoints; i++) {
3007 Double_t rad = c*(theY[i]-rwrmin)/radiusNDC;
3010 theGraphPolar->TAttLine::Modify();
3011 if (phimin != phimax) thePolargram->
PaintCircle(0,0,rad,phimin,phimax,0);
3017 if (!(
gPad->GetLogx()) && !(
gPad->GetLogy())) {
3018 Double_t a,
b, c=1,
x1,
x2, y1, y2, discr, norm1, norm2, xts, yts;
3026 for (i=0; i<theNpoints; i++) {
3029 xt = (theY[i]-rwrmin)/radiusNDC*
TMath::Cos(c*(theX[i]-rwtmin)/thetaNDC);
3030 yt = (theY[i]-rwrmin)/radiusNDC*
TMath::Sin(c*(theX[i]-rwtmin)/thetaNDC);
3031 norm =
sqrt(xt*xt+yt*yt);
3036 if (!previouspointin) {
3041 a = (yt-yts)/(xt-xts);
3043 discr = 4*(a*a-b*b+1);
3044 x1 = (-2*a*b+
sqrt(discr))/(2*(a*a+1));
3045 x2 = (-2*a*b-
sqrt(discr))/(2*(a*a+1));
3048 norm1 =
sqrt((x1-xt)*(x1-xt)+(y1-yt)*(y1-yt));
3049 norm2 =
sqrt((x2-xt)*(x2-xt)+(y2-yt)*(y2-yt));
3050 previouspointin =
kFALSE;
3052 if (norm1 < norm2) {
3062 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3067 if (j>=1 && !previouspointin) {
3068 a = (yt-theYpol[j])/(xt-theXpol[j]);
3069 b = theYpol[j]-a*theXpol[j];
3070 previouspointin =
kTRUE;
3071 discr = 4*(a*a-b*b+1);
3072 x1 = (-2*a*b+
sqrt(discr))/(2*(a*a+1));
3073 x2 = (-2*a*b-
sqrt(discr))/(2*(a*a+1));
3076 norm1 =
sqrt((x1-xt)*(x1-xt)+(y1-yt)*(y1-yt));
3077 norm2 =
sqrt((x2-xt)*(x2-xt)+(y2-yt)*(y2-yt));
3079 if (norm1 < norm2) {
3086 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3093 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3096 for (i=0; i<theNpoints; i++) {
3100 PaintGraph(theGraphPolar, theNpoints, theXpol, theYpol,opt);
3109 TIter next(
gPad->GetListOfPrimitives());
3110 while ((obj = next())) {
3113 if (title->GetName())
3114 if (strcmp(title->GetName(),
"title")) {title = 0;
continue;}
3118 if (title)
delete title;
3124 if (ht <= 0) ht = 0.05;
3139 if (wt > 0) title->SetX2NDC(title->GetX1NDC()+wt);
3145 if (talh < 1) talh = 1;
else if (talh > 3) talh = 3;
3147 if (talv < 1) talv = 1;
else if (talv > 3) talv = 3;
3153 if (talh == 2) xpos = xpos-wt/2.;
3154 if (talh == 3) xpos = xpos-wt;
3155 if (talv == 2) ypos = ypos+ht/2.;
3156 if (talv == 1) ypos = ypos+ht;
3189 TF1 *theF = theGraphQQ->
GetF();
3192 Error(
"TGraphQQ::Paint",
"2nd dataset or theoretical function not specified");
3207 Double_t yxmin, xymin, yxmax, xymax;
3213 TLine line1, line2, line3;
3216 yxmin = (theYq2-theYq1)*(xmin-theXq1)/(theXq2-theXq1) + theYq1;
3218 xymin = (theXq2-theXq1)*(ymin-theYq1)/(theYq2-theYq1) + theXq1;
3219 line1.
PaintLine(xymin, ymin, xqmin, yqmin);
3222 line1.
PaintLine(xmin, yxmin, xqmin, yqmin);
3224 line2.
PaintLine(xqmin, yqmin, xqmax, yqmax);
3226 yxmax = (theYq2-theYq1)*(xmax-theXq1)/(theXq2-theXq1) + theYq1;
3228 xymax = (theXq2-theXq1)*(ymax-theYq1)/(theYq2-theYq1) + theXq1;
3229 line3.
PaintLine(xqmax, yqmax, xymax, ymax);
3232 line3.
PaintLine(xqmax, yqmax, xmax, yxmax);
3266 theHist->
Paint(
"0");
3292 if (
gPad->GetGridx()) {
3293 GL = (YA2-YA1)/(
gPad->GetY2() -
gPad->GetY1());
3309 theNewAxis->
Paint();
3312 for (
Int_t i=0; i<
N; i++) newX[i] = dX-X[i];
3314 for (
Int_t i=0; i<
N; i++) newX[i] = X[i];
3325 if (
gPad->GetGridy()) {
3326 GL = (XA2-XA1)/(
gPad->GetX2() -
gPad->GetX1());
3342 theNewAxis->
Paint();
3345 for (
Int_t i=0; i<
N; i++) newY[i] = dY-Y[i];
3347 for (
Int_t i=0; i<
N; i++) newY[i] = Y[i];
3352 for (
Int_t i=0; i<
N; i++) theNewGraph->
SetPoint(i, newX[i], newY[i]);
3375 if (strstr(option,
"H") || strstr(option,
"h")) {
3384 if (!functions)
return;
3420 Double_t x1,
x2, y1, y2,
x3, y3, xm, ym,
a, a1, a2, a3;
3423 Int_t ix1,iy1,ix2,iy2;
3427 gPad->GetPadPar(x1p,y1p,x2p,y2p);
3428 ix1 = (
Int_t)(iw*x1p);
3429 iy1 = (
Int_t)(ih*y1p);
3430 ix2 = (
Int_t)(iw*x2p);
3431 iy2 = (
Int_t)(ih*y2p);
3443 gPad->GetRange(rx1,ry1,rx2,ry2);
3444 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
3445 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
3449 xf[0] = rx*(x[0]-rx1)+x1ndc;
3450 yf[0] = ry*(y[0]-ry1)+y1ndc;
3452 for (i=1; i<
n; i++) {
3453 if (x[i]==x[i-1] && y[i]==y[i-1])
continue;
3455 xf[nf] = rx*(x[i]-rx1)+x1ndc;
3456 if (xf[i]==xf[i-1]) xf[i] += 0.000001;
3457 yf[nf] = ry*(y[i]-ry1)+y1ndc;
3476 if (xf[nf]==xf[nf-1]) {
3479 a =
TMath::ATan((yf[nf]-yf[nf-1])/(xf[nf]-xf[nf-1]));
3481 if (xf[nf]>=xf[nf-1]) {
3490 for (i=1; i<nf; i++) {
3502 if (xi1<xi0) a1 = a1+3.14159;
3508 if (xi0<xi2) a2 = a2+3.14159;
3523 if ((xm-xi0)*(x3-xi0)<0 && (ym-yi0)*(y3-yi0)<0) {
3527 if ((xm==x1) && (ym==y1)) {
3536 if (xf[nf]==xf[0] && yf[nf]==yf[0]) {
3537 xm = (xt[nf]+xt[0])*0.5;
3538 ym = (yt[nf]+yt[0])*0.5;
3546 if ((xm-xf[0])*(x3-xf[0])<0 && (ym-yf[0])*(y3-yf[0])<0) {
3560 for (i=nf2; i>0; i--) {
3561 for (j=i-1; j>0; j--) {
3562 if (xt[i-1]==xt[i] || xt[j-1]==xt[j])
continue;
3563 c1 = (yt[i-1]-yt[i])/(xt[i-1]-xt[i]);
3564 b1 = yt[i]-c1*xt[i];
3565 c2 = (yt[j-1]-yt[j])/(xt[j-1]-xt[j]);
3566 b2 = yt[j]-c2*xt[j];
3568 xc = (b2-b1)/(c1-c2);
3574 nf++; xf[nf] = xt[i]; yf[nf] = yt[i];
3575 nf++; xf[nf] = xc ; yf[nf] = yc;
3593 nf++; xf[nf] = xt[0]; yf[nf] = yt[0];
3596 for (i=0; i<nf+1; i++) {
3597 xf[i] = (1/rx)*(xf[i]-x1ndc)+rx1;
3598 yf[i] = (1/ry)*(yf[i]-y1ndc)+ry1;
3602 gPad->PaintFillArea(nf+1,xf,yf);
3603 theGraph->TAttLine::Modify();
3621 TIter next(functions);
3623 while ((obj = next())) {
3633 if (!dofit) fit = 0;
3635 if (dofit == 1) dofit = 111;
3637 Int_t print_fval = dofit%10;
3638 Int_t print_ferrors = (dofit/10)%10;
3639 Int_t print_fchi2 = (dofit/100)%10;
3640 Int_t print_fprob = (dofit/1000)%10;
3641 Int_t nlinesf = print_fval + print_fchi2 + print_fprob;
3642 if (fit) nlinesf += fit->
GetNpar();
3680 if (print_fchi2) stats->
AddText(t);
3686 if (print_fval || print_ferrors) {
3688 if (print_ferrors) {
3701 if (!done) functions->
Add(stats);
3731 Int_t i, k, kp, km, npointsMax, banksize, n2, npt;
3732 Int_t maxiterations, finished;
3733 Int_t jtype, ktype, closed;
3734 Double_t sxmin, sxmax, symin, symax;
3737 Double_t ratio_signs, xratio, yratio;
3743 Double_t co, so, ct, st, ctu, stu, xnt;
3744 Double_t dx1, dy1, dx2, dy2, dk1, dk2;
3751 c = t = co = so = ct = st = ctu = stu = dx1 = dy1 = dx2 = dy2 = 0;
3752 xt = yt = xa = xb = ya = yb = u1 = u2 = u3 = tj = sb = 0;
3754 npointsMax = npoints*10;
3761 Error(
"Smooth",
"not enough space in memory");
3768 jtype = (drawtype%1000)-10;
3769 if (jtype > 0) { ktype = jtype; loptx =
kTRUE; }
3770 else ktype = drawtype%1000;
3799 for (i=1;i<npoints;i++) {
3801 if ((x[i]-x[i-1])*(x[i-1]-x[i-2]) < 0) six++;
3802 if ((y[i]-y[i-1])*(y[i-1]-y[i-2]) < 0) siy++;
3804 if (x[i] < sxmin) sxmin = x[i];
3805 if (x[i] > sxmax) sxmax = x[i];
3806 if (y[i] < symin) symin = y[i];
3807 if (y[i] > symax) symax = y[i];
3812 if (dx1n < 0.01*(sxmax-sxmin) && dy1n < 0.01*(symax-symin)) closed = 1;
3813 if (sxmin == sxmax) {
3816 if (six > 1) ratio_signs = siy/six;
3817 else ratio_signs = 20;
3818 xratio = ratio_signs/(sxmax-sxmin);
3820 if (symin == symax) yratio = 1;
3821 else yratio = 1/(symax-symin);
3825 for (i=0;i<npoints;i++) {
3826 x[i] = (x[i]-sxmin)*xratio;
3827 y[i] = (y[i]-symin)*yratio;
3846 if (x[0] != x[npoints-1] || y[0] != y[npoints-1])
goto L40;
3847 if (x[npoints-2] == x[npoints-1] && y[npoints-2] == y[npoints-1])
goto L40;
3848 if (x[0] == x[1] && y[0] == y[1])
goto L40;
3871 if (npt > 1)
goto L310;
3875 if (x[k-1] == x[k-2] && y[k-1] == y[k-2])
goto L50;
3880 if (npt > 1)
goto L310;
3883 if (k < npoints)
goto L90;
3884 if (!flgic) { kp = 2;
goto L130;}
3887 if (flgis)
goto L150;
3897 if (x[k-1] == x[k] && y[k-1] == y[k])
goto L80;
3905 if (!flgis)
goto L50;
3920 dx1 = x[k-1] - x[km-1];
3921 dy1 = y[k-1] - y[km-1];
3922 dk1 = dx1*dx1 + dy1*dy1;
3923 dx2 = x[kp-1] - x[k-1];
3924 dy2 = y[kp-1] - y[k-1];
3925 dk2 = dx2*dx2 + dy2*dy2;
3926 ctu = dx1*dk2 + dx2*dk1;
3927 stu = dy1*dk2 + dy2*dk1;
3928 xnt = ctu*ctu + stu*stu;
3942 if (flgis)
goto L160;
3946 w3 = 2*(dx1*dy2-dx2*dy1);
3958 w3 = 2*(dx1*dy2-dx2*dy1);
3967 if (k <= 1)
goto L120;
3997 xa = (a*t-2*dx)/tcube;
3998 xb = (3*dx-(co+
a)*t)/tsquare;
3999 ya = (b*t-2*dy)/tcube;
4000 yb = (3*dy-(so+
b)*t)/tsquare;
4031 p2 = (u1*tj-u3)*3*tj+u2;
4061 z = s*sth*(s-s*sth)*(w1*sth+w1+w2);
4062 z = z*z/((a*a+b*
b)*(delta*delta));
4063 z = (z+2.642937)*z/((.3715652*z+3.063444)*z+.2441889)-cc;
4067 if (iw > 0)
goto L250;
4068 if (z > err)
goto L240;
4073 if (iw+2 == 0)
goto L190;
4074 if (iw+2 > 0)
goto L290;
4092 theGraph->
Zero(kp,0,sb,err,s,z,maxiterations);
4093 if (kp == 2)
goto L210;
4095 Error(
"Smooth",
"Attempt to plot outside plot limits");
4098 if (iw > 0)
goto L200;
4124 qlx[npt] = sxmin + xt/xratio;
4125 qly[npt] = symin + yt/yratio;
4132 if (npt < banksize)
goto L320;
4133 if (drawtype >= 1000 || ktype > 1) {
4134 Int_t newsize = banksize + n2;
4136 for (i=0;i<banksize;i++) qtemp[i] = qlx[i];
4139 for (i=0;i<banksize;i++) qlx[i] = qtemp[i];
4140 for (i=0;i<banksize;i++) qtemp[i] = qly[i];
4143 for (i=0;i<banksize;i++) qly[i] = qtemp[i];
4152 if (drawtype >= 1000) {
4153 gPad->PaintFillArea(npt,qlx,qly,
"B");
4157 qlx[npt] = qlx[npt-1];
4158 qlx[npt+1] = qlx[0];
4164 qly[npt] = qly[npt-1];
4165 qly[npt+1] = qly[0];
4167 gPad->PaintFillArea(npt+2,qlx,qly);
4170 gPad->PaintPolyLine(npt,qlx,qly);
4173 qlx[0] = sxmin + xt/xratio;
4174 qly[0] = symin + yt/yratio;
4176 if (finished > 0)
goto L390;
4177 if (finished < 0) { finished = 0;
goto L110;}
4178 if (s > 0)
goto L180;
4184 for (i=0;i<npoints;i++) {
4185 x[i] = sxmin + x[i]/xratio;
4186 y[i] = symin + y[i]/yratio;
virtual Bool_t IsEditable() const
virtual const char * GetName() const
Returns name of object.
virtual Double_t GetMaximumStored() const
void SetTickLength(Float_t ticklength)
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual Float_t GetTickLength() const
Color_t GetStatColor() const
double dist(Rotation3D const &r1, Rotation3D const &r2)
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...
Style_t GetTitleFont(Option_t *axis="X") const
Return title font.
virtual void Paint(Option_t *option="")
Control routine to paint any kind of histograms.
Color_t GetLabelColor(Option_t *axis="X") const
Return the label color number in the axis.
void SetOptFit(Int_t fit=1)
Set the fit option.
virtual void SetName(const char *name="")
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
virtual Double_t * GetEX() const
virtual void SetMaximum(Double_t maximum=-1111)
Float_t GetLabelSize(Option_t *axis="X") const
Return label size.
static double p3(double t, double a, double b, double c, double d)
virtual Int_t DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py)
Compute distance from point px,py to a graph.
virtual void SetLimits(Double_t xmin, Double_t xmax)
virtual void ExecuteEventHelper(TGraph *theGraph, Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Color_t GetTitleTextColor() const
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 Smooth(TGraph *theGraph, Int_t npoints, Double_t *x, Double_t *y, Int_t drawtype)
Smooth a curve given by N points.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Computes distance from point (px,py) to the object.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual Float_t GetLabelOffset() const
static Int_t fgMaxPointsPerLine
Color_t GetAxisColor(Option_t *axis="X") const
Return the axis color number in the axis.
void PaintCircle(Double_t x, Double_t y, Double_t r, Double_t phimin, Double_t phimax, Double_t theta)
This is simplified from TEllipse::PaintEllipse.
virtual Double_t * GetEYlow() const
virtual Double_t GetMinimumStored() const
TString & ReplaceAll(const TString &s1, const TString &s2)
R__EXTERN TStyle * gStyle
Bool_t TestBit(UInt_t f) const
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
virtual Color_t GetAxisColor() const
virtual Double_t * GetEXhighd() const
void Draw(Option_t *options="")
Draw Polargram.
TList * GetListOfFunctions() const
TAxis * GetYaxis() const
Get y axis of the graph.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
void ToUpper()
Change string to upper case.
virtual Double_t * GetEY() const
virtual void SetMinimum(Double_t minimum=-1111)
Float_t GetEndErrorSize() const
Option_t * GetOption() const
tomato 1-D histogram with a float per channel (see TH1 documentation)}
void PaintStats(TGraph *theGraph, TF1 *fit)
Paint the statistics box with the fit info.
Short_t Min(Short_t a, Short_t b)
void ToLower()
Change string to lower-case.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
void SetOptionAxis(Bool_t opt)
The histogram statistics painter class.
virtual Int_t GetNdivisions(Option_t *axis="X") const
Return the number of divisions for "axis".
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
void PaintGraphPolar(TGraph *theGraph, Option_t *option)
[Paint this TGraphPolar with its current attributes.]($GP04)
virtual Float_t GetLabelSize() const
Float_t GetTitleY() const
static void SetMaxPointsPerLine(Int_t maxp=50)
Static function to set fgMaxPointsPerLine for graph painting.
virtual ~TGraphPainter()
Destructor.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
const char * GetFitFormat() const
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels The distance is expressed in per cent of the pad width...
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
virtual Width_t GetLineWidth() const
Return the line width.
Style_t GetLabelFont(Option_t *axis="X") const
Return label font.
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...
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Int_t GetOptFit() const
Return the fit option.
if object in a list can be deleted
This class allows to draw quantile-quantile plots.
TGraphPainter()
Default constructor.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
virtual Style_t GetLineStyle() const
Return the line style.
virtual Int_t GetNDF() const
Return the number of degrees of freedom in the fit the fNDF parameter has been previously computed du...
static const double x2[5]
Double_t GetYsize()
Return size of the formula along Y in pad coordinates.
void PaintGraphAsymmErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphAsymmErrors with its current attributes.
virtual void DrawPanelHelper(TGraph *theGraph)
Display a panel with all histogram drawing options.
Float_t GetTitleFontSize() const
static TVirtualPadEditor * GetPadEditor(Bool_t load=kTRUE)
Returns the pad editor dialog. Static method.
virtual void Paint(Option_t *option="")
Paint this pavetext with its current attributes.
virtual void SetStatFormat(const char *format="6.4g")
Change (i.e. set) the format for printing statistics.
clip to the frame boundary
To draw Mathematical Formula.
Double_t Log10(Double_t x)
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.
static double p2(double t, double a, double b, double c)
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
TString & Append(const char *cs)
TGraphPolargram * GetPolargram()
virtual Size_t GetMarkerSize() const
Return the marker size.
virtual void Clear(Option_t *option="")
Clear all lines in this pavetext.
Base class for several text objects.
Float_t GetTitleX() const
Bool_t IsInside(T xp, T yp, Int_t np, T *x, T *y)
Float_t GetBarWidth() const
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Style_t GetStatStyle() const
virtual Color_t GetLabelColor() const
void SetLabelSize(Float_t labelsize)
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void PaintGrapHist(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
This is a service method used by THistPainter to paint 1D histograms.
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
virtual char * GetObjectInfoHelper(TGraph *theGraph, Int_t px, Int_t py) const
virtual void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
virtual const char * GetParName(Int_t ipar) const
void PaintHelper(TGraph *theGraph, Option_t *option)
Paint a any kind of TGraph.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a line.
virtual Double_t * GetEYhighd() const
virtual void SetLineColor(Color_t lcolor)
Set the line color.
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 PaintGraphErrors(TGraph *theGraph, Option_t *option)
[Paint this TGraphErrors with its current attributes.]($GP03)
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Double_t GetXsize()
Return size of the formula along X in pad coordinates.
Float_t GetTitleH() const
void PaintGraphQQ(TGraph *theGraph, Option_t *option)
Paint this graphQQ. No options for the time being.
Style_t GetStatFont() const
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
void PaintGraphBentErrors(TGraph *theGraph, Option_t *option)
[Paint this TGraphBentErrors with its current attributes.]($GP03)
virtual void PaintArrow(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Float_t arrowsize=0.05, Option_t *option=">")
Draw this arrow.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char * Form(const char *fmt,...)
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
static double p1(double t, double a, double b)
virtual void SetFitFormat(const char *format="5.4g")
Change (i.e. set) the format for printing fit parameters in statistics box.
virtual const char * GetFitFormat() const
virtual void SetAxisColor(Color_t color=1, Float_t alpha=1.)
Set color of the line axis and tick marks.
if object destructor must call RecursiveRemove()
virtual void PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="")
Draw this box with new coordinates.
Double_t GetMaximum() const
Color_t GetTitleFillColor() 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...
TAxis * GetXaxis() const
Get x axis of the graph.
virtual Color_t GetLineColor() const
Return the line color.
virtual Double_t * GetEXlowd() const
void ComputeLogs(Int_t npoints, Int_t opt)
Compute the logarithm of global variables gxwork and gywork according to the value of Options and put...
Width_t GetTitleBorderSize() const
Float_t GetTitleW() const
Double_t GetChisquare() const
virtual void Paint(Option_t *option="")
This method must be overridden if a class wants to paint itself.
virtual Double_t * GetEYlowd() const
void SetLabelOffset(Float_t labeloffset)
static const double x1[5]
A Pave (see TPave) with text, lines or/and boxes inside.
TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases...
void SetDrawBorder(Int_t drawborder=1)
virtual Double_t * GetEXlow() const
Int_t GetDrawBorder() const
virtual Color_t GetFillColor() const
Return the fill area color.
void SetLabelFont(Int_t labelfont)
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.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Abstract base class used by ROOT graphics editor.
virtual void PaintGraph(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
[Control function to draw a graph.]($GP01)
Width_t GetStatBorderSize() const
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Mother of all ROOT objects.
you should not use this method at all Int_t Int_t z
TObject * GetObject() const
Float_t GetStatFontSize() const
virtual const char * GetTitle() const
Returns title of object.
virtual Int_t GetNpar() const
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
virtual void Paint(Option_t *chopt="")
Draw this axis with its current attributes.
Float_t GetTickLength(Option_t *axis="X") const
Return tick length.
virtual void Add(TObject *obj)
virtual Double_t GetParameter(Int_t ipar) const
Short_t Max(Short_t a, Short_t b)
A Graph is a graphics object made of two arrays X and Y with npoints each.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
void SetTickSize(Float_t ticksize)
Float_t GetLabelOffset(Option_t *axis="X") const
Return label offset.
Double_t * GetXpol()
Return points in polar coordinates.
void SetLabelColor(Int_t labelcolor)
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length The length is expressed in per cent of the pad width.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetHistogram(TH1F *h)
virtual void Paint(Option_t *option="")
Paint the pave stat.
Float_t GetBarOffset() const
Style_t GetTitleStyle() const
virtual Color_t GetMarkerColor() const
Return the marker color.
Double_t Sqrt(Double_t x)
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Color_t GetStatTextColor() const
virtual Double_t * GetEYhigh() 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.
Int_t GetNdivisions(Option_t *axis="X") const
Return number of divisions.
Draw all kinds of Arrows.
virtual const char * GetName() const
Returns name of object.
Double_t * GetYpol()
Return points in polar coordinates.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Double_t GetMinimum() const
double norm(double *x, double *p)
constexpr Double_t PiOver2()
virtual Double_t * GetEXhigh() const
void PaintGraphSimple(TGraph *theGraph, Option_t *option)
Paint a simple graph, without errors bars.
virtual void SetBorderSize(Int_t bordersize=4)
virtual Style_t GetLabelFont() const
const char * GetStatFormat() const
virtual const char * GetTitle() const
Returns title of object.
void PaintGraphReverse(TGraph *theGraph, Option_t *option)
Paint theGraph reverting values along X and/or Y axis. a new graph is created.
void SetParent(TObject *obj)
don't draw the histogram title
void SetOptStat(Int_t stat=1)
Set the stat option.
Int_t GetOptTitle() const
static const double x3[11]
const char * Data() const
void SetPolargram(TGraphPolargram *p)