747 Error(
"TGaxis",
"calling constructor with an unknown function: %s", funcname);
781 fGridLength(ax.fGridLength),
782 fTickSize(ax.fTickSize),
783 fLabelOffset(ax.fLabelOffset),
784 fLabelSize(ax.fLabelSize),
785 fTitleOffset(ax.fTitleOffset),
786 fTitleSize(ax.fTitleSize),
788 fLabelColor(ax.fLabelColor),
789 fLabelFont(ax.fLabelFont),
790 fNModLabs(ax.fNModLabs),
794 fTimeFormat(ax.fTimeFormat),
795 fFunctionName(ax.fFunctionName),
796 fFunction(ax.fFunction),
798 fModLabs(ax.fModLabs)
961 const char *where =
"PaintAxis";
971 Double_t phil, phi, sinphi, cosphi, asinphi, acosphi;
972 Double_t binLow = 0., binLow2 = 0., binLow3 = 0.;
973 Double_t binHigh = 0., binHigh2 = 0., binHigh3 = 0.;
974 Double_t binWidth = 0., binWidth2 = 0., binWidth3 = 0.;
985 xx0 = xx1 = yy0 = yy1 = 0;
986 Double_t xxmin, xxmax, yymin, yymax;
987 xxmin = xxmax = yymin = yymax = 0;
991 Double_t xmnlog, x00, x11, h2, h2sav, axmul,
y;
994 Int_t nlabels, nticks, nticks0, nticks1;
995 Int_t i, j, k,
l, decade, ltick;
999 Int_t iexe, if1, if2, na, nf, ih1, ih2, nbinin, nch, kmod;
1000 Int_t optionLog,optionBlank,optionVert,optionPlus,optionMinus,optionUnlab,optionPara;
1001 Int_t optionDown,optionRight,optionLeft,optionCent,optionEqual,optionDecimals=0,optionDot;
1002 Int_t optionY,optionText,optionGrid,optionSize,optionNoopt,optionInt,optionM,optionUp,optionX;
1005 Int_t xalign, yalign;
1006 Int_t nn1, nn2, nn3, n1a, n2a, n3a, nb2, nb3;
1007 Int_t nbins=10, n1aold, nn1old;
1009 n1aold = nn1old = 0;
1034 chtemp = &kchtemp[0];
1035 label = &chlabel[0];
1054 if(strchr(chopt,
'G')) optionLog = 1;
else optionLog = 0;
1055 if(strchr(chopt,
'B')) optionBlank= 1;
else optionBlank= 0;
1056 if(strchr(chopt,
'V')) optionVert = 1;
else optionVert = 0;
1057 if(strchr(chopt,
'+')) optionPlus = 1;
else optionPlus = 0;
1058 if(strchr(chopt,
'-')) optionMinus= 1;
else optionMinus= 0;
1059 if(strchr(chopt,
'U')) optionUnlab= 1;
else optionUnlab= 0;
1060 if(strchr(chopt,
'P')) optionPara = 1;
else optionPara = 0;
1061 if(strchr(chopt,
'O')) optionDown = 1;
else optionDown = 0;
1062 if(strchr(chopt,
'R')) optionRight= 1;
else optionRight= 0;
1063 if(strchr(chopt,
'L')) optionLeft = 1;
else optionLeft = 0;
1064 if(strchr(chopt,
'C')) optionCent = 1;
else optionCent = 0;
1065 if(strchr(chopt,
'=')) optionEqual= 1;
else optionEqual= 0;
1066 if(strchr(chopt,
'Y')) optionY = 1;
else optionY = 0;
1067 if(strchr(chopt,
'T')) optionText = 1;
else optionText = 0;
1068 if(strchr(chopt,
'W')) optionGrid = 1;
else optionGrid = 0;
1069 if(strchr(chopt,
'S')) optionSize = 1;
else optionSize = 0;
1070 if(strchr(chopt,
'N')) optionNoopt= 1;
else optionNoopt= 0;
1071 if(strchr(chopt,
'I')) optionInt = 1;
else optionInt = 0;
1072 if(strchr(chopt,
'M')) optionM = 1;
else optionM = 0;
1073 if(strchr(chopt,
'0')) optionUp = 1;
else optionUp = 0;
1074 if(strchr(chopt,
'X')) optionX = 1;
else optionX = 0;
1075 if(strchr(chopt,
't')) optionTime = 1;
else optionTime = 0;
1076 if(strchr(chopt,
'.')) optionDot = 1;
else optionDot = 0;
1098 Error(where,
"Invalid number of divisions: %d",ndiv);
1105 if (gridlength == 0) gridlength = 0.8;
1106 linegrid =
new TLine();
1136 Int_t year,
mm, dd, hh, mi, ss;
1137 if (sscanf(stringtimeoffset.
Data(),
"%d-%d-%d %d:%d:%d", &year, &
mm, &dd, &hh, &mi, &ss) == 6) {
1140 tp.tm_year = year-1900;
1154 TString sdp = stringtimeoffset(ids+1,lns);
1155 sscanf(sdp.
Data(),
"%g",&dp);
1159 Error(where,
"Time offset has not the right format");
1164 wmin += timeoffset - (int)(timeoffset);
1165 wmax += timeoffset - (int)(timeoffset);
1169 time_t timetp = (time_t)((
Long_t)(timeoffset));
1172 if (range>60) rangeBase = 60*20;
1173 if (range>3600) rangeBase = 3600*20;
1174 if (range>86400) rangeBase = 86400*20;
1175 if (range>2419200) rangeBase = 31556736;
1177 if (range>31536000) {
1178 tp0 = gmtime(&timetp);
1185 rangeBase = (timetp-mktime(tp0));
1186 rangeOffset = (
Double_t) (rangeBase);
1188 wmax += rangeOffset;
1189 wmin += rangeOffset;
1194 n2a = (ndiv%10000 - n1a)/100;
1195 n3a = (ndiv%1000000 - n2a -n1a)/10000;
1200 maxDigits = (ndiv/1000000);
1209 if (wmin == wmax || ndiv == 0 || n1a <= 1 || optionLog) {
1215 if ( (wmax-wmin) < 1 && optionInt) {
1216 Error(where,
"option I not available");
1219 if (!optionNoopt || optionInt ) {
1227 if (binLow !=
Double_t(
int(binLow)) || binWidth !=
Double_t(
int(binWidth))) {
1231 if ((wmin-binLow) >
epsilon) { binLow += binWidth; nbins--; }
1232 if ((binHigh-wmax) >
epsilon) { binHigh -= binWidth; nbins--; }
1237 yymin = rtyw*(binLow-wmin) +
ymin;
1238 yymax = rtyw*(binHigh-wmin) +
ymin;
1242 xxmin = rtxw*(binLow-wmin) +
xmin;
1243 xxmax = rtxw*(binHigh-wmin) +
xmin;
1251 yymin = alfa*xxmin +
beta;
1252 yymax = alfa*xxmax +
beta;
1267 if (!optionNoopt && n2a > 1 && binWidth > 0) {
1273 if (!optionNoopt && n3a > 1 && binWidth2 > 0) {
1287 ratio1 = 1/(rwxmax-rwxmin);
1288 ratio2 = 1/(rwymax-rwymin);
1289 x0 = ratio1*(
xmin-rwxmin);
1290 x1 = ratio1*(
xmax-rwxmin);
1291 y0 = ratio2*(
ymin-rwymin);
1292 y1 = ratio2*(
ymax-rwymin);
1293 if (!optionNoopt || optionInt ) {
1294 xx0 = ratio1*(xxmin-rwxmin);
1295 xx1 = ratio1*(xxmax-rwxmin);
1296 yy0 = ratio2*(yymin-rwymin);
1297 yy1 = ratio2*(yymax-rwymin);
1300 if ((x0 ==
x1) && (y0 == y1)) {
1301 Error(where,
"length of axis is 0");
1308 if (toffset==0 &&
x1 == x0) autotoff =
kTRUE;
1321 if (!
gPad->IsBatch()) {
1322 gVirtualX->GetCharacterUp(chupxvsav, chupyvsav);
1328 if (axis_length == 0) {
1329 Error(where,
"length of axis is 0");
1332 if (!optionNoopt || optionInt) {
1333 axis_lengthN =
TMath::Sqrt((xx1-xx0)*(xx1-xx0)+(yy1-yy0)*(yy1-yy0));
1334 axis_length0 =
TMath::Sqrt((xx0-x0)*(xx0-x0)+(yy0-y0)*(yy0-y0));
1345 wmin += timeoffset - (int)(timeoffset) + rangeOffset;
1346 wmax += timeoffset - (int)(timeoffset) + rangeOffset;
1352 if (y1>=y0) phi = 0.5*
kPI;
1368 if (acosphi <=
epsilon) { acosphi = 0; cosphi = 0; }
1369 if (asinphi <=
epsilon) { asinphi = 0; sinphi = 0; }
1377 if (x0 ==
x1 && y1 > y0) mside = -1;
1378 if (optionPlus) mside = 1;
1379 if (optionMinus) mside = -1;
1380 if (optionPlus && optionMinus) mside = 0;
1383 if (optionEqual) lside = mside;
1384 if (optionPlus && optionMinus) {
1386 if (optionEqual) lside=1;
1391 if(xmside >= 0) tick_side = 1;
1392 else tick_side = -1;
1393 if (optionSize) atick[0] = tick_side*axis_length*
fTickSize;
1394 else atick[0] = tick_side*axis_length*0.03;
1396 atick[1] = 0.5*atick[0];
1397 atick[2] = 0.5*atick[1];
1400 if ((x0 ==
x1) && (y1 > y0)) grid_side =-1;
1425 if (ndiv == 0)
goto L210;
1427 Error(where,
"wmin (%f) == wmax (%f)", wmin, wmax);
1437 if (optionText &&
GetLabelFont()%10 != 3) charheight *= 0.66666;
1447 if (!optionUp && !optionDown && !optionY && !optionUnlab) {
1462 if (nl > 50) angle = 90;
1509 if (!
gPad->IsBatch()) {
1510 if (cosphi > 0)
gVirtualX->SetCharacterUp(-sinphi,cosphi);
1511 else gVirtualX->SetCharacterUp(sinphi,-cosphi);
1513 if (optionVert)
gVirtualX->SetCharacterUp(0,1);
1514 if (optionPara)
gVirtualX->SetCharacterUp(-sinphi,cosphi);
1515 if (optionDown)
gVirtualX->SetCharacterUp(cosphi,sinphi);
1521 if (x0 ==
x1) xalign = 3;
1522 if (y0 != y1) yalign = 2;
1523 if (optionCent) xalign = 2;
1524 if (optionRight) xalign = 3;
1525 if (optionLeft) xalign = 1;
1529 if (cosphi*sinphi > 0) xalign = 1;
1530 if (cosphi*sinphi < 0) xalign = 3;
1536 if (optionPlus && !optionMinus) {
1541 if (lside < 0) ylabel += atick[0];
1543 }
else if (y0 == y1) {
1544 if (optionMinus && !optionPlus) {
1555 if (mside <= 0) ylabel -=
TMath::Abs(atick[0]);
1557 if (optionLog) ylabel -= 0.5*charheight;
1562 if (optionText) ylabel /= 2;
1568 dxtick=(binHigh-binLow)/
Double_t(nticks-1);
1570 if (optionNoopt && !optionInt) dxtick=axis_length/
Double_t(nticks-1);
1571 else dxtick=axis_lengthN/
Double_t(nticks-1);
1573 for (k=0;k<nticks; k++) {
1575 if (k%nn3 == 0) ltick = 1;
1576 if (k%nn2 == 0) ltick = 0;
1580 xtick = zz* axis_length /
TMath::Abs(rwma-rwmi);
1585 if (!mside) ytick -= atick[ltick];
1586 if ( optionNoopt && !optionInt) {
1587 Rotate(xtick,ytick,cosphi,sinphi,x0,y0,xpl2,ypl2);
1588 Rotate(xtick,atick[ltick],cosphi,sinphi,x0,y0,xpl1,ypl1);
1591 Rotate(xtick,ytick,cosphi,sinphi,xx0,yy0,xpl2,ypl2);
1592 Rotate(xtick,atick[ltick],cosphi,sinphi,xx0,yy0,xpl1,ypl1);
1595 if ((x0 !=
x1) && (y0 != y1)) {
1598 if (cosphi > 0) ypl1 = ypl2 + atick[ltick];
1599 else ypl1 = ypl2 - atick[ltick];
1602 xpl1 = 0.5*(xpl1 + xpl2);
1604 ypl1 = 0.5*(ypl1 + ypl2) + atick[ltick];
1605 ypl2 = 0.5*(ypl1 + ypl2) - atick[ltick];
1609 if (!drawGridOnly)
PaintLineNDC(xpl1, ypl1, xpl2, ypl2);
1613 if (optionNoopt && !optionInt) {
1614 Rotate(xtick,0,cosphi,sinphi,x0,y0 ,xpl2,ypl2);
1615 Rotate(xtick,grid_side*gridlength ,cosphi,sinphi,x0,y0 ,xpl1,ypl1);
1618 Rotate(xtick,0,cosphi ,sinphi,xx0,yy0 ,xpl2,ypl2);
1619 Rotate(xtick,grid_side*gridlength ,cosphi,sinphi,xx0,yy0 ,xpl1,ypl1);
1628 if (
fFunction) axis_length0 = binLow-wmin;
1629 if ((!optionNoopt || optionInt) && axis_length0) {
1630 nticks0 =
Int_t(axis_length0/dxtick);
1631 if (nticks0 > 1000) nticks0 = 1000;
1632 for (k=0; k<=nticks0; k++) {
1634 if (k%nn3 == 0) ltick = 1;
1635 if (k%nn2 == 0) ltick = 0;
1637 if (!mside) ytick0 -= atick[ltick];
1642 Rotate(xtick0,ytick0,cosphi,sinphi,xx0,yy0 ,xpl2,ypl2);
1643 Rotate(xtick0,atick[ltick],cosphi,sinphi,xx0,yy0 ,xpl1,ypl1);
1645 if ((x0 !=
x1) && (y0 != y1)) {
1648 if (cosphi > 0) ypl1 = ypl2 + atick[ltick];
1649 else ypl1 = ypl2 - atick[ltick];
1652 xpl1 = 0.5*(xpl1 + xpl2);
1654 ypl1 = 0.5*(ypl1 + ypl2) + atick[ltick];
1655 ypl2 = 0.5*(ypl1 + ypl2) - atick[ltick];
1659 if (!drawGridOnly)
PaintLineNDC(xpl1, ypl1, xpl2, ypl2);
1663 Rotate(xtick0,0,cosphi,sinphi,xx0,yy0,xpl2,ypl2);
1664 Rotate(xtick0,grid_side*gridlength ,cosphi,sinphi,xx0,yy0 ,xpl1,ypl1);
1672 if (
fFunction) axis_length1 = wmax-binHigh;
1673 if ((!optionNoopt || optionInt) && axis_length1) {
1674 nticks1 = int(axis_length1/dxtick);
1675 if (nticks1 > 1000) nticks1 = 1000;
1676 for (k=0; k<=nticks1; k++) {
1678 if (k%nn3 == 0) ltick = 1;
1679 if (k%nn2 == 0) ltick = 0;
1681 if (!mside) ytick1 -= atick[ltick];
1686 Rotate(xtick1,ytick1,cosphi,sinphi,xx0,yy0 ,xpl2,ypl2);
1687 Rotate(xtick1,atick[ltick],cosphi,sinphi,xx0,yy0 ,xpl1,ypl1);
1689 if ((x0 !=
x1) && (y0 != y1)) {
1692 if (cosphi > 0) ypl1 = ypl2 + atick[ltick];
1693 else ypl1 = ypl2 - atick[ltick];
1696 xpl1 = 0.5*(xpl1 + xpl2);
1698 ypl1 = 0.5*(ypl1 + ypl2) + atick[ltick];
1699 ypl2 = 0.5*(ypl1 + ypl2) - atick[ltick];
1703 if (!drawGridOnly)
PaintLineNDC(xpl1, ypl1, xpl2, ypl2);
1706 Rotate(xtick1,0,cosphi,sinphi,xx0,yy0 ,xpl2,ypl2);
1707 Rotate(xtick1,grid_side*gridlength,cosphi,sinphi,xx0,yy0,xpl1,ypl1);
1718 if (!drawGridOnly && !optionUnlab) {
1722 if ((wmin == wmax) || (ndiv == 0)) {
1723 Error(where,
"wmin (%f) == wmax (%f), or ndiv == 0", wmin, wmax);
1727 dwlabel = (wmax-wmin)/
Double_t(n1a);
1728 if (optionNoopt && !optionInt) dxlabel = axis_length/
Double_t(n1a);
1729 else dxlabel = axis_lengthN/
Double_t(n1a);
1731 if (!optionText && !optionTime) {
1753 if (iexe%3 == 1) iexe += 2;
1754 else if(iexe%3 == 2) iexe += 1;
1755 if (nexe < 0) nexe = -iexe;
1768 if (!noExponent && nf > maxDigits) flexpo =
kTRUE;
1769 if (!noExponent && nf < -maxDigits) flexne =
kTRUE;
1780 if (nexe%3 == 0 && ww <=
TMath::Power(10,maxDigits-1))
break;
1792 if (nexe%3 == 0 && ww >= rne)
break;
1797 for (i=maxDigits-1; i>0; i--) {
1803 if (wdyn <= 0.999 && na < maxDigits-2) {
1823 coded = &chcoded[0];
1824 if (if1 > 14) if1 = 14;
1825 if (if2 > 14) if2 = 14;
1826 if (if1 < 0) if1 = 0;
1828 snprintf(coded,8,
"%%%d.%df",if1,if2);
1830 snprintf(coded,8,
"%%%d.%df",if1+1,1);
1838 Int_t ndecimals = 0;
1839 if (optionDecimals) {
1840 char *dot = strchr(chtemp,
'.');
1842 ndecimals = chtemp + strlen(chtemp) -dot;
1845 exp = strstr(chtemp,
"e-");
1847 sscanf(&
exp[2],
"%d",&ndecimals);
1852 if (optionM) nlabels = n1a-1;
1855 for ( k=0; k<=nlabels; k++) {
1860 xlabel = zz* axis_length /
TMath::Abs(rwma-rwmi);
1864 if (optionM) xlabel += 0.5*dxlabel;
1866 if (!optionText && !optionTime) {
1867 snprintf(label,256,&chcoded[0],wlabel);
1873 if (label[
first] ==
'.') {
1874 strncpy(chtemp,
"0",256);
1875 strlcat(chtemp, &label[
first],256);
1876 strncpy(label, chtemp,256);
1877 first = 1; last = strlen(label);
1879 if (label[
first] ==
'-' && label[
first+1] ==
'.') {
1880 strncpy(chtemp,
"-0",256);
1881 strlcat(chtemp, &label[
first+1],256);
1882 strncpy(label, chtemp, 256);
1883 first = 1; last = strlen(label);
1888 char *adot = strchr(label,
'.');
1889 if (adot) adot[ndecimals] = 0;
1891 while (label[last] ==
'0') { label[last] = 0; last--;}
1895 if (label[last] ==
'.') {
1896 if (!optionDot) { label[last] = 0; last--;}
1901 && label[last] ==
'0') {
1902 strncpy(label,
"0", 256);
1910 timed = wlabel + (int)(timeoffset) - rangeOffset;
1911 timelabel = (time_t)((
Long_t)(timed));
1912 if (optionTime == 1) {
1913 utctis = localtime(&timelabel);
1915 utctis = gmtime(&timelabel);
1918 if (timeformat.
Length() < 220) timeformattmp = timeformat;
1919 else timeformattmp =
"#splitline{Format}{too long}";
1925 snprintf(label, 256,
"%%S%7.5f", modf(timed,&tmpdb));
1926 tmplast = strlen(label)-1;
1929 while (label[tmplast] ==
'0') {
1930 label[tmplast] = 0; tmplast--;
1939 if (utctis !=
nullptr) {
1940 strftime(label, 256, timeformattmp.
Data(), utctis);
1942 strncpy(label,
"invalid", 256);
1944 strncpy(chtemp, &label[0], 256);
1945 first = 0; last=strlen(label)-1;
1946 wlabel = wTimeIni + (k+1)*dwlabel;
1951 if (optionNoopt && !optionInt)
1952 Rotate (xlabel,ylabel,cosphi,sinphi,x0,y0,xx,yy);
1953 else Rotate (xlabel,ylabel,cosphi,sinphi,xx0,yy0,xx,yy);
1954 if (y0 == y1 && !optionDown && !optionUp) {
1955 yy -= 0.80*charheight;
1958 if (x0 !=
x1 && y0 != y1) {
1959 if (optionNoopt && !optionInt)
1960 Rotate (xlabel,0,cosphi,sinphi,x0,y0,xx,yy);
1961 else Rotate (xlabel,0,cosphi,sinphi,xx0,yy0,xx,yy);
1962 if (cosphi > 0 ) yy += ylabel;
1963 if (cosphi < 0 ) yy -= ylabel;
1966 if (!optionY || (x0 ==
x1)) {
1968 if (
first > last) strncpy(chtemp,
" ", 256);
1969 else strncpy(chtemp, &label[
first], 255);
1972 if (!optionTime) typolabel.
ReplaceAll(
"-",
"#minus");
1995 if (!optionText) lnlen = last-
first+1;
1997 if (k+1 > nhilab) lnlen = 0;
1999 for (
l=1;
l<=lnlen;
l++) {
2000 if (!optionText) *chtemp = label[
first+
l-2];
2002 if (lnlen == 0) strncpy(chtemp,
" ", 256);
2003 else strncpy(chtemp,
"1", 256);
2012 yy -= charheight*1.3;
2019 if (flexe && !optionText && nexe) {
2020 snprintf(label,256,
"#times10^{%d}", nexe);
2021 if (x0 !=
x1) { xfactor = axis_length+0.1*charheight; yfactor = 0; }
2022 else { xfactor = y1-y0+0.1*charheight; yfactor = 0; }
2023 Rotate (xfactor,yfactor,cosphi,sinphi,x0,y0,xx,yy);
2049 if (optionLog && ndiv) {
2050 UInt_t xi1=0,xi2=0,wi=0,yi1=0,yi2=0,
hi=0,xl=0,xh=0;
2052 if ((wmin == wmax) || (ndiv == 0)) {
2053 Error(where,
"wmin (%f) == wmax (%f), or ndiv == 0", wmin, wmax);
2057 Error(where,
"negative logarithmic axis");
2061 Error(where,
"negative logarithmic axis");
2065 if (xmnlog > 0) xmnlog += 1.E-6;
2066 else xmnlog -= 1.E-6;
2071 if (h2 > 0) h2 += 1.E-6;
2076 axmul = (x11-x00)/(h2sav-xmnlog);
2081 if ( xmnlog > 0 && (xmnlog-
Double_t(ih1) > 0) ) labelnumber++;
2082 Int_t changelablogid = 0;
2083 Int_t changelablognum = 0;
2084 for (j=1; j<=nbinin; j++) {
2089 if (x0 ==
x1 && j == 1) ylabel += charheight*0.33;
2090 if (y0 == y1 && j == 1) ylabel -= charheight*0.65;
2091 xone = x00+axmul*(
Double_t(decade)-xmnlog);
2093 if (j < 0) printf(
"j=%d\n",j);
2094 if (x00 > xone)
goto L160;
2095 if ((xone-x11)>
epsilon)
break;
2098 if (!mside)
y -= atick[0];
2099 Rotate(xone,
y,cosphi,sinphi,x0,y0,xpl2,ypl2);
2100 Rotate(xtwo,atick[0],cosphi,sinphi,x0,y0,xpl1,ypl1);
2102 if ((x0 !=
x1) && (y0 != y1)) {
2105 if (cosphi > 0) ypl1 = ypl2 + atick[0];
2106 else ypl1 = ypl2 - atick[0];
2109 xpl1 = 0.5*(xpl1 + xpl2);
2111 ypl1 = 0.5*(ypl1 + ypl2) + atick[0];
2112 ypl2 = 0.5*(ypl1 + ypl2) - atick[0];
2116 if (!drawGridOnly)
PaintLineNDC(xpl1, ypl1, xpl2, ypl2);
2119 Rotate(xone,0,cosphi,sinphi,x0,y0,xpl2,ypl2);
2120 Rotate(xone,grid_side*gridlength,cosphi,sinphi,x0,y0,xpl1,ypl1);
2124 if (!drawGridOnly && !optionUnlab) {
2131 while (last >
first) {
2132 if (label[last] !=
'0')
break;
2136 if (label[last] ==
'.') {label[last] = 0; last--;}
2138 snprintf(label,256,
"%d", labelnumber);
2141 Rotate (xone,ylabel,cosphi,sinphi,x0,y0,xx,yy);
2142 if ((x0 ==
x1) && !optionPara) {
2145 if (labelnumber == 0) nch=1;
2147 xx += nch*charheight;
2149 xx += 0.25*charheight;
2152 xx += 0.25*charheight;
2154 if ((y0 == y1) && !optionDown && !optionUp) {
2155 if (noExponent) yy += 0.33*charheight;
2157 if (n1a == 0)
goto L210;
2159 if (kmod == 0) kmod=1000000;
2160 if ((nbinin <= n1a) || (j == 1) || (j == nbinin) || ((nbinin > n1a) && (j%kmod == 0))) {
2161 if (labelnumber == 0) {
2163 }
else if (labelnumber == 1) {
2167 chtemp = &label[
first];
2169 snprintf(chtemp,256,
"10^{%d}", labelnumber);
2173 if (changelablogid == 0) changelablognum = nbinin-j;
2193 for (k=2;k<10;k++) {
2197 if (x00 > xone)
continue;
2198 if (xone > x11)
goto L200;
2200 if (!mside)
y -= atick[1];
2202 Rotate(xone,
y,cosphi,sinphi,x0,y0,xpl2,ypl2);
2203 Rotate(xtwo,atick[1],cosphi,sinphi,x0,y0,xpl1,ypl1);
2205 if ((x0 !=
x1) && (y0 != y1)) {
2208 if (cosphi > 0) ypl1 = ypl2 + atick[1];
2209 else ypl1 = ypl2 - atick[1];
2212 xpl1 = 0.5*(xpl1+xpl2);
2214 ypl1 = 0.5*(ypl1+ypl2) + atick[1];
2215 ypl2 = 0.5*(ypl1+ypl2) - atick[1];
2220 if ((nbinin <= idn) || ((nbinin > idn) && (k == 5))) {
2221 if (!drawGridOnly)
PaintLineNDC(xpl1, ypl1, xpl2, ypl2);
2225 if (moreLogLabels && !optionUnlab && !drawGridOnly && !overlap) {
2230 if (labelnumber-1 == 0) {
2232 }
else if (labelnumber-1 == 1) {
2235 snprintf(chtemp,256,
"%d#times10^{%d}", k, labelnumber-1);
2238 Rotate (xone,ylabel,cosphi,sinphi,x0,y0,xx,yy);
2239 if ((x0 ==
x1) && !optionPara) {
2242 if (labelnumber == 0) nch=1;
2244 xx += nch*charheight;
2246 if (labelnumber >= 0) xx += 0.25*charheight;
2247 else xx += 0.50*charheight;
2250 xx += 0.25*charheight;
2252 if ((y0 == y1) && !optionDown && !optionUp) {
2253 if (noExponent) yy += 0.33*charheight;
2256 if ((x0 !=
x1) && (y0 != y1)) {
2257 Rotate(xone,ylabel,cosphi,sinphi,x0,y0,xx,yy);
2258 if (cosphi > 0) yy += ylabel;
2267 xi1 =
gPad->XtoAbsPixel(u);
2268 yi1 =
gPad->YtoAbsPixel(
v);
2274 xi2 =
gPad->XtoAbsPixel(u);
2275 yi2 =
gPad->YtoAbsPixel(
v);
2278 if ((x0 ==
x1 && yi1-
hi <= yi2) || (y0 == y1 && xl+wi >= xh)){
2292 if (optionGrid && nbinin <= 5 && ndiv > 100) {
2293 Rotate(xone,0,cosphi,sinphi,x0,y0,xpl2, ypl2);
2294 Rotate(xone,grid_side*gridlength,cosphi,sinphi,x0,y0, xpl1,ypl1);
2305 if (!drawGridOnly && strlen(
GetTitle())) {
2309 charheight = charheight/
gPad->GetWh();
2313 if (toffset) ylabel = xlside*charheight+toffset;
2314 else ylabel = xlside*1.6*charheight;
2316 ylabel = xlside*1.6*charheight*toffset;
2319 ylabel = xlside*1.3*charheight*toffset;
2323 ylabel = xlside*1.6*charheight*toffset;
2327 else axispos = axis_length;
2346 Rotate(axispos,ylabel,cosphi,sinphi,x0,y0,xpl1,ypl1);
2357 if (optionGrid)
delete linegrid;
2376 if (binWidth <= 1) { binWidth = 1; binLow = int(A1); }
2380 binLow = int(A1/binWidth)*binWidth;
2386 for (
Int_t ic=0; ic<1000; ic++) {
2388 Int_t ibl = int(binLow/binWidth);
2389 if ( (rbl-ibl) == 0 || ic >
width) { binLow -= 5;
break;}
2396 while (xb <= binHigh) {
2400 binHigh = xb - binWidth;
2408 last = strlen(label)-1;
2409 for (
Int_t i=0; i<=last; i++) {
2410 if (strchr(
"1234567890-+.", label[i]) ) {
first = i;
return; }
2412 Error(
"LabelsLimits",
"attempt to draw a blank label");
2436 out<<
"gaxis = new TGaxis("<<
fX1<<
","<<
fY1<<
","<<
fX2<<
","<<
fY2
2438 out<<
" gaxis->SetLabelOffset("<<
GetLabelOffset()<<
");"<<std::endl;
2439 out<<
" gaxis->SetLabelSize("<<
GetLabelSize()<<
");"<<std::endl;
2440 out<<
" gaxis->SetTickSize("<<
GetTickSize()<<
");"<<std::endl;
2441 out<<
" gaxis->SetGridLength("<<
GetGridLength()<<
");"<<std::endl;
2442 out<<
" gaxis->SetTitleOffset("<<
GetTitleOffset()<<
");"<<std::endl;
2443 out<<
" gaxis->SetTitleSize("<<
GetTitleSize()<<
");"<<std::endl;
2444 out<<
" gaxis->SetTitleColor("<<
GetTextColor()<<
");"<<std::endl;
2445 out<<
" gaxis->SetTitleFont("<<
GetTextFont()<<
");"<<std::endl;
2448 out<<
" gaxis->SetName("<<quote<<
GetName()<<quote<<
");"<<std::endl;
2451 out<<
" gaxis->SetTitle("<<quote<<
GetTitle()<<quote<<
");"<<std::endl;
2457 out<<
" gaxis->SetLabelColor(ci);" << std::endl;
2459 out<<
" gaxis->SetLabelColor("<<
GetLabelColor()<<
");"<<std::endl;
2464 out<<
" gaxis->SetLineColor(ci);" << std::endl;
2466 out<<
" gaxis->SetLineColor("<<
GetLineColor()<<
");"<<std::endl;
2469 out<<
" gaxis->SetLineStyle("<<
GetLineStyle()<<
");"<<std::endl;
2472 out<<
" gaxis->SetLineWidth("<<
GetLineWidth()<<
");"<<std::endl;
2475 out<<
" gaxis->SetLabelFont("<<
GetLabelFont()<<
");"<<std::endl;
2478 out<<
" gaxis->SetMoreLogLabels();"<<std::endl;
2481 out<<
" gaxis->SetNoExponent();"<<std::endl;
2484 out<<
" gaxis->Draw();"<<std::endl;
2512 Error(
"SetFunction",
"unknown function: %s", funcname);
2611 if (labNum < 0) labNum = nlabels + labNum + 2;
2722 if (timeformat.
Index(
"%F")>=0 || timeformat.
IsNull()) {
2754 timeoff = (time_t)((
Long_t)(toffset));
2758 utctis = gmtime(&timeoff);
2760 if (utctis !=
nullptr) {
2761 strftime(tmp, 20,
"%Y-%m-%d %H:%M:%S",utctis);
2800void TGaxis::Streamer(
TBuffer &R__b)
2810 TLine::Streamer(R__b);
2811 TAttText::Streamer(R__b);
2826 fName.Streamer(R__b);
static const double x2[5]
static const double x1[5]
static RooMathCoreReg dummy
include TDocParser_001 C image html pict1_TDocParser_001 png width
static Double_t SavedTextAngle
Change the label attributes of label number i.
static Int_t SavedTextFont
static Int_t SavedTextAlign
static Double_t SavedTextSize
static Int_t SavedTextColor
float type_of_call hi(const int &, const int &)
Binding & operator=(OUT(*fun)(void))
R__EXTERN TStyle * gStyle
virtual Color_t GetTitleColor() const
virtual Color_t GetLabelColor() const
virtual Color_t GetAxisColor() const
virtual Style_t GetTitleFont() const
virtual Float_t GetLabelOffset() const
virtual Style_t GetLabelFont() const
virtual Float_t GetTitleSize() const
virtual Float_t GetLabelSize() const
virtual Float_t GetTickLength() const
virtual Float_t GetTitleOffset() const
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Width_t fLineWidth
Line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
Style_t fLineStyle
Line style.
Color_t fLineColor
Line color.
virtual Float_t GetTextSize() const
Return the text size.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual Short_t GetTextAlign() const
Return the text alignment.
virtual Font_t GetTextFont() const
Return the text font.
Color_t fTextColor
Text color.
Float_t fTextAngle
Text angle.
virtual Color_t GetTextColor() const
Return the text color.
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
virtual Float_t GetTextAngle() const
Return the text angle.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Font_t fTextFont
Text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Short_t fTextAlign
Text alignment.
Float_t fTextSize
Text size.
TAxis helper class used to store the modified labels.
void SetColor(Int_t c=-1)
Set modified label color.
void SetSize(Double_t s=-1.)
Set modified label size.
void SetFont(Int_t f=-1)
Set modified label font.
void SetText(TString t="")
Set modified label text.
void SetAlign(Int_t a=-1)
Set modified label alignment.
void SetLabNum(Int_t n=0)
Set modified label number.
void SetAngle(Double_t a=-1.)
Set modified label angle.
Class to manage histogram axis.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
const char * GetBinLabel(Int_t bin) const
Return label for bin.
Bool_t GetDecimals() const
Int_t GetLast() const
Return last bin on the axis i.e.
TList * GetModifiedLabels() const
virtual const char * GetTimeFormat() const
const char * GetTitle() const
Returns title of object.
Int_t GetFirst() const
Return first bin on the axis i.e.
THashList * GetLabels() const
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
static void SaveColor(std::ostream &out, Int_t ci)
Save a color with index > 228 as a C++ statement(s) on output stream out.
virtual Double_t GetXmax() const
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
virtual Double_t GetXmin() const
static Int_t fgMaxDigits
! Number of digits above which the 10>N notation is used
virtual void Paint(Option_t *chopt="")
Draw this axis with its current attributes.
virtual void SetNoExponent(Bool_t noExponent=kTRUE)
Set the NoExponent flag.
void SetTimeFormat(const char *tformat)
Change the format used for time plotting.
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.
static Float_t fYAxisExpYOffset
! Exponent Y offset for the Y axis
TGaxis()
TGaxis default constructor.
void SetTitleOffset(Float_t titleoffset=1)
Float_t fTitleSize
Size of title in NDC.
Float_t GetGridLength() const
void SetLabelFont(Int_t labelfont)
void SetTitleSize(Float_t titlesize)
Float_t fTitleOffset
Offset of title wrt axis.
TString fTitle
Axis title.
Int_t fLabelFont
Font for labels.
virtual void SetTitle(const char *title="")
Change the title of the axis.
Int_t fLabelColor
Color for labels.
TAxis * fAxis
! Pointer to original TAxis axis (if any)
TString fTimeFormat
Time format, ex: 09/12/99 12:34:00.
TString fFunctionName
Name of mapping function pointed by fFunction.
void SetLabelOffset(Float_t labeloffset)
virtual void Rotate(Double_t X, Double_t Y, Double_t CFI, Double_t SFI, Double_t XT, Double_t YT, Double_t &U, Double_t &V)
Internal method to rotate axis coordinates.
virtual const char * GetTitle() const
Returns title of object.
Float_t GetLabelOffset() const
void SetTimeOffset(Double_t toffset, Option_t *option="local")
Change the time offset. If option = "gmt", set display mode to GMT.
Float_t fTickSize
Size of primary tick mark in NDC.
static Float_t fYAxisExpXOffset
! Exponent X offset for the Y axis
virtual void ImportAxisAttributes(TAxis *axis)
Internal method to import TAxis attributes to this TGaxis.
Int_t GetLabelFont() const
Float_t fLabelOffset
Offset of label wrt axis.
static Float_t fXAxisExpYOffset
! Exponent Y offset for the X axis
static void SetMaxDigits(Int_t maxd=5)
Static function to set fgMaxDigits for axis.
Float_t fLabelSize
Size of labels in NDC.
Int_t fNdiv
Number of divisions.
void ChangeLabelAttributes(Int_t i, Int_t nlabels, TLatex *t, char *c)
TString fChopt
Axis options.
TGaxis & operator=(const TGaxis &)
Assignment operator.
Float_t GetTitleOffset() const
TF1 * fFunction
! Pointer to function computing axis values
void ChangeLabel(Int_t labNum=0, Double_t labAngle=-1., Double_t labSize=-1., Int_t labAlign=-1, Int_t labColor=-1, Int_t labFont=-1, TString labText="")
Define new text attributes for the label number "labNum".
Float_t GetTitleSize() const
static Int_t GetMaxDigits()
Static function returning fgMaxDigits (See SetMaxDigits).
virtual void CenterLabels(Bool_t center=kTRUE)
If center = kTRUE axis labels are centered in the center of the bin.
void SetLabelColor(Int_t labelcolor)
virtual const char * GetName() const
Returns name of object.
virtual void AdjustBinSize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BinWidth)
Internal method for axis labels optimisation.
virtual void DrawAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t wmin, Double_t wmax, Int_t ndiv=510, Option_t *chopt="", Double_t gridlength=0)
Draw this axis with new attributes.
Float_t fGridLength
Length of the grid in NDC.
Int_t GetLabelColor() const
virtual void SetDecimals(Bool_t dot=kTRUE)
Set the decimals flag.
virtual void CenterTitle(Bool_t center=kTRUE)
If center = kTRUE axis title will be centered. The default is right adjusted.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual ~TGaxis()
TGaxis default destructor.
TList * fModLabs
List of modified labels.
Double_t fWmax
Highest value on the axis.
Float_t GetTickSize() const
virtual void SetMoreLogLabels(Bool_t more=kTRUE)
Set the kMoreLogLabels bit flag.
void SetTickSize(Float_t ticksize)
Int_t fNModLabs
Number of modified labels.
Double_t fWmin
Lowest value on the axis.
void SetLabelSize(Float_t labelsize)
void SetFunction(const char *funcname="")
Specify a function to map the axis values.
static Float_t fXAxisExpXOffset
! Exponent X offset for the X axis
virtual void SetName(const char *name)
Change the name of the axis.
static void SetExponentOffset(Float_t xoff=0., Float_t yoff=0., Option_t *axis="xy")
Static function to set X and Y offset of the axis 10^n notation.
void LabelsLimits(const char *label, Int_t &first, Int_t &last)
Internal method to find first and last character of a label.
void ResetLabelAttributes(TLatex *t)
Reset the label attributes to the value they have before the last call to ChangeLabelAttributes.
Float_t GetLabelSize() const
void SetOption(Option_t *option="")
To set axis options.
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
Static function to compute reasonable axis limits.
To draw Mathematical Formula.
Double_t GetXsize()
Return size of the formula along X in pad coordinates.
void GetBoundingBox(UInt_t &w, UInt_t &h, Bool_t angle=kFALSE)
Return text size in pixels.
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Main drawing function.
Double_t fY1
Y of 1st point.
Double_t fX1
X of 1st point.
TLine()
Line default constructor.
Double_t fX2
X of 2nd point.
Double_t fY2
Y of 2nd point.
virtual void PaintLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2)
Draw this line with new coordinates in NDC.
virtual void Add(TObject *obj)
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
TObject & operator=(const TObject &rhs)
TObject assignment operator.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
@ kCanDelete
if object in a list can be deleted
void ToLower()
Change string to lower-case.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Double_t GetTimeOffset() const
Color_t GetGridColor() const
Style_t GetGridStyle() const
Float_t GetTitleOffset(Option_t *axis="X") const
Return title offset.
Width_t GetGridWidth() const
Int_t GetStripDecimals() const
virtual void SetText(Double_t x, Double_t y, const char *text)
static time_t MktimeFromUTC(tm_t *tmstruct)
Equivalent of standard routine "mktime" but using the assumption that tm struct is filled with UTC,...
double beta(double x, double y)
Calculates the beta function.
static constexpr double s
static constexpr double mm
Short_t Max(Short_t a, Short_t b)
Double_t ATan2(Double_t, Double_t)
Double_t Sqrt(Double_t x)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Short_t Min(Short_t a, Short_t b)
Double_t Log10(Double_t x)