1012 const char *where =
"PaintAxis";
1014 Double_t alfa, beta, ratio1, ratio2, grid_side;
1022 Double_t phil, phi, sinphi, cosphi;
1023 Double_t binLow = 0., binLow2 = 0., binLow3 = 0.;
1024 Double_t binHigh = 0., binHigh2 = 0., binHigh3 = 0.;
1025 Double_t binWidth = 0., binWidth2 = 0., binWidth3 = 0.;
1028 Double_t wlabel, dwlabel, axis_value;
1034 xx0 = xx1 = yy0 = yy1 = 0;
1035 Double_t xxmin, xxmax, yymin, yymax;
1036 xxmin = xxmax = yymin = yymax = 0;
1040 Double_t xmnlog, x00, x11, h2, h2sav, axmul,
y;
1042 Int_t nlabels, nticks, nticks0 = 0, nticks1 = 0;
1043 Int_t i, j, k,
l, decade;
1047 Int_t iexe, if1, if2, na, nf, ih1, ih2, nbinin, nch, kmod;
1048 Int_t optionLog,optionBlank,optionVert,optionPlus,optionMinus,optionUnlab,optionPara;
1049 Int_t optionDown,optionRight,optionLeft,optionCent,optionEqual,optionDecimals=0,optionDot;
1050 Int_t optionY,optionText,optionGrid,optionSize,optionNoopt,optionInt,optionM,optionUp,optionX;
1051 Int_t optionTime, optionArrow;
1052 Int_t first=0,last=0,labelnumber;
1053 Int_t xalign, yalign;
1054 Int_t nn1, nn2, nn3, n1a, n2a, n3a, nb2, nb3;
1055 Int_t nbins=10, n1aold, nn1old;
1057 n1aold = nn1old = 0;
1081 chtemp = &kchtemp[0];
1082 label = &chlabel[0];
1101 if(strchr(chopt,
'G')) optionLog = 1;
else optionLog = 0;
1102 if(strchr(chopt,
'B')) optionBlank= 1;
else optionBlank= 0;
1103 if(strchr(chopt,
'V')) optionVert = 1;
else optionVert = 0;
1104 if(strchr(chopt,
'+')) optionPlus = 1;
else optionPlus = 0;
1105 if(strchr(chopt,
'-')) optionMinus= 1;
else optionMinus= 0;
1106 if(strchr(chopt,
'U')) optionUnlab= 1;
else optionUnlab= 0;
1107 if(strchr(chopt,
'P')) optionPara = 1;
else optionPara = 0;
1108 if(strchr(chopt,
'O')) optionDown = 1;
else optionDown = 0;
1109 if(strchr(chopt,
'R')) optionRight= 1;
else optionRight= 0;
1110 if(strchr(chopt,
'L')) optionLeft = 1;
else optionLeft = 0;
1111 if(strchr(chopt,
'C')) optionCent = 1;
else optionCent = 0;
1112 if(strchr(chopt,
'=')) optionEqual= 1;
else optionEqual= 0;
1113 if(strchr(chopt,
'Y')) optionY = 1;
else optionY = 0;
1114 if(strchr(chopt,
'T')) optionText = 1;
else optionText = 0;
1115 if(strchr(chopt,
'W')) optionGrid = 1;
else optionGrid = 0;
1116 if(strchr(chopt,
'S')) optionSize = 1;
else optionSize = 0;
1117 if(strchr(chopt,
'N')) optionNoopt= 1;
else optionNoopt= 0;
1118 if(strchr(chopt,
'I')) optionInt = 1;
else optionInt = 0;
1119 if(strchr(chopt,
'M')) optionM = 1;
else optionM = 0;
1120 if(strchr(chopt,
'0')) optionUp = 1;
else optionUp = 0;
1121 if(strchr(chopt,
'X')) optionX = 1;
else optionX = 0;
1122 if(strchr(chopt,
't')) optionTime = 1;
else optionTime = 0;
1123 if(strchr(chopt,
'.')) optionDot = 1;
else optionDot = 0;
1130 if(strchr(chopt,
'>')) optionArrow = 1;
1131 if(strchr(chopt,
'<')) optionArrow = optionArrow+2;
1149 Error(where,
"Invalid number of divisions: %d",ndiv);
1156 if (gridlength == 0) gridlength = 0.8;
1186 Int_t year, mm, dd, hh, mi, ss;
1187 if (sscanf(stringtimeoffset.
Data(),
"%d-%d-%d %d:%d:%d", &year, &mm, &dd, &hh, &mi, &ss) == 6) {
1190 tp.tm_year = year-1900;
1204 TString sdp = stringtimeoffset(ids+1,lns);
1205 sscanf(sdp.
Data(),
"%g",&dp);
1209 Error(where,
"Time offset has not the right format");
1214 wmin += timeoffset - (
int)(timeoffset);
1215 wmax += timeoffset - (
int)(timeoffset);
1219 time_t timetp = (time_t)((
Long_t)(timeoffset));
1222 if (range>60) rangeBase = 60*20;
1223 if (range>3600) rangeBase = 3600*20;
1224 if (range>86400) rangeBase = 86400*20;
1225 if (range>2419200) rangeBase = 31556736;
1227 if (range>31536000) {
1228 tp0 = gmtime(&timetp);
1235 rangeBase = (timetp-mktime(tp0));
1236 rangeOffset = (
Double_t) (rangeBase);
1238 wmax += rangeOffset;
1239 wmin += rangeOffset;
1244 n2a = (ndiv%10000 - n1a)/100;
1245 n3a = (ndiv%1000000 - n2a -n1a)/10000;
1250 maxDigits = (ndiv/1000000);
1259 if (
wmin ==
wmax || ndiv == 0 || n1a <= 1 || optionLog) {
1265 if ( (
wmax-
wmin) < 1 && optionInt) {
1266 Error(where,
"option I not available");
1269 if (!optionNoopt || optionInt ) {
1277 if (binLow !=
Double_t(
int(binLow)) || binWidth !=
Double_t(
int(binWidth))) {
1281 if ((
wmin-binLow) > epsilon) { binLow += binWidth; nbins--; }
1282 if ((binHigh-
wmax) > epsilon) { binHigh -= binWidth; nbins--; }
1288 yymax = rtyw*(binHigh-
wmin) +
ymin;
1293 xxmax = rtxw*(binHigh-
wmin) +
xmin;
1301 yymin = alfa*xxmin + beta;
1302 yymax = alfa*xxmax + beta;
1317 if (!optionNoopt && n2a > 1 && binWidth > 0) {
1323 if (!optionNoopt && n3a > 1 && binWidth2 > 0) {
1337 ratio1 = 1/(rwxmax-rwxmin);
1338 ratio2 = 1/(rwymax-rwymin);
1339 x0 = ratio1*(
xmin-rwxmin);
1340 x1 = ratio1*(
xmax-rwxmin);
1341 y0 = ratio2*(
ymin-rwymin);
1342 y1 = ratio2*(
ymax-rwymin);
1343 if (!optionNoopt || optionInt ) {
1344 xx0 = ratio1*(xxmin-rwxmin);
1345 xx1 = ratio1*(xxmax-rwxmin);
1346 yy0 = ratio2*(yymin-rwymin);
1347 yy1 = ratio2*(yymax-rwymin);
1350 if ((x0 ==
x1) && (y0 ==
y1)) {
1351 Error(where,
"length of axis is 0");
1358 if (toffset==0 &&
x1 == x0) autotoff =
kTRUE;
1373 if (axis_length == 0) {
1374 Error(where,
"length of axis is 0");
1377 if (!optionNoopt || optionInt) {
1378 axis_lengthN =
TMath::Sqrt((xx1-xx0)*(xx1-xx0)+(yy1-yy0)*(yy1-yy0));
1379 axis_length0 =
TMath::Sqrt((xx0-x0)*(xx0-x0)+(yy0-y0)*(yy0-y0));
1381 if (axis_lengthN < epsilon) {
1390 wmin += timeoffset - (
int)(timeoffset) + rangeOffset;
1391 wmax += timeoffset - (
int)(timeoffset) + rangeOffset;
1397 if (
y1>=y0) phi = 0.5*
kPI;
1422 if (x0 ==
x1 &&
y1 > y0) mside = -1;
1423 if (optionPlus) mside = 1;
1424 if (optionMinus) mside = -1;
1425 if (optionPlus && optionMinus) mside = 0;
1428 if (optionEqual) lside = mside;
1429 if (optionPlus && optionMinus) {
1431 if (optionEqual) lside=1;
1436 if(xmside >= 0) tick_side = 1;
1437 else tick_side = -1;
1438 if (optionSize) atick[0] = tick_side*axis_length*
fTickSize;
1439 else atick[0] = tick_side*axis_length*0.03;
1441 atick[1] = 0.5*atick[0];
1442 atick[2] = 0.5*atick[1];
1445 if ((x0 ==
x1) && (
y1 > y0)) grid_side =-1;
1472 if (optionArrow==1)
a.PaintArrowNDC(xpl1, ypl1, xpl2, ypl2, as,
"|>");
1473 if (optionArrow==2)
a.PaintArrowNDC(xpl1, ypl1, xpl2, ypl2, as,
"<|");
1474 if (optionArrow==3)
a.PaintArrowNDC(xpl1, ypl1, xpl2, ypl2, as,
"<|>");
1482 if (ndiv == 0)
return;
1494 if (optionText &&
GetLabelFont()%10 != 3) charheight *= 0.66666;
1504 if (!optionUp && !optionDown && !optionY && !optionUnlab) {
1519 if (nl > 50)
angle = 90;
1551 double scale=
gPad->GetWw()*
gPad->GetWNDC();
1552 if (scale>0.0) toffset =
TMath::Max(toffset,(
double)
w/scale);
1579 if (x0 ==
x1) xalign = 3;
1580 if (y0 !=
y1) yalign = 2;
1581 if (optionCent) xalign = 2;
1582 if (optionRight) xalign = 3;
1583 if (optionLeft) xalign = 1;
1587 if (cosphi*sinphi > 0) xalign = 1;
1588 if (cosphi*sinphi < 0) xalign = 3;
1594 if (optionPlus && !optionMinus) {
1599 if (lside < 0) ylabel += atick[0];
1601 }
else if (y0 ==
y1) {
1602 if (optionMinus && !optionPlus) {
1613 if (mside <= 0) ylabel -=
TMath::Abs(atick[0]);
1615 if (optionLog) ylabel -= 0.5*charheight;
1620 if (optionText) ylabel /= 2;
1623 if (!optionLog && ndiv) {
1625 dxtick = (binHigh-binLow)/
Double_t(nticks-1);
1626 axis_length0 = binLow-
wmin;
1627 axis_length1 =
wmax-binHigh;
1629 if (optionNoopt && !optionInt) dxtick = axis_length/
Double_t(nticks-1);
1630 else dxtick = axis_lengthN/
Double_t(nticks-1);
1632 if (!optionNoopt || optionInt) {
1639 std::vector<Double_t> ticksx, ticksy, gridx, gridy;
1640 if (!drawGridOnly) {
1641 ticksx.reserve(nticks + nticks0 + nticks1);
1642 ticksy.reserve(nticks + nticks0 + nticks1);
1645 gridx.reserve((nticks + nticks0 + nticks1) / nn2 + 2);
1646 gridy.reserve((nticks + nticks0 + nticks1) / nn2 + 2);
1649 auto draw_tick = [&](
int indx,
double xtick,
double xf) {
1651 if (indx % nn2 == 0)
1653 else if (indx % nn3 == 0)
1660 xtick = zz * axis_length /
TMath::Abs(rwma-rwmi);
1663 Double_t ytick = mside ? 0. : -atick[ltick];
1664 if (optionNoopt && !optionInt) {
1665 Rotate(xtick,ytick,cosphi,sinphi,x0,y0, xpl2,ypl2);
1666 Rotate(xtick,atick[ltick],cosphi,sinphi,x0,y0, xpl1,ypl1);
1668 Rotate(xtick,ytick,cosphi,sinphi,xx0,yy0, xpl2,ypl2);
1669 Rotate(xtick,atick[ltick],cosphi,sinphi,xx0,yy0, xpl1,ypl1);
1672 if ((x0 !=
x1) && (y0 !=
y1)) {
1675 if (cosphi > 0) ypl1 = ypl2 + atick[ltick];
1676 else ypl1 = ypl2 - atick[ltick];
1678 xpl1 = 0.5*(xpl1 + xpl2);
1680 ypl1 = 0.5*(ypl1 + ypl2) + atick[ltick];
1681 ypl2 = 0.5*(ypl1 + ypl2) - atick[ltick];
1685 if (!drawGridOnly) {
1687 if (optionArrow == 1)
1688 paint_tick = (
x1 != x0) ? (xpl2 <
x1) : (ypl2 <
y1);
1689 else if (optionArrow == 2)
1690 paint_tick = (
x1 != x0) ? (xpl1 > x0) : (ypl1 > y0);
1691 else if (optionArrow == 3)
1692 paint_tick = (
x1 != x0) ? (xpl1 > x0 && xpl2 <
x1) : (ypl1 > y0 && ypl2 <
y1);
1694 ticksx.push_back(xpl1);
1695 ticksx.push_back(xpl2);
1696 ticksy.push_back(ypl1);
1697 ticksy.push_back(ypl2);
1701 if (optionGrid && (ltick == 0)) {
1702 if (optionNoopt && !optionInt) {
1703 Rotate(xtick,0,cosphi,sinphi,x0,y0, xpl2,ypl2);
1704 Rotate(xtick,grid_side*gridlength,cosphi,sinphi,x0,y0, xpl1,ypl1);
1706 Rotate(xtick,0,cosphi,sinphi,xx0,yy0, xpl2,ypl2);
1707 Rotate(xtick,grid_side*gridlength,cosphi,sinphi,xx0,yy0, xpl1,ypl1);
1709 gridx.push_back(xpl1);
1710 gridx.push_back(xpl2);
1711 gridy.push_back(ypl1);
1712 gridy.push_back(ypl2);
1716 for (k = 0; k < nticks; k++)
1719 for (k = 1; k <= nticks0; k++)
1722 for (k = 1; k <= nticks1; k++)
1723 draw_tick(k,
Double_t(nticks-1 + k) * dxtick, binHigh +
Double_t(k)*dxtick);
1726 if (ticksx.size() > 0) {
1728 gPad->PaintSegmentsNDC(ticksx.size() / 2, ticksx.data(), ticksy.data());
1732 if (gridx.size() > 0) {
1733 linegrid.TAttLine::Modify();
1734 gPad->PaintSegmentsNDC(gridx.size() / 2, gridx.data(), gridy.data());
1739 if (!drawGridOnly && !optionUnlab) {
1743 if ((
wmin ==
wmax) || (ndiv == 0)) {
1744 Error(where,
"wmin (%f) == wmax (%f), or ndiv == 0",
wmin,
wmax);
1749 if (optionNoopt && !optionInt) dxlabel = axis_length/
Double_t(n1a);
1750 else dxlabel = axis_lengthN/
Double_t(n1a);
1752 if (!optionText && !optionTime) {
1774 if (iexe%3 == 1) iexe += 2;
1775 else if(iexe%3 == 2) iexe += 1;
1776 if (nexe < 0) nexe = -iexe;
1789 if (!noExponent && nf > maxDigits) flexpo =
kTRUE;
1790 if (!noExponent && nf < -maxDigits) flexne =
kTRUE;
1801 if (nexe%3 == 0 && ww <=
TMath::Power(10,maxDigits-1))
break;
1813 if (nexe%3 == 0 && ww >= rne)
break;
1818 for (i=maxDigits-1; i>0; i--) {
1824 if (wdyn <= 0.999 && na < maxDigits-2) {
1844 if (if1 > 14) if1 = 14;
1845 if (if2 > 14) if2 = 14;
1846 if (if1 < 0) if1 = 0;
1849 len = snprintf(chcoded,
sizeof(chcoded),
"%%%d.%df",if1,if2);
1851 len = snprintf(chcoded,
sizeof(chcoded),
"%%%d.%df",if1+1,1);
1854 if ((
len < 0) || (
len >= (
int)
sizeof(chcoded)))
1855 strcpy(chcoded,
"%7.3f");
1860 snprintf(chtemp,256,
"%g",dwlabel);
1861 Int_t ndecimals = 0;
1862 if (optionDecimals) {
1863 char *dot = strchr(chtemp,
'.');
1865 ndecimals = chtemp + strlen(chtemp) -dot;
1868 exp = strstr(chtemp,
"e-");
1870 sscanf(&exp[2],
"%d",&ndecimals);
1875 if (optionM) nlabels = n1a-1;
1878 for ( k=0; k<=nlabels; k++) {
1883 xlabel = zz* axis_length /
TMath::Abs(rwma-rwmi);
1887 if (optionM) xlabel += 0.5*dxlabel;
1889 axis_value = wlabel;
1891 if (!optionText && !optionTime) {
1892 snprintf(label,256,chcoded,wlabel);
1899 if (label[first] ==
'.') {
1900 strncpy(chtemp,
"0", 256);
1901 strlcat(chtemp, &label[first],256);
1902 strlcpy(label, chtemp, 256);
1903 first = 1; last = strlen(label);
1905 if (label[first] ==
'-' && label[first+1] ==
'.') {
1906 strncpy(chtemp,
"-0",256);
1907 strlcat(chtemp, &label[first+1],256);
1908 strlcpy(label, chtemp, 256);
1909 first = 1; last = strlen(label);
1914 char *adot = strchr(label,
'.');
1915 if (adot) adot[ndecimals] = 0;
1917 while (label[last] ==
'0') { label[last] = 0; last--;}
1921 if (label[last] ==
'.') {
1922 if (!optionDot) { label[last] = 0; last--;}
1926 if (last-first == 1 && label[first] ==
'-'
1927 && label[last] ==
'0') {
1928 strncpy(label,
"0", 256);
1936 timed = wlabel + (
int)(timeoffset) - rangeOffset;
1937 timelabel = (time_t)((
Long_t)(timed));
1938 if (optionTime == 1) {
1939 utctis = localtime(&timelabel);
1941 utctis = gmtime(&timelabel);
1944 if (timeformat.
Length() < 220) timeformattmp = timeformat;
1945 else timeformattmp =
"#splitline{Format}{too long}";
1951 snprintf(label, 256,
"%%S%7.5f", modf(timed,&tmpdb));
1952 tmplast = strlen(label)-1;
1955 while (label[tmplast] ==
'0') {
1956 label[tmplast] = 0; tmplast--;
1965 if (utctis !=
nullptr) {
1966 strftime(label, 256, timeformattmp.
Data(), utctis);
1968 strncpy(label,
"invalid", 256);
1970 strlcpy(chtemp, &label[0], 256);
1971 first = 0; last=strlen(label)-1;
1972 wlabel = wTimeIni + (k+1)*dwlabel;
1977 if (optionNoopt && !optionInt)
1978 Rotate (xlabel,ylabel,cosphi,sinphi,x0,y0,xx,yy);
1979 else Rotate (xlabel,ylabel,cosphi,sinphi,xx0,yy0,xx,yy);
1980 if (y0 ==
y1 && !optionDown && !optionUp) {
1981 yy -= 0.80*charheight;
1984 if (x0 !=
x1 && y0 !=
y1) {
1985 if (optionNoopt && !optionInt)
1986 Rotate (xlabel,0,cosphi,sinphi,x0,y0,xx,yy);
1987 else Rotate (xlabel,0,cosphi,sinphi,xx0,yy0,xx,yy);
1988 if (cosphi > 0 ) yy += ylabel;
1989 if (cosphi < 0 ) yy -= ylabel;
1992 if (!optionY || (x0 ==
x1)) {
1994 if (first > last) strncpy(chtemp,
" ", 256);
1995 else strlcpy(chtemp, &label[first], 255);
1998 if (!optionTime) typolabel.
ReplaceAll(
"-",
"#minus");
2003 double scale=
gPad->GetWw()*
gPad->GetWNDC();
2004 if (scale>0.0) toffset =
TMath::Max(toffset,(
double)
w/scale);
2025 if (!optionText) lnlen = last-first+1;
2027 if (k+1 > nhilab) lnlen = 0;
2029 for (
l=1;
l<=lnlen;
l++) {
2030 if (!optionText) *chtemp = label[first+
l-2];
2032 if (lnlen == 0) strncpy(chtemp,
" ", 256);
2033 else strncpy(chtemp,
"1", 256);
2042 yy -= charheight*1.3;
2049 if (flexe && !optionText && nexe) {
2050 snprintf(label,256,
"#times10^{%d}", nexe);
2051 if (x0 !=
x1) { xfactor = axis_length+0.1*charheight; yfactor = 0; }
2052 else { xfactor =
y1-y0+0.1*charheight; yfactor = 0; }
2053 Rotate (xfactor,yfactor,cosphi,sinphi,x0,y0,xx,yy);
2083 if (optionLog && ndiv) {
2084 UInt_t xi1=0,xi2=0,wi=0,yi1=0,yi2=0,
hi=0,xl=0,xh=0;
2086 if ((
wmin ==
wmax) || (ndiv == 0)) {
2087 Error(where,
"wmin (%f) == wmax (%f), or ndiv == 0",
wmin,
wmax);
2091 Error(where,
"negative logarithmic axis");
2095 Error(where,
"negative logarithmic axis");
2099 if (xmnlog > 0) xmnlog += 1.E-6;
2100 else xmnlog -= 1.E-6;
2105 if (h2 > 0) h2 += 1.E-6;
2110 axmul = (x11-x00)/(h2sav-xmnlog);
2112 std::vector<Double_t> ticksx, ticksy, gridsx, gridsy;
2114 if (!drawGridOnly) {
2115 ticksx.reserve(nbinin*2);
2116 ticksy.reserve(nbinin*2);
2119 gridsx.reserve(nbinin*2);
2120 gridsy.reserve(nbinin*2);
2124 Int_t id = 0, num = 0;
2128 std::vector<LogLabel> loglabels;
2129 if (!drawGridOnly && !optionUnlab)
2130 loglabels.reserve(nbinin);
2136 if ( xmnlog > 0 && (xmnlog-
Double_t(ih1) > 0) ) labelnumber++;
2137 Int_t changelablogid = 0;
2138 Int_t changelablognum = 0;
2139 for (j=1; j<=nbinin; j++) {
2144 if (x0 ==
x1 && j == 1) ylabel += charheight*0.33;
2145 if (y0 ==
y1 && j == 1) ylabel -= charheight*0.65;
2146 xone = x00+axmul*(
Double_t(decade)-xmnlog);
2148 if (j < 0) printf(
"j=%d\n",j);
2149 if (x00 > xone)
goto L160;
2150 if ((xone-x11)>epsilon)
break;
2153 if (!mside)
y -= atick[0];
2154 Rotate(xone,
y,cosphi,sinphi,x0,y0,xpl2,ypl2);
2155 Rotate(xtwo,atick[0],cosphi,sinphi,x0,y0,xpl1,ypl1);
2157 if ((x0 !=
x1) && (y0 !=
y1)) {
2160 if (cosphi > 0) ypl1 = ypl2 + atick[0];
2161 else ypl1 = ypl2 - atick[0];
2164 xpl1 = 0.5*(xpl1 + xpl2);
2166 ypl1 = 0.5*(ypl1 + ypl2) + atick[0];
2167 ypl2 = 0.5*(ypl1 + ypl2) - atick[0];
2171 if (!drawGridOnly) {
2172 ticksx.emplace_back(xpl1);
2173 ticksx.emplace_back(xpl2);
2174 ticksy.emplace_back(ypl1);
2175 ticksy.emplace_back(ypl2);
2179 Rotate(xone,0,cosphi,sinphi,x0,y0,xpl2,ypl2);
2180 Rotate(xone,grid_side*gridlength,cosphi,sinphi,x0,y0,xpl1,ypl1);
2181 gridsx.emplace_back(xpl1);
2182 gridsx.emplace_back(xpl2);
2183 gridsy.emplace_back(ypl1);
2184 gridsy.emplace_back(ypl2);
2187 if (!drawGridOnly && !optionUnlab) {
2193 snprintf(label,256,
"%f", rlab);
2195 while (last > first) {
2196 if (label[last] !=
'0')
break;
2200 if (label[last] ==
'.') {label[last] = 0; last--;}
2202 snprintf(label,256,
"%d", labelnumber);
2205 Rotate (xone,ylabel,cosphi,sinphi,x0,y0,xx,yy);
2206 if ((x0 ==
x1) && !optionPara) {
2209 if (labelnumber == 0) nch=1;
2211 xx += nch*charheight;
2213 xx += 0.25*charheight;
2216 xx += 0.25*charheight;
2218 if ((y0 ==
y1) && !optionDown && !optionUp) {
2219 if (noExponent) yy += 0.33*charheight;
2221 if (n1a == 0)
return;
2223 if (kmod == 0) kmod=1000000;
2224 if ((nbinin <= n1a) || (j == 1) || (j == nbinin) || ((nbinin > n1a) && (j%kmod == 0))) {
2225 if (labelnumber == 0) {
2226 snprintf(chtemp,256,
"1");
2227 }
else if (labelnumber == 1) {
2228 snprintf(chtemp,256,
"10");
2231 chtemp = &label[first];
2233 snprintf(chtemp,256,
"10^{%d}", labelnumber);
2237 if (changelablogid == 0) changelablognum = nbinin-j;
2247 double scale=
gPad->GetWw()*
gPad->GetWNDC();
2248 if (scale>0.0) toffset =
TMath::Max(toffset,(
double)
w/scale);
2250 loglabels.emplace_back();
2251 auto &back = loglabels.back();
2252 back.id = changelablogid;
2253 back.num = changelablognum;
2254 back.u =
gPad->GetX1() + xx*(
gPad->GetX2() -
gPad->GetX1());
2255 back.v =
gPad->GetY1() + yy*(
gPad->GetY2() -
gPad->GetY1());
2256 back.value = axis_value;
2257 back.lbl = typolabel;
2263 for (k=2;k<10;k++) {
2267 if (x00 > xone)
continue;
2268 if (xone > x11)
goto L200;
2270 if (!mside)
y -= atick[1];
2272 Rotate(xone,
y,cosphi,sinphi,x0,y0,xpl2,ypl2);
2273 Rotate(xtwo,atick[1],cosphi,sinphi,x0,y0,xpl1,ypl1);
2275 if ((x0 !=
x1) && (y0 !=
y1)) {
2278 if (cosphi > 0) ypl1 = ypl2 + atick[1];
2279 else ypl1 = ypl2 - atick[1];
2282 xpl1 = 0.5*(xpl1+xpl2);
2284 ypl1 = 0.5*(ypl1+ypl2) + atick[1];
2285 ypl2 = 0.5*(ypl1+ypl2) - atick[1];
2290 if ((nbinin <= idn) || ((nbinin > idn) && (k == 5))) {
2291 if (!drawGridOnly) {
2292 ticksx.emplace_back(xpl1);
2293 ticksx.emplace_back(xpl2);
2294 ticksy.emplace_back(ypl1);
2295 ticksy.emplace_back(ypl2);
2300 if (moreLogLabels && !optionUnlab && !drawGridOnly && !overlap) {
2304 snprintf(chtemp,256,
"%g", rlab);
2306 if (labelnumber-1 == 0) {
2307 snprintf(chtemp,256,
"%d", k);
2308 }
else if (labelnumber-1 == 1) {
2309 snprintf(chtemp,256,
"%d", 10*k);
2311 snprintf(chtemp,256,
"%d#times10^{%d}", k, labelnumber-1);
2314 Rotate (xone,ylabel,cosphi,sinphi,x0,y0,xx,yy);
2315 if ((x0 ==
x1) && !optionPara) {
2318 if (labelnumber == 0) nch=1;
2320 xx += nch*charheight;
2322 if (labelnumber >= 0) xx += 0.25*charheight;
2323 else xx += 0.50*charheight;
2326 xx += 0.25*charheight;
2328 if ((y0 ==
y1) && !optionDown && !optionUp) {
2329 if (noExponent) yy += 0.33*charheight;
2332 if ((x0 !=
x1) && (y0 !=
y1)) {
2333 Rotate(xone,ylabel,cosphi,sinphi,x0,y0,xx,yy);
2334 if (cosphi > 0) yy += ylabel;
2343 xi1 =
gPad->XtoAbsPixel(u);
2344 yi1 =
gPad->YtoAbsPixel(
v);
2352 loglabels.emplace_back();
2353 auto &back = loglabels.back();
2354 back.id = changelablogid;
2358 back.value = axis_value;
2359 back.lbl = typolabel;
2362 xi2 =
gPad->XtoAbsPixel(u);
2363 yi2 =
gPad->YtoAbsPixel(
v);
2366 if ((x0 ==
x1 && yi1-
hi <= yi2) || (y0 ==
y1 && xl+wi >= xh)){
2378 loglabels.emplace_back();
2379 auto &back = loglabels.back();
2380 back.id = changelablogid;
2384 back.value = axis_value;
2385 back.lbl = typolabel;
2392 if (optionGrid && nbinin <= 5 && ndiv > 100) {
2393 Rotate(xone,0,cosphi,sinphi,x0,y0, xpl2, ypl2);
2394 Rotate(xone,grid_side*gridlength,cosphi,sinphi,x0,y0, xpl1,ypl1);
2395 gridsx.emplace_back(xpl1);
2396 gridsx.emplace_back(xpl2);
2397 gridsy.emplace_back(ypl1);
2398 gridsy.emplace_back(ypl2);
2405 if (ticksx.size() > 0) {
2407 gPad->PaintSegmentsNDC(ticksx.size() / 2, ticksx.data(), ticksy.data());
2411 for(
auto & lbl : loglabels) {
2420 if (gridsx.size() > 0) {
2421 linegrid.TAttLine::Modify();
2422 gPad->PaintSegmentsNDC(gridsx.size() / 2, gridsx.data(), gridsy.data());
2428 if (!drawGridOnly && strlen(
GetTitle())) {
2432 charheight /= ((
x1==x0) ? padw : padh);
2436 if (toffset) ylabel = xlside*charheight+toffset;
2437 else ylabel = xlside*1.6*charheight;
2439 ylabel = xlside*1.6*charheight*toffset;
2442 ylabel = xlside*1.3*charheight*toffset;
2446 ylabel = xlside*1.6*charheight*toffset;
2450 else axispos = axis_length;
2469 Rotate(axispos,ylabel,cosphi,sinphi,x0,y0,xpl1,ypl1);