Problem with title of axis for Tgraph while using Log scale

Dear all,

I am currently using Root to analyse some datas, but I have a problem with my graphs.
I am using Tgraph, and I want to change paramaters of axis (as the label size, title, etc…). All is working if I generate the graph in linear scale. But I want to generate my plots with log scale for the Y axis. So I am using gPad->SetLogy(). But in this case, the parameters I want to change are not changed. And I do not really understand why! Can you have a look on my code please? I am joining a simplified version of the cpp file (Reader.cpp) and a data file (Test_data.txt). By default, I have commented the gPad->SetLogy(). Uncomment it to see the change.

Thanks in advance for your help.

Best regards,

Edgard.
Test_data.txt (1.03 KB)
Reader.cpp (3.65 KB)

You program gives me a SEG FAULT

pcphsft55> ./Reader

 *** Break *** segmentation violation

I’ll check

I converted your file into a macro (attached) and for me it works fine.
Reader.cpp (3.67 KB)

Dear Mr Couet,

thanks a lot for the time you have taken to answer me!
I have tested your macro, and it do not work on my computer.
I am joining the two plots I have obteined.
As you can see, the bottom graph has axis with titles for the linear scale, but not for the log scale. Do you observ the same?

Thank you.

Edgard.
LogScale.ps (10.8 KB)
LinearScale.ps (11.3 KB)

For me it is ok with the latest root version on Linux
Vertical Map.ps (9.5 KB)

Dear Mr Couet,
I am currently using the version 5.26/00a.
I will try to test with the version 5.28/00 to see if I observ a change.
Thank you.

Regards,

Edgard.

edit:

I have just checked on the new version release notes, and my bug was fixed last month!

TGraph
* With the following macro the axis title was not displayed:

      {
         TGraph *graph = new TGraph ();
         graph->SetPoint(0, 0.00100, 30.00);
         graph->SetPoint(1, 0.00150, 20.00);
         graph->SetPoint(2, 0.01150, 30.00);
         graph->Draw("AL*");
         graph->GetXaxis()->SetTitle("foo") ;
         gPad->SetLogx(1) ;
      }

So I am updating my version.

Thanks again for the tests.