From 61ca14863f4a148ee288aa478a9a89dbf75e1422 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Tue, 19 Dec 2023 11:04:19 +0100 Subject: [PATCH] BUGFIX: JKQTPCoordinateAxis::tickUnitName was not shown in some cases, when using fractions --- doc/images/axisstyle/axis_unit_scaling_pi.png | Bin 4735 -> 4719 bytes lib/jkqtplotter/jkqtpcoordinateaxes.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/images/axisstyle/axis_unit_scaling_pi.png b/doc/images/axisstyle/axis_unit_scaling_pi.png index 2a667b3e112df75f7bc5a3822f361c336627666a..36c4f5a578e15d51f665c039987d8dc929537b99 100644 GIT binary patch literal 4719 zcma)A2Q-{pyZ(q6y&b^`QDQ`m9zpb8jzRROK?D()yNWy=&dIrtSIm_m;h%_kEuIB^n{LX{jz!K@dc%tD|ufeD@IF z6y)Hu+!CD+z9_wQto$H|u9NsC$rh$#hae^%T@6*!pl9n-_gzhJT(C_q>$)PB^1ddP z@>|!75quLJ!&R&|FDxx_U5ZX}${Bu7b*F66K-gobszu<^qu#j3?;RxNw=|c9oP_;o zqpyZKpv+>O#{-tLK4bfx4Y1QnZw-D#7!TA9KaH>7Uz+|Bu58q!n-@B$xLiRv^&M#C zAKcjQR@F$_-bF(h84@Z9Hyw}+Z#p0zy+{(ZEYfo^0_VvojHzfCUNN(AYY2*i36@0< z&P#5sH_Xh}3@Uvbcz&a%y8X$MKOvRyHo3EiPDhDF0)bad%y6URt*5^~bFP^ErzcW( zO(*OSWIEz(8r%#jnwpyCd)KdBiw#nsOYX|dKDmP*A7>L`q0YJ5mzWk|cR7QCG!p5K z?@MHvtabYXnvLfQ@98~_i;rha>#p*gYARb3!yg?V8yg!(&d)oxmcD92qeVHC!Yu37 zziJ?zt?NUCT0QXf1{*?)G#ErRjGTPdUw+PCo{@&UZZhQx+NLq8FIQ~UmKJ04&YPsL zurS1em)|unmQy*L!@$5mHee+yr`gz6ghgG1WwiNXUSsIK=)8{|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pz?cI;YHDgS0oz5rt)`9YpAsU6 zY_p8j0c#vkURlhpFbN0@On&^B20F*ij;-HIyZ&(PCSh+{)EhSHms-5n7VR}MRt8h! z%2>r%VV;~WY$2WNT0GfeOJ`T**#;)mn`UMgoGP$22%tmIp#6F+6$hWOmshW9GZU%z z*We)Wn3l4LhcSz={`Y{+Ac+s;VRtkA^|MmNs3Uc3h_BP zoD2*M{r=r=8fF6M0gXA{zi&>C;yY)_WSau3BE>*f2xrll7wp=XCbDIkGrQ5vr2O+r z2`xNG{`gy`)U1JVWMl-RYzFWKMCzM2s`tk$ZJuSN49SG?#tau4bhtDubjE^t$l%5e zY6xh%!GljA7KP*e1;0%aoA=s+M<=DYjlrmw6w{pNWd;A{VT2h+g%hd7djF!7vB*nj>Z6ZMO# Yf?UbzHY0)s|0qE^8v5$xs@7ru10=kr&j0`b diff --git a/lib/jkqtplotter/jkqtpcoordinateaxes.cpp b/lib/jkqtplotter/jkqtpcoordinateaxes.cpp index bfbc362a84..d4df7cfa3f 100644 --- a/lib/jkqtplotter/jkqtpcoordinateaxes.cpp +++ b/lib/jkqtplotter/jkqtpcoordinateaxes.cpp @@ -463,7 +463,7 @@ QString JKQTPCoordinateAxis::floattolabel(double data, int past_comma) const { if (sign<0) res+="-"; if (intpart!=0) res+=QString::number(intpart); if (num!=0) { - if (denom==1) res+=QString::number(num); + if (denom==1) res+=addTickUnit(QString::number(num)); else { if (axisStyle.tickLabelType==JKQTPCALTfrac || (axisStyle.tickLabelType==JKQTPCALTintfrac && intpart==0)) res+=QString("\\frac{%1}{%2}").arg(addTickUnit(QString::number(num))).arg(denom); else if (axisStyle.tickLabelType==JKQTPCALTintfrac) res=addTickUnit(res+QString("\\frac{%1}{%2}").arg(num).arg(denom));