745 Error(
"TGaxis",
"calling constructor with an unknown function: %s", funcname);
779 fGridLength(ax.fGridLength),
780 fTickSize(ax.fTickSize),
781 fLabelOffset(ax.fLabelOffset),
782 fLabelSize(ax.fLabelSize),
783 fTitleOffset(ax.fTitleOffset),
784 fTitleSize(ax.fTitleSize),
786 fLabelColor(ax.fLabelColor),
787 fLabelFont(ax.fLabelFont),
788 fNModLabs(ax.fNModLabs),
792 fTimeFormat(ax.fTimeFormat),
793 fFunctionName(ax.fFunctionName),
794 fFunction(ax.fFunction),
796 fModLabs(ax.fModLabs)
959 const char *where =
"PaintAxis";
969 Double_t phil, phi, sinphi, cosphi, asinphi, acosphi;
970 Double_t binLow = 0., binLow2 = 0., binLow3 = 0.;
971 Double_t binHigh = 0., binHigh2 = 0., binHigh3 = 0.;
972 Double_t binWidth = 0., binWidth2 = 0., binWidth3 = 0.;
983 xx0 = xx1 = yy0 = yy1 = 0;
984 Double_t xxmin, xxmax, yymin, yymax;
985 xxmin = xxmax = yymin = yymax = 0;
989 Double_t xmnlog, x00, x11, h2, h2sav, axmul,
y;
992 Int_t nlabels, nticks, nticks0, nticks1;
993 Int_t i, j, k,
l, decade, ltick;
997 Int_t iexe, if1, if2, na, nf, ih1, ih2, nbinin, nch, kmod;
998 Int_t optionLog,optionBlank,optionVert,optionPlus,optionMinus,optionUnlab,optionPara;
999 Int_t optionDown,optionRight,optionLeft,optionCent,optionEqual,optionDecimals=0,optionDot;
1000 Int_t optionY,optionText,optionGrid,optionSize,optionNoopt,optionInt,optionM,optionUp,optionX;
1003 Int_t xalign, yalign;
1004 Int_t nn1, nn2, nn3, n1a, n2a, n3a, nb2, nb3;
1005 Int_t nbins=10, n1aold, nn1old;
1007 n1aold = nn1old = 0;
1031 chtemp = &kchtemp[0];
1032 label = &chlabel[0];
1051 if(strchr(chopt,
'G')) optionLog = 1;
else optionLog = 0;
1052 if(strchr(chopt,
'B')) optionBlank= 1;
else optionBlank= 0;
1053 if(strchr(chopt,
'V')) optionVert = 1;
else optionVert = 0;
1054 if(strchr(chopt,
'+')) optionPlus = 1;
else optionPlus = 0;
1055 if(strchr(chopt,
'-')) optionMinus= 1;
else optionMinus= 0;
1056 if(strchr(chopt,
'U')) optionUnlab= 1;
else optionUnlab= 0;
1057 if(strchr(chopt,
'P')) optionPara = 1;
else optionPara = 0;
1058 if(strchr(chopt,
'O')) optionDown = 1;
else optionDown = 0;
1059 if(strchr(chopt,
'R')) optionRight= 1;
else optionRight= 0;
1060 if(strchr(chopt,
'L')) optionLeft = 1;
else optionLeft = 0;
1061 if(strchr(chopt,
'C')) optionCent = 1;
else optionCent = 0;
1062 if(strchr(chopt,
'=')) optionEqual= 1;
else optionEqual= 0;
1063 if(strchr(chopt,
'Y')) optionY = 1;
else optionY = 0;
1064 if(strchr(chopt,
'T')) optionText = 1;
else optionText = 0;
1065 if(strchr(chopt,
'W')) optionGrid = 1;
else optionGrid = 0;
1066 if(strchr(chopt,
'S')) optionSize = 1;
else optionSize = 0;
1067 if(strchr(chopt,
'N')) optionNoopt= 1;
else optionNoopt= 0;
1068 if(strchr(chopt,
'I')) optionInt = 1;
else optionInt = 0;
1069 if(strchr(chopt,
'M')) optionM = 1;
else optionM = 0;
1070 if(strchr(chopt,
'0')) optionUp = 1;
else optionUp = 0;
1071 if(strchr(chopt,
'X')) optionX = 1;
else optionX = 0;
1072 if(strchr(chopt,
't')) optionTime = 1;
else optionTime = 0;
1073 if(strchr(chopt,
'.')) optionDot = 1;
else optionDot = 0;
1096 Error(where,
"Invalid number of divisions: %d",ndiv);
1103 if (gridlength == 0) gridlength = 0.8;
1104 linegrid =
new TLine();
1134 Int_t year,
mm, dd, hh, mi, ss;
1135 if (sscanf(stringtimeoffset.
Data(),
"%d-%d-%d %d:%d:%d", &year, &
mm, &dd, &hh, &mi, &ss) == 6) {
1138 tp.tm_year = year-1900;
1152 TString sdp = stringtimeoffset(ids+1,lns);
1153 sscanf(sdp.
Data(),
"%g",&dp);
1157 Error(where,
"Time offset has not the right format");
1162 wmin += timeoffset - (
int)(timeoffset);
1163 wmax += timeoffset - (
int)(timeoffset);
1167 time_t timetp = (time_t)((
Long_t)(timeoffset));
1170 if (range>60) rangeBase = 60*20;
1171 if (range>3600) rangeBase = 3600*20;
1172 if (range>86400) rangeBase = 86400*20;
1173 if (range>2419200) rangeBase = 31556736;
1175 if (range>31536000) {
1176 tp0 = gmtime(&timetp);
1183 rangeBase = (timetp-mktime(tp0));
1184 rangeOffset = (
Double_t) (rangeBase);
1186 wmax += rangeOffset;
1187 wmin += rangeOffset;
1192 n2a = (ndiv%10000 - n1a)/100;
1193 n3a = (ndiv%1000000 - n2a -n1a)/10000;
1198 maxDigits = (ndiv/1000000);
1207 if (wmin == wmax || ndiv == 0 || n1a <= 1 || optionLog) {
1213 if ( (wmax-wmin) < 1 && optionInt) {
1214 Error(where,
"option I not available");
1217 if (!optionNoopt || optionInt ) {
1225 if (binLow !=
Double_t(
int(binLow)) || binWidth !=
Double_t(
int(binWidth))) {
1229 if ((wmin-binLow) >
epsilon) { binLow += binWidth; nbins--; }
1230 if ((binHigh-wmax) >
epsilon) { binHigh -= binWidth; nbins--; }
1235 yymin = rtyw*(binLow-wmin) +
ymin;
1236 yymax = rtyw*(binHigh-wmin) +
ymin;
1240 xxmin = rtxw*(binLow-wmin) +
xmin;
1241 xxmax = rtxw*(binHigh-wmin) +
xmin;
1249 yymin = alfa*xxmin +
beta;
1250 yymax = alfa*xxmax +
beta;
1265 if (!optionNoopt && n2a > 1 && binWidth > 0) {
1271 if (!optionNoopt && n3a > 1 && binWidth2 > 0) {
1285 ratio1 = 1/(rwxmax-rwxmin);
1286 ratio2 = 1/(rwymax-rwymin);
1287 x0 = ratio1*(
xmin-rwxmin);
1288 x1 = ratio1*(
xmax-rwxmin);
1289 y0 = ratio2*(
ymin-rwymin);
1290 y1 = ratio2*(
ymax-rwymin);
1291 if (!optionNoopt || optionInt ) {
1292 xx0 = ratio1*(xxmin-rwxmin);
1293 xx1 = ratio1*(xxmax-rwxmin);
1294 yy0 = ratio2*(yymin-rwymin);
1295 yy1 = ratio2*(yymax-rwymin);
1298 if ((x0 ==
x1) && (y0 == y1)) {
1299 Error(where,
"length of axis is 0");
1306 if (toffset==0 &&
x1 == x0) autotoff =
kTRUE;
1319 if (!
gPad->IsBatch()) {
1320 gVirtualX->GetCharacterUp(chupxvsav, chupyvsav);
1326 if (axis_length == 0) {
1327 Error(where,
"length of axis is 0");
1330 if (!optionNoopt || optionInt) {
1331 axis_lengthN =
TMath::Sqrt((xx1-xx0)*(xx1-xx0)+(yy1-yy0)*(yy1-yy0));
1332 axis_length0 =
TMath::Sqrt((xx0-x0)*(xx0-x0)+(yy0-y0)*(yy0-y0));
1343 wmin += timeoffset - (
int)(timeoffset) + rangeOffset;
1344 wmax += timeoffset - (
int)(timeoffset) + rangeOffset;
1350 if (y1>=y0) phi = 0.5*
kPI;
1366 if (acosphi <=
epsilon) { acosphi = 0; cosphi = 0; }
1367 if (asinphi <=
epsilon) { asinphi = 0; sinphi = 0; }
1375 if (x0 ==
x1 && y1 > y0) mside = -1;
1376 if (optionPlus) mside = 1;
1377 if (optionMinus) mside = -1;
1378 if (optionPlus && optionMinus) mside = 0;
1381 if (optionEqual) lside = mside;
1382 if (optionPlus && optionMinus) {
1384 if (optionEqual) lside=1;
1389 if(xmside >= 0) tick_side = 1;
1390 else tick_side = -1;
1391 if (optionSize) atick[0] = tick_side*axis_length*
fTickSize;
1392 else atick[0] = tick_side*axis_length*0.03;
1394 atick[1] = 0.5*atick[0];
1395 atick[2] = 0.5*atick[1];
1398 if ((x0 ==
x1) && (y1 > y0)) grid_side =-1;
1423 if (ndiv == 0)
goto L210;
1425 Error(where,
"wmin (%f) == wmax (%f)", wmin, wmax);
1435 if (optionText &&
GetLabelFont()%10 != 3) charheight *= 0.66666;
1445 if (!optionUp && !optionDown && !optionY && !optionUnlab) {
1460 if (nl > 50) angle = 90;
1492 double scale=
gPad->GetWw()*
gPad->GetWNDC();
1493 if (scale>0.0) toffset =
TMath::Max(toffset,(
double)w/scale);
1512 if (!
gPad->IsBatch()) {
1513 if (cosphi > 0)
gVirtualX->SetCharacterUp(-sinphi,cosphi);
1514 else gVirtualX->SetCharacterUp(sinphi,-cosphi);
1516 if (optionVert)
gVirtualX->SetCharacterUp(0,1);
1517 if (optionPara)
gVirtualX->SetCharacterUp(-sinphi,cosphi);
1518 if (optionDown)
gVirtualX->SetCharacterUp(cosphi,sinphi);
1524 if (x0 ==
x1) xalign = 3;
1525 if (y0 != y1) yalign = 2;
1526 if (optionCent) xalign = 2;
1527 if (optionRight) xalign = 3;
1528 if (optionLeft) xalign = 1;
1532 if (cosphi*sinphi > 0) xalign = 1;
1533 if (cosphi*sinphi < 0) xalign = 3;
1539 if (optionPlus && !optionMinus) {
1544 if (lside < 0) ylabel += atick[0];
1546 }
else if (y0 == y1) {
1547 if (optionMinus && !optionPlus) {
1558 if (mside <= 0) ylabel -=
TMath::Abs(atick[0]);
1560 if (optionLog) ylabel -= 0.5*charheight;
1565 if (optionText) ylabel /= 2;
1571 dxtick=(binHigh-binLow)/
Double_t(nticks-1);
1573 if (optionNoopt && !optionInt) dxtick=axis_length/
Double_t(nticks-1);
1574 else dxtick=axis_lengthN/
Double_t(nticks-1);
1576 for (k=0;k<nticks; k++) {
1578 if (k%nn3 == 0) ltick = 1;
1579 if (k%nn2 == 0) ltick = 0;
1583 xtick = zz* axis_length /
TMath::Abs(rwma-rwmi);
1588 if (!mside) ytick -= atick[ltick];
1589 if ( optionNoopt && !optionInt) {
1590 Rotate(xtick,ytick,cosphi,sinphi,x0,y0,xpl2,ypl2);
1591 Rotate(xtick,atick[ltick],cosphi,sinphi,x0,y0,xpl1,ypl1);
1594 Rotate(xtick,ytick,cosphi,sinphi,xx0,yy0,xpl2,ypl2);
1595 Rotate(xtick,atick[ltick],cosphi,sinphi,xx0,yy0,xpl1,ypl1);
1598 if ((x0 !=
x1) && (y0 != y1)) {
1601 if (cosphi > 0) ypl1 = ypl2 + atick[ltick];
1602 else ypl1 = ypl2 - atick[ltick];
1605 xpl1 = 0.5*(xpl1 + xpl2);
1607 ypl1 = 0.5*(ypl1 + ypl2) + atick[ltick];
1608 ypl2 = 0.5*(ypl1 + ypl2) - atick[ltick];
1612 if (!drawGridOnly)
PaintLineNDC(xpl1, ypl1, xpl2, ypl2);
1616 if (optionNoopt && !optionInt) {
1617 Rotate(xtick,0,cosphi,sinphi,x0,y0 ,xpl2,ypl2);
1618 Rotate(xtick,grid_side*gridlength ,cosphi,sinphi,x0,y0 ,xpl1,ypl1);
1621 Rotate(xtick,0,cosphi ,sinphi,xx0,yy0 ,xpl2,ypl2);
1622 Rotate(xtick,grid_side*gridlength ,cosphi,sinphi,xx0,yy0 ,xpl1,ypl1);
1631 if (
fFunction) axis_length0 = binLow-wmin;
1632 if ((!optionNoopt || optionInt) && axis_length0) {
1633 nticks0 =
Int_t(axis_length0/dxtick);
1634 if (nticks0 > 1000) nticks0 = 1000;
1635 for (k=0; k<=nticks0; k++) {
1637 if (k%nn3 == 0) ltick = 1;
1638 if (k%nn2 == 0) ltick = 0;
1640 if (!mside) ytick0 -= atick[ltick];
1645 Rotate(xtick0,ytick0,cosphi,sinphi,xx0,yy0 ,xpl2,ypl2);
1646 Rotate(xtick0,atick[ltick],cosphi,sinphi,xx0,yy0 ,xpl1,ypl1);
1648 if ((x0 !=
x1) && (y0 != y1)) {
1651 if (cosphi > 0) ypl1 = ypl2 + atick[ltick];
1652 else ypl1 = ypl2 - atick[ltick];
1655 xpl1 = 0.5*(xpl1 + xpl2);
1657 ypl1 = 0.5*(ypl1 + ypl2) + atick[ltick];
1658 ypl2 = 0.5*(ypl1 + ypl2) - atick[ltick];
1662 if (!drawGridOnly)
PaintLineNDC(xpl1, ypl1, xpl2, ypl2);
1666 Rotate(xtick0,0,cosphi,sinphi,xx0,yy0,xpl2,ypl2);
1667 Rotate(xtick0,grid_side*gridlength ,cosphi,sinphi,xx0,yy0 ,xpl1,ypl1);
1675 if (
fFunction) axis_length1 = wmax-binHigh;
1676 if ((!optionNoopt || optionInt) && axis_length1) {
1677 nticks1 =
int(axis_length1/dxtick);
1678 if (nticks1 > 1000) nticks1 = 1000;
1679 for (k=0; k<=nticks1; k++) {
1681 if (k%nn3 == 0) ltick = 1;
1682 if (k%nn2 == 0) ltick = 0;
1684 if (!mside) ytick1 -= atick[ltick];
1689 Rotate(xtick1,ytick1,cosphi,sinphi,xx0,yy0 ,xpl2,ypl2);
1690 Rotate(xtick1,atick[ltick],cosphi,sinphi,xx0,yy0 ,xpl1,ypl1);
1692 if ((x0 !=
x1) && (y0 != y1)) {
1695 if (cosphi > 0) ypl1 = ypl2 + atick[ltick];
1696 else ypl1 = ypl2 - atick[ltick];
1699 xpl1 = 0.5*(xpl1 + xpl2);
1701 ypl1 = 0.5*(ypl1 + ypl2) + atick[ltick];
1702 ypl2 = 0.5*(ypl1 + ypl2) - atick[ltick];
1706 if (!drawGridOnly)
PaintLineNDC(xpl1, ypl1, xpl2, ypl2);
1709 Rotate(xtick1,0,cosphi,sinphi,xx0,yy0 ,xpl2,ypl2);
1710 Rotate(xtick1,grid_side*gridlength,cosphi,sinphi,xx0,yy0,xpl1,ypl1);
1721 if (!drawGridOnly && !optionUnlab) {
1725 if ((wmin == wmax) || (ndiv == 0)) {
1726 Error(where,
"wmin (%f) == wmax (%f), or ndiv == 0", wmin, wmax);
1730 dwlabel = (wmax-wmin)/
Double_t(n1a);
1731 if (optionNoopt && !optionInt) dxlabel = axis_length/
Double_t(n1a);
1732 else dxlabel = axis_lengthN/
Double_t(n1a);
1734 if (!optionText && !optionTime) {
1756 if (iexe%3 == 1) iexe += 2;
1757 else if(iexe%3 == 2) iexe += 1;
1758 if (nexe < 0) nexe = -iexe;
1771 if (!noExponent && nf > maxDigits) flexpo =
kTRUE;
1772 if (!noExponent && nf < -maxDigits) flexne =
kTRUE;
1783 if (nexe%3 == 0 && ww <=
TMath::Power(10,maxDigits-1))
break;
1795 if (nexe%3 == 0 && ww >= rne)
break;
1800 for (i=maxDigits-1; i>0; i--) {
1806 if (wdyn <= 0.999 && na < maxDigits-2) {
1826 if (if1 > 14) if1 = 14;
1827 if (if2 > 14) if2 = 14;
1828 if (if1 < 0) if1 = 0;
1831 len =
snprintf(chcoded,
sizeof(chcoded),
"%%%d.%df",if1,if2);
1833 len =
snprintf(chcoded,
sizeof(chcoded),
"%%%d.%df",if1+1,1);
1836 if ((len < 0) || (len >= (
int)
sizeof(chcoded)))
1837 strcpy(chcoded,
"%7.3f");
1843 Int_t ndecimals = 0;
1844 if (optionDecimals) {
1845 char *dot = strchr(chtemp,
'.');
1847 ndecimals = chtemp + strlen(chtemp) -dot;
1850 exp = strstr(chtemp,
"e-");
1852 sscanf(&
exp[2],
"%d",&ndecimals);
1857 if (optionM) nlabels = n1a-1;
1860 for ( k=0; k<=nlabels; k++) {
1865 xlabel = zz* axis_length /
TMath::Abs(rwma-rwmi);
1869 if (optionM) xlabel += 0.5*dxlabel;
1871 if (!optionText && !optionTime) {
1872 snprintf(label,256,chcoded,wlabel);
1878 if (label[
first] ==
'.') {
1879 strncpy(chtemp,
"0",256);
1880 strlcat(chtemp, &label[
first],256);
1881 strncpy(label, chtemp,256);
1882 first = 1; last = strlen(label);
1884 if (label[
first] ==
'-' && label[
first+1] ==
'.') {
1885 strncpy(chtemp,
"-0",256);
1886 strlcat(chtemp, &label[
first+1],256);
1887 strncpy(label, chtemp, 256);
1888 first = 1; last = strlen(label);
1893 char *adot = strchr(label,
'.');
1894 if (adot) adot[ndecimals] = 0;
1896 while (label[last] ==
'0') { label[last] = 0; last--;}
1900 if (label[last] ==
'.') {
1901 if (!optionDot) { label[last] = 0; last--;}
1906 && label[last] ==
'0') {
1907 strncpy(label,
"0", 256);
1915 timed = wlabel + (
int)(timeoffset) - rangeOffset;
1916 timelabel = (time_t)((
Long_t)(timed));
1917 if (optionTime == 1) {
1918 utctis = localtime(&timelabel);
1920 utctis = gmtime(&timelabel);
1923 if (timeformat.
Length() < 220) timeformattmp = timeformat;
1924 else timeformattmp =
"#splitline{Format}{too long}";
1930 snprintf(label, 256,
"%%S%7.5f", modf(timed,&tmpdb));
1931 tmplast = strlen(label)-1;
1934 while (label[tmplast] ==
'0') {
1935 label[tmplast] = 0; tmplast--;
1944 if (utctis !=
nullptr) {
1945 strftime(label, 256, timeformattmp.
Data(), utctis);
1947 strncpy(label,
"invalid", 256);
1949 strncpy(chtemp, &label[0], 256);
1950 first = 0; last=strlen(label)-1;
1951 wlabel = wTimeIni + (k+1)*dwlabel;
1956 if (optionNoopt && !optionInt)
1957 Rotate (xlabel,ylabel,cosphi,sinphi,x0,y0,xx,yy);
1958 else Rotate (xlabel,ylabel,cosphi,sinphi,xx0,yy0,xx,yy);
1959 if (y0 == y1 && !optionDown && !optionUp) {
1960 yy -= 0.80*charheight;
1963 if (x0 !=
x1 && y0 != y1) {
1964 if (optionNoopt && !optionInt)
1965 Rotate (xlabel,0,cosphi,sinphi,x0,y0,xx,yy);
1966 else Rotate (xlabel,0,cosphi,sinphi,xx0,yy0,xx,yy);
1967 if (cosphi > 0 ) yy += ylabel;
1968 if (cosphi < 0 ) yy -= ylabel;
1971 if (!optionY || (x0 ==
x1)) {
1973 if (
first > last) strncpy(chtemp,
" ", 256);
1974 else strncpy(chtemp, &label[
first], 255);
1977 if (!optionTime) typolabel.
ReplaceAll(
"-",
"#minus");
1982 double scale=
gPad->GetWw()*
gPad->GetWNDC();
1983 if (scale>0.0) toffset =
TMath::Max(toffset,(
double)w/scale);
2001 if (!optionText) lnlen = last-
first+1;
2003 if (k+1 > nhilab) lnlen = 0;
2005 for (
l=1;
l<=lnlen;
l++) {
2006 if (!optionText) *chtemp = label[
first+
l-2];
2008 if (lnlen == 0) strncpy(chtemp,
" ", 256);
2009 else strncpy(chtemp,
"1", 256);
2018 yy -= charheight*1.3;
2025 if (flexe && !optionText && nexe) {
2026 snprintf(label,256,
"#times10^{%d}", nexe);
2027 if (x0 !=
x1) { xfactor = axis_length+0.1*charheight; yfactor = 0; }
2028 else { xfactor = y1-y0+0.1*charheight; yfactor = 0; }
2029 Rotate (xfactor,yfactor,cosphi,sinphi,x0,y0,xx,yy);
2055 if (optionLog && ndiv) {
2056 UInt_t xi1=0,xi2=0,wi=0,yi1=0,yi2=0,
hi=0,xl=0,xh=0;
2058 if ((wmin == wmax) || (ndiv == 0)) {
2059 Error(where,
"wmin (%f) == wmax (%f), or ndiv == 0", wmin, wmax);
2063 Error(where,
"negative logarithmic axis");
2067 Error(where,
"negative logarithmic axis");
2071 if (xmnlog > 0) xmnlog += 1.E-6;
2072 else xmnlog -= 1.E-6;
2077 if (h2 > 0) h2 += 1.E-6;
2082 axmul = (x11-x00)/(h2sav-xmnlog);
2087 if ( xmnlog > 0 && (xmnlog-
Double_t(ih1) > 0) ) labelnumber++;
2088 Int_t changelablogid = 0;
2089 Int_t changelablognum = 0;
2090 for (j=1; j<=nbinin; j++) {
2095 if (x0 ==
x1 && j == 1) ylabel += charheight*0.33;
2096 if (y0 == y1 && j == 1) ylabel -= charheight*0.65;
2097 xone = x00+axmul*(
Double_t(decade)-xmnlog);
2099 if (j < 0) printf(
"j=%d\n",j);
2100 if (x00 > xone)
goto L160;
2101 if ((xone-x11)>
epsilon)
break;
2104 if (!mside)
y -= atick[0];
2105 Rotate(xone,
y,cosphi,sinphi,x0,y0,xpl2,ypl2);
2106 Rotate(xtwo,atick[0],cosphi,sinphi,x0,y0,xpl1,ypl1);
2108 if ((x0 !=
x1) && (y0 != y1)) {
2111 if (cosphi > 0) ypl1 = ypl2 + atick[0];
2112 else ypl1 = ypl2 - atick[0];
2115 xpl1 = 0.5*(xpl1 + xpl2);
2117 ypl1 = 0.5*(ypl1 + ypl2) + atick[0];
2118 ypl2 = 0.5*(ypl1 + ypl2) - atick[0];
2122 if (!drawGridOnly)
PaintLineNDC(xpl1, ypl1, xpl2, ypl2);
2125 Rotate(xone,0,cosphi,sinphi,x0,y0,xpl2,ypl2);
2126 Rotate(xone,grid_side*gridlength,cosphi,sinphi,x0,y0,xpl1,ypl1);
2130 if (!drawGridOnly && !optionUnlab) {
2137 while (last >
first) {
2138 if (label[last] !=
'0')
break;
2142 if (label[last] ==
'.') {label[last] = 0; last--;}
2144 snprintf(label,256,
"%d", labelnumber);
2147 Rotate (xone,ylabel,cosphi,sinphi,x0,y0,xx,yy);
2148 if ((x0 ==
x1) && !optionPara) {
2151 if (labelnumber == 0) nch=1;
2153 xx += nch*charheight;
2155 xx += 0.25*charheight;
2158 xx += 0.25*charheight;
2160 if ((y0 == y1) && !optionDown && !optionUp) {
2161 if (noExponent) yy += 0.33*charheight;
2163 if (n1a == 0)
goto L210;
2165 if (kmod == 0) kmod=1000000;
2166 if ((nbinin <= n1a) || (j == 1) || (j == nbinin) || ((nbinin > n1a) && (j%kmod == 0))) {
2167 if (labelnumber == 0) {
2169 }
else if (labelnumber == 1) {
2173 chtemp = &label[
first];
2175 snprintf(chtemp,256,
"10^{%d}", labelnumber);
2179 if (changelablogid == 0) changelablognum = nbinin-j;
2189 double scale=
gPad->GetWw()*
gPad->GetWNDC();
2190 if (scale>0.0) toffset =
TMath::Max(toffset,(
double)w/scale);
2200 for (k=2;k<10;k++) {
2204 if (x00 > xone)
continue;
2205 if (xone > x11)
goto L200;
2207 if (!mside)
y -= atick[1];
2209 Rotate(xone,
y,cosphi,sinphi,x0,y0,xpl2,ypl2);
2210 Rotate(xtwo,atick[1],cosphi,sinphi,x0,y0,xpl1,ypl1);
2212 if ((x0 !=
x1) && (y0 != y1)) {
2215 if (cosphi > 0) ypl1 = ypl2 + atick[1];
2216 else ypl1 = ypl2 - atick[1];
2219 xpl1 = 0.5*(xpl1+xpl2);
2221 ypl1 = 0.5*(ypl1+ypl2) + atick[1];
2222 ypl2 = 0.5*(ypl1+ypl2) - atick[1];
2227 if ((nbinin <= idn) || ((nbinin > idn) && (k == 5))) {
2228 if (!drawGridOnly)
PaintLineNDC(xpl1, ypl1, xpl2, ypl2);
2232 if (moreLogLabels && !optionUnlab && !drawGridOnly && !overlap) {
2237 if (labelnumber-1 == 0) {
2239 }
else if (labelnumber-1 == 1) {
2242 snprintf(chtemp,256,
"%d#times10^{%d}", k, labelnumber-1);
2245 Rotate (xone,ylabel,cosphi,sinphi,x0,y0,xx,yy);
2246 if ((x0 ==
x1) && !optionPara) {
2249 if (labelnumber == 0) nch=1;
2251 xx += nch*charheight;
2253 if (labelnumber >= 0) xx += 0.25*charheight;
2254 else xx += 0.50*charheight;
2257 xx += 0.25*charheight;
2259 if ((y0 == y1) && !optionDown && !optionUp) {
2260 if (noExponent) yy += 0.33*charheight;
2263 if ((x0 !=
x1) && (y0 != y1)) {
2264 Rotate(xone,ylabel,cosphi,sinphi,x0,y0,xx,yy);
2265 if (cosphi > 0) yy += ylabel;
2274 xi1 =
gPad->XtoAbsPixel(u);
2275 yi1 =
gPad->YtoAbsPixel(
v);
2281 xi2 =
gPad->XtoAbsPixel(u);
2282 yi2 =
gPad->YtoAbsPixel(
v);
2285 if ((x0 ==
x1 && yi1-
hi <= yi2) || (y0 == y1 && xl+wi >= xh)){
2299 if (optionGrid && nbinin <= 5 && ndiv > 100) {
2300 Rotate(xone,0,cosphi,sinphi,x0,y0,xpl2, ypl2);
2301 Rotate(xone,grid_side*gridlength,cosphi,sinphi,x0,y0, xpl1,ypl1);
2308 Int_t dummy = 0;
if (dummy) { }
2312 if (!drawGridOnly && strlen(
GetTitle())) {
2316 charheight = charheight/
gPad->GetWh();
2320 if (toffset) ylabel = xlside*charheight+toffset;
2321 else ylabel = xlside*1.6*charheight;
2323 ylabel = xlside*1.6*charheight*toffset;
2326 ylabel = xlside*1.3*charheight*toffset;
2330 ylabel = xlside*1.6*charheight*toffset;
2334 else axispos = axis_length;
2353 Rotate(axispos,ylabel,cosphi,sinphi,x0,y0,xpl1,ypl1);
2364 if (optionGrid)
delete linegrid;
2383 if (binWidth <= 1) { binWidth = 1; binLow =
int(A1); }
2387 binLow =
int(A1/binWidth)*binWidth;
2393 for (
Int_t ic=0; ic<1000; ic++) {
2396 if ( (rbl-ibl) == 0 || ic >
width) { binLow -= 5;
break;}
2403 while (xb <= binHigh) {
2407 binHigh = xb - binWidth;
2415 last = strlen(label)-1;
2416 for (
Int_t i=0; i<=last; i++) {
2417 if (strchr(
"1234567890-+.", label[i]) ) {
first = i;
return; }
2419 Error(
"LabelsLimits",
"attempt to draw a blank label");
2443 out<<
"gaxis = new TGaxis("<<
fX1<<
","<<
fY1<<
","<<
fX2<<
","<<
fY2
2445 out<<
" gaxis->SetLabelOffset("<<
GetLabelOffset()<<
");"<<std::endl;
2446 out<<
" gaxis->SetLabelSize("<<
GetLabelSize()<<
");"<<std::endl;
2447 out<<
" gaxis->SetTickSize("<<
GetTickSize()<<
");"<<std::endl;
2448 out<<
" gaxis->SetGridLength("<<
GetGridLength()<<
");"<<std::endl;
2449 out<<
" gaxis->SetTitleOffset("<<
GetTitleOffset()<<
");"<<std::endl;
2450 out<<
" gaxis->SetTitleSize("<<
GetTitleSize()<<
");"<<std::endl;
2451 out<<
" gaxis->SetTitleColor("<<
GetTextColor()<<
");"<<std::endl;
2452 out<<
" gaxis->SetTitleFont("<<
GetTextFont()<<
");"<<std::endl;
2455 out<<
" gaxis->SetName("<<quote<<
GetName()<<quote<<
");"<<std::endl;
2458 out<<
" gaxis->SetTitle("<<quote<<
GetTitle()<<quote<<
");"<<std::endl;
2464 out<<
" gaxis->SetLabelColor(ci);" << std::endl;
2466 out<<
" gaxis->SetLabelColor("<<
GetLabelColor()<<
");"<<std::endl;
2471 out<<
" gaxis->SetLineColor(ci);" << std::endl;
2473 out<<
" gaxis->SetLineColor("<<
GetLineColor()<<
");"<<std::endl;
2476 out<<
" gaxis->SetLineStyle("<<
GetLineStyle()<<
");"<<std::endl;
2479 out<<
" gaxis->SetLineWidth("<<
GetLineWidth()<<
");"<<std::endl;
2482 out<<
" gaxis->SetLabelFont("<<
GetLabelFont()<<
");"<<std::endl;
2485 out<<
" gaxis->SetMoreLogLabels();"<<std::endl;
2488 out<<
" gaxis->SetNoExponent();"<<std::endl;
2491 out<<
" gaxis->Draw();"<<std::endl;
2519 Error(
"SetFunction",
"unknown function: %s", funcname);
2618 if (labNum < 0) labNum = nlabels + labNum + 2;
2729 if (timeformat.
Index(
"%F")>=0 || timeformat.
IsNull()) {
2761 timeoff = (time_t)((
Long_t)(toffset));
2765 utctis = gmtime(&timeoff);
2767 if (utctis !=
nullptr) {
2768 strftime(tmp, 20,
"%Y-%m-%d %H:%M:%S",utctis);
2807 void TGaxis::Streamer(
TBuffer &R__b)
2817 TLine::Streamer(R__b);
2818 TAttText::Streamer(R__b);
2833 fName.Streamer(R__b);