diff --git a/modules/hist/TPavePainter.mjs b/modules/hist/TPavePainter.mjs index 4dd85d8cf..589c67c8b 100644 --- a/modules/hist/TPavePainter.mjs +++ b/modules/hist/TPavePainter.mjs @@ -838,7 +838,7 @@ class TPavePainter extends ObjectPainter { is_th3 = isFunc(main.getDimension) && (main.getDimension() === 3), log = pad?.fLogv ?? (is_th3 ? false : pad?.fLogz), draw_palette = main._color_palette, - zaxis = main.getObject()?.fZaxis, + zaxis = isFunc(main.getZaxis) ? main.getZaxis() : main.getObject()?.fZaxis, sizek = pad?.fTickz ? 0.35 : 0.7; let zmin = 0, zmax = 100, gzmin, gzmax, axis_transform = '', axis_second = 0; @@ -846,6 +846,7 @@ class TPavePainter extends ObjectPainter { this._palette_vertical = (palette.fX2NDC - palette.fX1NDC) < (palette.fY2NDC - palette.fY1NDC); axis.fTickSize = 0.6 * s_width / width; // adjust axis ticks size + if ((typeof zaxis?.fLabelOffset !== 'undefined') && !is_th3) { axis.fTitle = zaxis.fTitle; axis.fTitleSize = zaxis.fTitleSize; @@ -857,7 +858,8 @@ class TPavePainter extends ObjectPainter { axis.fLabelColor = zaxis.fLabelColor; axis.fLabelFont = zaxis.fLabelFont; axis.fLabelOffset = zaxis.fLabelOffset; - this.z_handle.setHistPainter(main, 'z'); + if (!isFunc(main.getZaxis)) + this.z_handle.setHistPainter(main, 'z'); this.z_handle.source_axis = zaxis; } diff --git a/modules/hist2d/TScatterPainter.mjs b/modules/hist2d/TScatterPainter.mjs index 88845bc29..e1e72b395 100644 --- a/modules/hist2d/TScatterPainter.mjs +++ b/modules/hist2d/TScatterPainter.mjs @@ -42,17 +42,6 @@ class TScatterPainter extends TGraphPainter { gr.fFunctions.AddFirst(pal, ''); } - const zaxis = this.getHistogram()?.fZaxis; - if (pal && zaxis) { - Object.assign(pal.fAxis, { - fTitle: zaxis.fTitle, fTitleSize: zaxis.fTitleSize, - fTitleOffset: zaxis.fTitleOffset, fTitleColor: zaxis.fTitleColor, - fLineColor: zaxis.fAxisColor, fTextSize: zaxis.fLabelSize, - fTextColor: zaxis.fLabelColor, fTextFont: zaxis.fLabelFont, - fLabelOffset: zaxis.fLabelOffset - }); - } - return pal; } @@ -69,6 +58,12 @@ class TScatterPainter extends TGraphPainter { super._updateMembers(scatter.fGraph, obj.fGraph); } + /** @summary Return Z axis used for palette drawing + * @private */ + getZaxis() { + return this.getHistogram()?.fZaxis; + } + /** @summary Actual drawing of TScatter */ async drawGraph() { const fpainter = this.get_main(),