# Shifting TMultigraph on x-axis to the same starting point

**URL:** <https://root-forum.cern.ch/t/shifting-tmultigraph-on-x-axis-to-the-same-starting-point/15555>\
**Category:** ROOT\
**Created:** [January 28, 2013, 10:28am UTC](https://root-forum.cern.ch/t/shifting-tmultigraph-on-x-axis-to-the-same-starting-point/15555 "2013-01-28T10:28:34Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [January 29, 2013, 9:03am UTC](https://root-forum.cern.ch/t/shifting-tmultigraph-on-x-axis-to-the-same-starting-point/15555/5 "2013-01-29T09:03:36Z")

</div>

`{
  Double_t newXmin = 0.0;
  Double_t oldXmin = TMath::MinElement(MyGraph->GetN(), MyGraph->GetX());
  for (Int_t i = 0; i < MyGraph->GetN(); i++)
    (MyGraph->GetX())[i] = (MyGraph->GetX())[i] - oldXmin + newXmin;
  delete MyGraph->GetHistogram(); MyGraph->SetHistogram(0);
  if (gPad) { gPad->Modified(); gPad->Update(); }
}`

---

_[View the full topic](https://root-forum.cern.ch/t/shifting-tmultigraph-on-x-axis-to-the-same-starting-point/15555)._
