Skip to content

TMultiGraph wrong scale with logarithmic axes : regession introduced in 6.22 #9011

@gregoireg1lles

Description

@gregoireg1lles

Hi,

A regression was introduced in TMutiGraph with a log scale
I found a commit that seems to be linked to my problem osschar@d087f00

my OS is debian10 x86_64 with gcc8.3

here is sample script to reproduce the bug :

void multigraph()
{
   auto c1 = new TCanvas("c1","multigraph",700,500);
   c1->SetGrid();
   c1->SetLogx();
   c1->SetLogy();
   auto *mg = new TMultiGraph();
   std::vector<double> x1;
   std::vector<double> sig1;
   std::vector<double> sig2;
   for (double E=1e-4;E<2e7;E*=1.1)
    {
		x1.push_back(E);
		sig1.push_back(10*pow(E,-0.1));
		sig2.push_back(15*pow(E,-0.15));
		}
   auto g1 = new TGraph(x1.size(), x1.data(), sig1.data());
   mg->Add(g1);
   auto g2 = new TGraph(x1.size(), x1.data(), sig2.data());
   mg->Add(g2);
   mg->SetTitle("; E (eV);#sigma (b)");
   mg->GetXaxis()->CenterTitle(true);
   mg->GetYaxis()->CenterTitle(true);
   mg->Draw("AL");
   c1->SaveAs("multigraph.pdf");
}

It works fine on versions 6.14.08, 6.18.04 and 6.20.06
TMultiGraph scale is wrong with versions 6.22.08, 6.24.06.
There is also an error message at the console (negative value for log scale)

Processing multigraph.C...
Error in <THistPainter::PaintInit>: log scale requested with a negative argument (-1.720339)
Info in <TCanvas::Print>: pdf file multigraph.pdf has been created

I remove the patch osschar@d087f00 on version 6.24.06 and it works again

thanks in advance

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions