# 2D histogram draw scale still inconsistent

**URL:** <https://root-forum.cern.ch/t/2d-histogram-draw-scale-still-inconsistent/28678>\
**Category:** ROOT\
**Tags:** bug, hist\
**Created:** [April 13, 2018, 10:03pm UTC](https://root-forum.cern.ch/t/2d-histogram-draw-scale-still-inconsistent/28678 "2018-04-13T22:03:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickes](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/6de8d8/32.png) [@wickes](https://root-forum.cern.ch/u/wickes)\
**Post date:** [April 13, 2018, 10:03pm UTC](https://root-forum.cern.ch/t/2d-histogram-draw-scale-still-inconsistent/28678/1 "2018-04-13T22:03:54Z")

</div>

* * *

ROOT Version (e.g. 6.12/02): 6.12/06  
Platform, compiler (e.g. CentOS 7.3, gcc6.2): macOS 10.13.4, homebrew bottle

* * *

Please see thread: [2D histogram fit draws to wrong scale](https://root-forum.cern.ch/t/2d-histogram-fit-draws-to-wrong-scale/26369)

This problem can be reproduced with the scripts & files from that thread. In fact it is clearly visible in every image posted there. (I would reply there but threads are locked now after 2 weeks. Is there a way to resurrect/unlock own threads?)

Steps: Plot TH2D w/ option “E”, then again with option “SURF0 SAME” (as in the last reply there). Notice that the surface does not line up with the data points.

---

<div class="post-metadata">

**Author:** ![wickes](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/6de8d8/32.png) [@wickes](https://root-forum.cern.ch/u/wickes)\
**Post date:** [April 13, 2018, 10:11pm UTC](https://root-forum.cern.ch/t/2d-histogram-draw-scale-still-inconsistent/28678/2 "2018-04-13T22:11:34Z")

</div>

It looks like this can be worked around by using `TH2::SetMinimum` and `TH2::SetMaximum`.

Is this intended behavior? I assumed additional plots drawn using “same” would always be drawn to the scale set by the original plot. Maybe this is a bad assumption.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [April 14, 2018, 3:20am UTC](https://root-forum.cern.ch/t/2d-histogram-draw-scale-still-inconsistent/28678/4 "2018-04-14T03:20:00Z")

</div>

You should be able to post a follow-up to the original thread now.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 17, 2018, 8:34am UTC](https://root-forum.cern.ch/t/2d-histogram-draw-scale-still-inconsistent/28678/5 "2018-04-17T08:34:43Z")

</div>

> [@wickes](#):
>
> Is this intended behavior?

Yes it is a limitation. Both plots should have the same min and max. see:  
[https://root.cern/doc/master/classTHistPainter.html#HP060a](https://root.cern/doc/master/classTHistPainter.html#HP060a)

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [May 1, 2018, 8:34am UTC](https://root-forum.cern.ch/t/2d-histogram-draw-scale-still-inconsistent/28678/6 "2018-05-01T08:34:44Z")

</div>

Closed on May 1, 2018, 8:34am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
