# Axes Label and fitting \[pyroot\]

**URL:** <https://root-forum.cern.ch/t/axes-label-and-fitting-pyroot/37832>\
**Category:** Newbie\
**Created:** [February 3, 2020, 11:17pm UTC](https://root-forum.cern.ch/t/axes-label-and-fitting-pyroot/37832 "2020-02-03T23:17:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![theyellowdog](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/theyellowdog/32/20460_2.png) [@theyellowdog](https://root-forum.cern.ch/u/theyellowdog)\
**Post date:** [February 3, 2020, 11:17pm UTC](https://root-forum.cern.ch/t/axes-label-and-fitting-pyroot/37832/1 "2020-02-03T23:17:03Z")

</div>

I have a root file that that I have to analyse.

> bottom = ROOT.TFile(“202001081411\_r750\_W2-I8-1\_pin4\_RedBottom\_Tune30.dat.root”)  
> tree\_bottom = bottom.Get(“edge”)  
> c=ROOT.TCanvas()

> tree\_bottom.Draw(“volt-BlineMean:time-atleft”,“Vbias==30”,“l”)  
> tree\_bottom.SetLineWidth(1)  
> c.Draw()

I got this plot.

[http://i.imgur.com/RvTta3y.png](http://i.imgur.com/RvTta3y.png)

How can i change the label of the axes.

I tired this

> bottom\_tree.GetXaxis().SetTitle(“x-something”)

but i get an error “‘TTree’ object has no attribute 'GetXaxis”

And I would also like to do a polynomial fitting

> func = ROOT.TF1(‘func’, '[0] + [1]\*x ', 0, 10)

How can i implied this fitting function into data set ?

* * *

_ROOT Version:_ PyRoot  
_Platform:_ Python  
_Compiler:_ Not Provided

* * *

---

<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 4, 2020, 8:33am UTC](https://root-forum.cern.ch/t/axes-label-and-fitting-pyroot/37832/2 "2020-02-04T08:33:27Z")

</div>

```auto
ree_bottom.Draw(“volt-BlineMean:time-atleft”,“Vbias==30”,“l”)
htemp.GetXaxis().SetTitle("hello")

```
