diff --git a/README/ReleaseNotes/v610/index.md b/README/ReleaseNotes/v610/index.md index 544ce960289f3caf3f00c9340c6ab08244759796..c2251f30f9e4faf10108369e257a9e255556e203 100644 --- a/README/ReleaseNotes/v610/index.md +++ b/README/ReleaseNotes/v610/index.md @@ -173,7 +173,8 @@ The following interfaces have been removed, after deprecation in v6.08. - The "BOX" option, to draw 3D histograms, has been reimplemented by Evgueni Tcherniaev The following picture show the old and new version - `ChangeLabel` is now available for log axis as well as requested [here](https://sft.its.cern.ch/jira/browse/ROOT-8537). - +- The `TGraph` copy constructor also copy the underlying `TH1F` if it exists (it + holds the axis titles).  diff --git a/hist/hist/src/TGraph.cxx b/hist/hist/src/TGraph.cxx index c92ca6b6a2544b73edb92e92e9bbc77ef20ce3e0..d12987ed2b8617ba096c62d9c72215225239abd4 100644 --- a/hist/hist/src/TGraph.cxx +++ b/hist/hist/src/TGraph.cxx @@ -157,9 +157,6 @@ TGraph::TGraph(Int_t n, const Double_t *x, const Double_t *y) //////////////////////////////////////////////////////////////////////////////// /// Copy constructor for this graph -/// -/// This copy constructor does not copy the underlying histogram. Basic informations -/// attached to it (like axis titles) will be lost after a copy. TGraph::TGraph(const TGraph &gr) : TNamed(gr), TAttLine(gr), TAttFill(gr), TAttMarker(gr) @@ -168,7 +165,8 @@ TGraph::TGraph(const TGraph &gr) fMaxSize = gr.fMaxSize; if (gr.fFunctions) fFunctions = (TList*)gr.fFunctions->Clone(); else fFunctions = new TList; - fHistogram = 0; + if (gr.fHistogram) fHistogram = (TH1F*)gr.fHistogram->Clone(); + else fHistogram = 0; fMinimum = gr.fMinimum; fMaximum = gr.fMaximum; if (!fMaxSize) {