Delete Histogram Title From GUI


If I draw a variable from a TTree, a histogram is generated with a TPaveText title where the title name is the name of the variable. If I select the TPaveText and try to delete it (by selecting delete from the drop down menu), I get a dialog box. I click OK on the box, and nothing happens. I also noticed that if I move the TPaveText first, then calling delete seems to just redraw the TPaveText in its original position. I guess this is not the behaviour I expect from calling delete…

If you call clear first the text disappears - if you then call delete the text comes back :slight_smile:

This code snippet is sufficient to reproduce the problem

void sample(){
TTree *tr = new TTree(“test”, “test”);
float value=0;
tr->Branch(“value”, &value, “value/F”);

System: root svn revision 31880, OS X 10.6.4, gcc 4.2.1


Hi Peter,

You can disable the painting of the title by doing either

gStyle->SetOptTitle(0); //this will disable the title for all coming histograms or

myhist->SetTitle("") or set the position of the TPaveText title to be outside the canvas.