Permanently set default options for TH* and TGraph*

Hi all,

I find myself often writing void functions that serve the only purpose of making a graph or histogram look nice. There are indeed some options I always set, mainly:

graph->SetMarkerStyle(8)
graph->SetFillColor(10)
graph->GetXaxis->SetDecimals()
graph->GetYaxis->SetDecimals()

Now, I’d like to have this boring work done once and for all. Can I therefore change the ROOT drawing style accordingly without messing around with its source code?

Tips and workarounds welcome!
Matt.

TGraph attributes are not in the list of attributes you can change via TStyle. The attributes you want to change are related to a specific graph I don’t think it makes sense to promote all the possible options and attributes you can set on ROOT objects in TStyle that will be unmanageable.

One solution would be to encapsulate your setting in a Draw and you use that Draw instead of TGraph::Draw. Another would be to have your own type of graph inheriting from TGraph having these settings as default. I am sure there is other ways.