# Setting titles for TGraphs

**URL:** <https://root-forum.cern.ch/t/setting-titles-for-tgraphs/14856>\
**Category:** ROOT\
**Created:** [September 3, 2012, 8:41am UTC](https://root-forum.cern.ch/t/setting-titles-for-tgraphs/14856 "2012-09-03T08:41:12Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Pepe\_Le\_Pew](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pepe_le_pew/32/12365_2.png) [@Pepe\_Le\_Pew](https://root-forum.cern.ch/u/Pepe_Le_Pew)\
**Post date:** [September 3, 2012, 10:27am UTC](https://root-forum.cern.ch/t/setting-titles-for-tgraphs/14856/4 "2012-09-03T10:27:35Z")

</div>

Maybe you could try this (I get no problem with the “new Y axis title”):

```cpp
#include "TGraph.h"
#include "TAxis.h"

TGraph * title(void) {
  Double_t x[10] = {0,1,2,3,4,5,6,7,8,9};
  Double_t y[10] = {9,8,7,6,5,4,3,2,1,0};
  TGraph *graph = new TGraph(10, x, y);
  graph->SetTitle("graph title");
  // graph->SetTitle("global title;X axis title;Y axis title;Z axis title");
  graph->GetYaxis()->SetTitle("new Y axis title");
  graph->Draw("AL*");
  return graph;
}

```

See maybe also: [https://root-forum.cern.ch/t/order-of-calling-methods-with-tmultigraph/14724/1](https://root-forum.cern.ch/t/order-of-calling-methods-with-tmultigraph/14724/1)

---

_[View the full topic](https://root-forum.cern.ch/t/setting-titles-for-tgraphs/14856)._
