Maybe you could try this (I get no problem with the “new Y axis title”):
#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