From c1536d839f20fb7dfefc81e31abfb49c87f93d11 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 3 Dec 2024 18:20:22 +0100 Subject: [PATCH 1/2] fix missing titleZ --- graphics/macros/graphs/scatter.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphics/macros/graphs/scatter.C b/graphics/macros/graphs/scatter.C index f9e5647a2d..a2960d57ba 100644 --- a/graphics/macros/graphs/scatter.C +++ b/graphics/macros/graphs/scatter.C @@ -30,6 +30,6 @@ void scatter() auto scatter = new TScatter(n, x, y, c, s); scatter->SetMarkerStyle(20); - scatter->SetTitle("Scatter plot;X;Y"); + scatter->SetTitle("Scatter plot;X;Y;Z"); scatter->Draw("A"); -} \ No newline at end of file +} From 45ed6744f1681c3bc584e716a998ea175dbd9de9 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 3 Dec 2024 18:21:10 +0100 Subject: [PATCH 2/2] add scatter2-test --- graphics/macros/graphs/scatter2.C | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 graphics/macros/graphs/scatter2.C diff --git a/graphics/macros/graphs/scatter2.C b/graphics/macros/graphs/scatter2.C new file mode 100644 index 0000000000..ca92a0bcbb --- /dev/null +++ b/graphics/macros/graphs/scatter2.C @@ -0,0 +1,37 @@ +/// \file +/// \ingroup tutorial_graphs +/// \notebook +/// Draw a scatter plot. +/// +/// \macro_image +/// \macro_code +/// +/// \author Olivier Couet + +void scatter2() +{ + auto c1 = new TCanvas(); + gStyle->SetPalette(kBird, 0, 0.6); // define a transparent palette + + const int n = 100; + double x[n]; + double y[n]; + double z[n]; + double c[n]; + double s[n]; + + // Define four random data set + auto r = new TRandom(); + for (int i=0; iRndm(i); + y[i] = 200*r->Rndm(i); + z[i] = 10*r->Rndm(i); + c[i] = 300*r->Rndm(i); + s[i] = 400*r->Rndm(i); + } + + auto scatter = new TScatter2D(n, x, y, z, c, s); + scatter->SetMarkerStyle(20); + scatter->SetTitle("Scatter plot;X;Y;Z"); + scatter->Draw("A"); +}