Cannot combine y+ and rx when drawing TGraph

Hi,

I would like to draw a TGraph with reverse X axis, and the Y axis is on the right hand side, but it seems that these 2 options doesn’t work together

here is my code:

#include <stdio.h>

void CodeCpp_TestReverseX()
{
	auto c4 = new TCanvas("c4","c4",200,10,600,400);
	double x[] = {0, 1, 2, 3, 4};
	double y[] = {0, 2, 4, 1, 3};
	double ex[] = {0.1, 0.2, 0.3, 0.4, 0.5};
	double ey[] = {1, 0.5, 1, 0.5, 1};
	TGraphErrors* ge = new TGraphErrors(5, x, y, ex, ey);
	
	ge -> GetYaxis() -> SetTitle("haha");
	
	ge->Draw("ay+rx");
	
	c4 -> SaveAs ("/home/longhoa/ROOT_Work/Task_Test/File_Plot/plotTestREverseX.png");
}

And the result plot still have the Y axis on the left
plotTestREverseX

Is there any thing I miss, or is there any workaround?

Thank you very much.
Hoa.

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


It looks like you’re right. You might want to open a Github issue (see Report a bug or an issue), and I invite @couet to take a look

1 Like

It was not implemented. This PR implements it. Thanks for the report.

1 Like

Thank you very much.

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