Skip to content

Commit

Permalink
TGraph:SetNameTitle did not change the title of the underlying histog…
Browse files Browse the repository at this point in the history
…ram.

This was reported here: https://sft.its.cern.ch/jira/browse/ROOT-9222
  • Loading branch information
couet committed Feb 2, 2018
1 parent aecbe9b commit af4ac2f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hist/hist/inc/TGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ class TGraph : public TNamed, public TAttLine, public TAttFill, public TAttMarke
virtual void SetMinimum(Double_t minimum=-1111); // *MENU*
virtual void Set(Int_t n);
virtual void SetPoint(Int_t i, Double_t x, Double_t y);
virtual void SetName(const char *name=""); // *MENU*
virtual void SetNameTitle(const char *name="", const char *title="");
virtual void SetTitle(const char *title=""); // *MENU*
virtual void Sort(Bool_t (*greater)(const TGraph*, Int_t, Int_t)=&TGraph::CompareX,
Bool_t ascending=kTRUE, Int_t low=0, Int_t high=-1111);
Expand Down
17 changes: 17 additions & 0 deletions hist/hist/src/TGraph.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2202,6 +2202,14 @@ void TGraph::SetPoint(Int_t i, Double_t x, Double_t y)
if (gPad) gPad->Modified();
}

////////////////////////////////////////////////////////////////////////////////
/// Set graph name.
void TGraph::SetName(const char *name)
{
fName = name;
if (fHistogram) fHistogram->SetName(name);
}

////////////////////////////////////////////////////////////////////////////////
/// Set graph title.

Expand All @@ -2211,6 +2219,15 @@ void TGraph::SetTitle(const char* title)
if (fHistogram) fHistogram->SetTitle(title);
}

////////////////////////////////////////////////////////////////////////////////
/// Set graph name and title

void TGraph::SetNameTitle(const char *name, const char *title)
{
SetName(name);
SetTitle(title);
}

////////////////////////////////////////////////////////////////////////////////
/// if size*2 <= fMaxSize allocate new arrays of size points,
/// copy points [0,oend).
Expand Down

0 comments on commit af4ac2f

Please sign in to comment.