# Drawing a kink in Y axis?

**URL:** <https://root-forum.cern.ch/t/drawing-a-kink-in-y-axis/57196>\
**Category:** Newbie\
**Created:** [November 21, 2023, 2:15pm UTC](https://root-forum.cern.ch/t/drawing-a-kink-in-y-axis/57196 "2023-11-21T14:15:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [November 21, 2023, 2:15pm UTC](https://root-forum.cern.ch/t/drawing-a-kink-in-y-axis/57196/1 "2023-11-21T14:15:22Z")

</div>

Hello everyone,

I am trying to draw a small “kink” in the Y-axis to indicate it does not start from 0  
 ![kink_yaxis](https://root-forum.cern.ch/uploads/default/original/3X/7/b/7b32da933cd6e2528f5f9215ad1c31090bde8d5d.png)

I tried this by creating a different TPad and drawing various TLines (again using BrokenAxis.C by @couet ) and resizing it in the GUI. Is there a more precise/efficient way to do this?

Thank You

---

<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:** [November 21, 2023, 2:27pm UTC](https://root-forum.cern.ch/t/drawing-a-kink-in-y-axis/57196/2 "2023-11-21T14:27:54Z")

</div>

Can you post some code (we can try) showing what you are doing ?

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [November 21, 2023, 2:37pm UTC](https://root-forum.cern.ch/t/drawing-a-kink-in-y-axis/57196/3 "2023-11-21T14:37:07Z")

</div>

Hi, Thanks for the reply.

```auto
void broken_Y() {
   //Canvas and pad (for histograms) creation
   TCanvas *c = new TCanvas("c", "c",500,500);          

   TPad *p1 = new TPad("p1","p1",0.1,0.1,0.9,0.901);          
   p1->SetBorderMode(0);
   p1->Draw();

   
   // Histograms creation
   auto myHist = new TH1F("h1","",1000,0,1600);
   ---
   ---
   // Histograms filling
   myHist->Fill();
   -----
   -----
        
  //Drawing the histograms
   p1->cd();
   myHist->Draw();
   p1->SetLogy();
  ------
  ------

    //Drawing the kink
   c->cd();
   TPad *b = new TPad("b","b",0.1,0.19,0.8,0.22);
   b->SetBorderMode(0);
   b->Draw();
   b->cd();
   TLine *line = new TLine(0.11,0,0.1105677,0.399656);
   line->Draw();
   line = new TLine(0.1105677,0.5860092,0.11,1);
   line->Draw();
   line = new TLine(0.076639,0.5143349,0.1524797,0.6863532);
   line->Draw();
   line = new TLine(0.076639,0.3423165,0.1524797,0.5143349);
   line->Draw();
}

```

---

<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:** [November 21, 2023, 2:40pm UTC](https://root-forum.cern.ch/t/drawing-a-kink-in-y-axis/57196/4 "2023-11-21T14:40:59Z")

</div>

That’s not run-able … can provide something we can run ? It will be simpler to debug.

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [November 21, 2023, 3:02pm UTC](https://root-forum.cern.ch/t/drawing-a-kink-in-y-axis/57196/5 "2023-11-21T15:02:03Z")

</div>

Yes, it requires two large root files is it possible to upload them here ?

Thnaks for help.

---

<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:** [November 21, 2023, 3:05pm UTC](https://root-forum.cern.ch/t/drawing-a-kink-in-y-axis/57196/6 "2023-11-21T15:05:57Z")

</div>

May be you can just create and fill fake histograms ?

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [November 22, 2023, 1:28pm UTC](https://root-forum.cern.ch/t/drawing-a-kink-in-y-axis/57196/7 "2023-11-22T13:28:17Z")

</div>

Thank You for your reply. Yes, I think I will be able to reproduce the histogram with dummy values and share the runnable code.
