# Make a break in x axis histogram

**URL:** <https://root-forum.cern.ch/t/make-a-break-in-x-axis-histogram/20649>\
**Category:** ROOT\
**Created:** [February 18, 2016, 4:13pm UTC](https://root-forum.cern.ch/t/make-a-break-in-x-axis-histogram/20649 "2016-02-18T16:13:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [February 18, 2016, 4:48pm UTC](https://root-forum.cern.ch/t/make-a-break-in-x-axis-histogram/20649/2 "2016-02-18T16:48:48Z")

</div>

> [@Break axis](https://root-forum.cern.ch/t/break-axis/6831/5):
>
> Example: void BrokenAxis() { TCanvas \*c = new TCanvas("c", "c",700,900); TPad \*p1 = new TPad("p1","p1",0.1,0.5,0.9,0.901); p1-\>SetBottomMargin(0.); p1-\>SetBorderMode(0); p1-\>Draw(); TPad \*p2 = new TPad("p2","p2",0.1,0.1,0.9,0.501); p2-\>SetTopMargin(0.); p2-\>SetBorderMode(0); p2-\>Draw(); float x1[] = {3,5,6,9}; float y1[] = {100,900,400,200}; TGraph \*gr1 = new TGraph(4,x1,y1); gr1-\>GetXaxis()-\>SetLimits(0.,10.); …

---

_[View the full topic](https://root-forum.cern.ch/t/make-a-break-in-x-axis-histogram/20649)._
