# 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:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![knez032](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/73ab20/32.png) [@knez032](https://root-forum.cern.ch/u/knez032)\
**Post date:** [February 18, 2016, 4:13pm UTC](https://root-forum.cern.ch/t/make-a-break-in-x-axis-histogram/20649/1 "2016-02-18T16:13:29Z")

</div>

Hi everyone,

I have a histogram with most of data around 0, but one value at -999. When I plot this it looks very ugly.  
Does anyone know how to make a break in x Axis (in example from -950 to -50)?

Thanks in advance,  
Nebojsa

---

<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.); …
