GetPointY() doesn't work for TGraphAsymmErrors

Hi all, I have a TGraphAsymmErrors object and I only want to plot it for y values that are above a certain value. In order to do this, I need to extract my y values from my function and compare them to that value and remove it if it is smaller. The problem is that I get an error saying that “there is no member named ‘GetPointY’ in ‘TGraphAsymmErrors’”. But GetPointY() is from the TGraph class and so I thought that it should also work for TGraphAsymmErrors, because I thought that this was ultimately still a TGraph object? Thanks!

Try: graph->GetY()[i] /* 0 <= i < graph->GetN() */

Thanks! I don’t get that error anymore, but some other things are now going wrong… This is what I did:

auto graph = new TGraphAsymmErrors(); 
graph->Divide(h1, h2);
int N = graph->GetN();
std::vector<double> y_value(N); 
  
for (unsigned i = 0; i < N; i++) {
   y_value[i] =  graph->GetY()[i]; 
   if (y_value[i] < 0.5) {
     graph->RemovePoint(); 
     }
  }
  graph->Draw("ap");

h1 and h2 are previously defined in my code and are both TH1D objects. when I try running my code there’s a “break segmentation violation”. Thanks!

for (int i = (N - 1); i >= 0; i--) {

I am still getting break: Segmentation violation… :confused:

I missed: graph->RemovePoint(i);

It works! Thanks a lot!