Skip to content

Commit 9d1c1f9

Browse files
committed
Fix - copy all x axis attributes to range histo
Such as labels or labels size should be copied. Also replicate type
1 parent fb1bad7 commit 9d1c1f9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

modules/hist2d/TMultiGraphPainter.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,13 @@ class TMultiGraphPainter extends ObjectPainter {
189189
xaxis = histo.fYaxis;
190190
yaxis = histo.fZaxis;
191191
} else {
192-
histo = createHistogram(clTH1F, 10);
192+
histo = createHistogram(src_hist?._typename ?? clTH1F, src_hist?.fXaxis.fNbins ?? 10);
193193
xaxis = histo.fXaxis;
194194
yaxis = histo.fYaxis;
195195
}
196196

197197
if (src_hist) {
198-
xaxis.fTimeDisplay = src_hist.fXaxis.fTimeDisplay;
199-
xaxis.fTimeFormat = src_hist.fXaxis.fTimeFormat;
200-
xaxis.fTitle = src_hist.fXaxis.fTitle;
198+
Object.assign(xaxis, src_hist.fXaxis);
201199
yaxis.fTitle = src_hist.fYaxis.fTitle;
202200
}
203201

@@ -208,8 +206,10 @@ class TMultiGraphPainter extends ObjectPainter {
208206
if (t[1]) xaxis.fTitle = t[1];
209207
if (t[2]) yaxis.fTitle = t[2];
210208
}
211-
xaxis.fXmin = uxmin;
212-
xaxis.fXmax = uxmax;
209+
if (!xaxis.fLabels) {
210+
xaxis.fXmin = uxmin;
211+
xaxis.fXmax = uxmax;
212+
}
213213
}
214214

215215
const axis = this._3d ? histo.fZaxis : histo.fYaxis;

0 commit comments

Comments
 (0)