@@ -6758,9 +6758,12 @@ void TH1::SetDefaultSumw2(Bool_t sumw2)
67586758// //////////////////////////////////////////////////////////////////////////////
67596759// / Change/set the title.
67606760// /
6761- // / If title is in the form `stringt;stringx;stringy;stringz`
6761+ // / If title is in the form `stringt;stringx;stringy;stringz;stringc `
67626762// / the histogram title is set to `stringt`, the x axis title to `stringx`,
6763- // / the y axis title to `stringy`, and the z axis title to `stringz`.
6763+ // / the y axis title to `stringy`, the z axis title to `stringz`, and the c
6764+ // / axis title for the palette is ignored at this stage.
6765+ // / Note that you can use e.g. `stringt;stringx` if you only want to specify
6766+ // / title and x axis title.
67646767// /
67656768// / To insert the character `;` in one of the titles, one should use `#;`
67666769// / or `#semicolon`.
@@ -6792,8 +6795,15 @@ void TH1::SetTitle(const char *title)
67926795 fYaxis .SetTitle (str2.Data ());
67936796 lns = str1.Length ();
67946797 str1 = str1 (isc+1 , lns);
6795- str1.ReplaceAll (" #semicolon" ,10 ," ;" ,1 );
6796- fZaxis .SetTitle (str1.Data ());
6798+ isc = str1.Index (" ;" );
6799+ if (isc >=0 ) {
6800+ str2 = str1 (0 ,isc);
6801+ str2.ReplaceAll (" #semicolon" ,10 ," ;" ,1 );
6802+ fZaxis .SetTitle (str2.Data ());
6803+ } else {
6804+ str1.ReplaceAll (" #semicolon" ,10 ," ;" ,1 );
6805+ fZaxis .SetTitle (str1.Data ());
6806+ }
67976807 } else {
67986808 str1.ReplaceAll (" #semicolon" ,10 ," ;" ,1 );
67996809 fYaxis .SetTitle (str1.Data ());
0 commit comments