Skip to content

Commit 9a6fb0d

Browse files
committed
[tutorials] adjust annotation3d.C macro
Place TAnnotation higher while web graphics uses real 3D coordinates which were under drawn surface. Use TCanvas::Add() method for drawing objects on the canvas
1 parent 10d5727 commit 9a6fb0d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tutorials/visualisation/graphics/annotation3d.C

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void annotation3d()
5454
f->SetLineWidth(1);
5555
f->SetLineColorAlpha(kAzure - 2, 0.3);
5656

57-
f->Draw("surf1 fb");
57+
c->Add(f, "surf1 fb");
5858

5959
// Lines for 3D annotation
6060
double x[11] = {-0.500, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.500};
@@ -71,21 +71,21 @@ void annotation3d()
7171

7272
g2->SetLineColor(kRed);
7373
g2->SetLineWidth(3);
74-
g2->Draw();
74+
c->Add(g2);
7575

7676
l2->SetLineColor(kRed);
7777
l2->SetLineStyle(kDashed);
7878
l2->SetLineWidth(1);
79-
l2->Draw();
79+
c->Add(l2);
8080

8181
// Draw text Annotations
82-
TAnnotation *txt = new TAnnotation(-0.45, -0.2, 0.3, "f(y,x_{0})");
82+
auto txt = new TAnnotation(-0.45, -0.2, 0.33, "f(y,x_{0})");
8383
txt->SetTextFont(42);
8484
txt->SetTextColor(kRed);
85-
txt->Draw();
85+
c->Add(txt);
8686

87-
TAnnotation *txt1 = new TAnnotation(0.5, 0.5, 0.3, "f(x,y)");
87+
auto txt1 = new TAnnotation(0.5, 0.5, 0.3, "f(x,y)");
8888
txt1->SetTextColor(kBlue);
8989
txt1->SetTextFont(42);
90-
txt1->Draw();
90+
c->Add(txt1);
9191
}

0 commit comments

Comments
 (0)