Good afternoon!
This is my sample code:
void function_1(){
int i;
double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0};
int n = (int)(sizeof(x) / sizeof(double));
for (i = 0; i < n; i++)
x[i] /= 3.0;
double y[] = {86.25, 85.2, 73.4, 75.3, 71.4, 68.4, 73.35, 64.4, 83.15, 68.4, 50.65};
double dy[] = {95.33, 94.35, 81.95, 83.77, 79.76, 76.63, 81.98, 72.54, 92.33, 76.69, 57.55};
for (i = 0; i < n; i++)
dy[i] -= y[i];
TGraphErrors *gr = new TGraphErrors(n, x, y, NULL, dy);
//=== Plots ===================================
TCanvas *c1 = new TCanvas("c1", "c1", 2000, 1500);
c1->DrawFrame(0.0, 0.0, 4.0, 100.0);
gr->Draw("AP");
//c1->DrawFrame(0.0, 0.0, 4.0, 100.0);
//----------------------------------------------
c1->SaveAs("result.pdf");
delete c1;
//=== /Plots ===================================
delete gr;
}
Here DrawFrame
line doesn’t affect anything. If I put it after gr->Draw("AP")
, only frame is drawn, without points. I would like to obtain both frame and points.
Help me with this, please.
Best regards,
Natalia
My system:
> lsb_release -d && uname -r
No LSB modules are available.
Description: Debian GNU/Linux 12 (bookworm)
6.3.0-2-amd64
> g++ --version
g++ (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> root --version
ROOT Version: 6.28/04
Built for linuxx8664gcc on May 08 2023, 02:44:07
From tags/v6-28-04@v6-28-04