Grid disappearing when drawing TGraphErrors with reversed X axis

ROOT Version: 6.26/08
Built for macosxarm64 (Apple silicon Mac with MacOS 12.6.1)
Clang 14.0.0

Hi,

Whenever I try to draw TGraphErrors with reversed X axis, the grids in TCanvas disappears just like this plot.

I tried using both canvas->SetGrid(1, 1); and gPad->SetGrid(1, 1); but it didn’t helped.

Here’s example of what I’m doing in the code.

~~~

TCanvas* c = new TCanvas("c", "c", 800, 600);
// c->SetGrid(1, 1);       // I tried setting grid here also
~~~ Set points for graph ~~~

TGraphErrors* graph = new TGraphErrors(~~~);
c->cd(); gPad->SetGrid(1, 1); // or c->SetGrid(1, 1);
graph->Draw("AP RX");
// c->SetGrid(1, 1);     // I also tried setting grid here

c->SaveAs("graph.png"); 
~~~

I also draw other plots with TGraph and non-reversed Xaxis on other TCanvas in same code, but that plot’s grid is shown properly.

Does anyone know why it’s happening, and how to solve them?

Thanks

Welcome to the root forum

https://root.cern/doc/master/classTPad.html#aacc42f670cc68841d5324521b89c71b2

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.