# Drawing multiple Histograms in one canvas using Dividing method

**URL:** <https://root-forum.cern.ch/t/drawing-multiple-histograms-in-one-canvas-using-dividing-method/42993>\
**Category:** Newbie\
**Tags:** hist\
**Created:** [January 7, 2021, 12:58pm UTC](https://root-forum.cern.ch/t/drawing-multiple-histograms-in-one-canvas-using-dividing-method/42993 "2021-01-07T12:58:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mo922022](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mo922022/32/24415_2.png) [@Mo922022](https://root-forum.cern.ch/u/Mo922022)\
**Post date:** [January 7, 2021, 12:58pm UTC](https://root-forum.cern.ch/t/drawing-multiple-histograms-in-one-canvas-using-dividing-method/42993/1 "2021-01-07T12:58:29Z")

</div>

Here in this code I have a problem in constructing a method for Drawing a different graphs between direction of particles in X, Y and Z with Energy in 3 Histograms in one Canvas, I want all of them in one canvas using divided method

The Code is working correctly except the last part of “Draw Direction histogram”

[DrawHistograms.cpp](https://root-forum.cern.ch/uploads/short-url/n0m9rbTPCy3Pr3CrJOqpwV63izI.cpp) (4.5 KB) [Out\_run\_0.root](https://root-forum.cern.ch/uploads/short-url/4ci9KhJcRjlxJVznAcbHgjKyyWG.root) (122.4 KB)

Thanks in Advance

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [January 7, 2021, 1:56pm UTC](https://root-forum.cern.ch/t/drawing-multiple-histograms-in-one-canvas-using-dividing-method/42993/2 "2021-01-07T13:56:51Z")

</div>

> **[example of script showing how to divide a canvas](https://root.cern/root/html602/tutorials/graphs/zones.C.html)**

  
Documentation:  
[https://root.cern/doc/master/classTPad.html#a064b8ae1d12a9be393c0e22c5958cc7c](https://root.cern/doc/master/classTPad.html#a064b8ae1d12a9be393c0e22c5958cc7c)
