# Binning in TTree-\>Draw()

**URL:** <https://root-forum.cern.ch/t/binning-in-ttree-draw/9703>\
**Category:** ROOT\
**Created:** [February 23, 2010, 11:41pm UTC](https://root-forum.cern.ch/t/binning-in-ttree-draw/9703 "2010-02-23T23:41:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrey\_Pozdnyakov](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/andrey_pozdnyakov/32/12419_2.png) [@Andrey\_Pozdnyakov](https://root-forum.cern.ch/u/Andrey_Pozdnyakov)\
**Post date:** [February 23, 2010, 11:41pm UTC](https://root-forum.cern.ch/t/binning-in-ttree-draw/9703/1 "2010-02-23T23:41:09Z")

</div>

Quote from manual:

> [@](#):
>
> When a new binning is used the new value will become the default.

Which means that for all of other histograms I’m drawing default binning will be set by that.  
Question:  
How to set it back to use automatic binning for the rest of the plots?

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [February 24, 2010, 2:59pm UTC](https://root-forum.cern.ch/t/binning-in-ttree-draw/9703/2 "2010-02-24T14:59:16Z")

</div>

Hi,

You can explicitly set the default values of the number of bins by calling `gEnv->SetValue("Hist.Binning.1D.x",100);
gEnv->SetValue("Hist.Binning.2D.x",40);
gEnv->SetValue("Hist.Binning.3D.x",20);`  
You can also reset to the actual default (which are defined in the ‘rootrc’ files with the more local rootrc file ‘winning’😉 by calling:`delete gEnv;
gEnv = new TEnv(".rootrc");`However this will also undo any other changes done to gEnv.

Cheers,  
Philippe.
