From c8dd29b693794199f2d0b2b3c1d2cdf0eb1ff2d6 Mon Sep 17 00:00:00 2001
From: Olivier Couet <Olivier.Couet@cern.ch>
Date: Fri, 16 Nov 2007 16:05:45 +0000
Subject: [PATCH] - Two new tests: parallelcoord() and labels1() - The test
 timage() now generates .C and test it back.

git-svn-id: http://root.cern.ch/svn/root/trunk@20847 27541ba8-7e3a-0410-8455-c3a389f83636
---
 test/stressGraphics.cxx | 76 ++++++++++++++++++++++++++++++++++++++---
 test/stressGraphics.ref | 75 ++++++++++++++++++++--------------------
 2 files changed, 109 insertions(+), 42 deletions(-)

diff --git a/test/stressGraphics.cxx b/test/stressGraphics.cxx
index fa6af1a49f5..24c0b5684d8 100644
--- a/test/stressGraphics.cxx
+++ b/test/stressGraphics.cxx
@@ -93,6 +93,7 @@ void     tgaxis1        ();
 void     tgaxis2        ();
 void     tgaxis3        ();
 void     tgaxis4        ();
+void     labels1        ();
 void     tellipse       ();
 void     feynman        ();
 void     tgraph1        ();
@@ -113,6 +114,7 @@ void     quarks         ();
 void     timage         ();
 void     zoomtf1        ();
 void     zoomfit        ();
+void     parallelcoord  ();
 void     clonepad       ();
 
 // Auxiliary functions
@@ -124,8 +126,8 @@ void     cleanup        ();
 // Global variables.
 Int_t     gVerbose;
 Int_t     gTestNum;
-Int_t     gRefNb[37];
-Int_t     gErrNb[37];
+Int_t     gRefNb[39];
+Int_t     gErrNb[39];
 Bool_t    gOptionR;
 Bool_t    gOptionK;
 TH2F     *gH2;
@@ -249,6 +251,7 @@ void stressGraphics(Int_t verbose = 0)
    tgaxis2      ();
    tgaxis3      ();
    tgaxis4      ();
+   labels1      ();
    tellipse     ();
    feynman      ();
    tgraph1      ();
@@ -279,7 +282,8 @@ void stressGraphics(Int_t verbose = 0)
    timage       ();
    zoomtf1      ();
    zoomfit      ();
-///clonepad     ();
+   parallelcoord();
+//////clonepad     ();
    if (!gOptionR) {
       cout << "**********************************************************************" <<endl;
 
@@ -1205,6 +1209,46 @@ void tgaxis4()
 }
 
 
+//______________________________________________________________________________
+void labels1()
+{
+   // Alphanumeric labels in a 1-d histogram
+
+   TCanvas *C = StartTest(900,500);
+
+   const Int_t nx = 20;
+   char *people[nx] = {"Jean","Pierre","Marie","Odile","Sebastien","Fons","Rene",
+   "Nicolas","Xavier","Greg","Bjarne","Anton","Otto","Eddy","Peter","Pasha",
+   "Philippe","Suzanne","Jeff","Valery"};
+
+   C->SetGrid();
+   C->SetBottomMargin(0.15);
+   TH1F *hlab1 = new TH1F("hlab1","hlab1",nx,0,nx);
+   hlab1->SetFillColor(38);
+   for (Int_t i=0;i<5000;i++) {
+      hlab1->Fill(gRandom->Gaus(0.5*nx,0.2*nx));
+   }
+   hlab1->SetStats(0);
+   for (Int_t i=1;i<=nx;i++) {
+      hlab1->GetXaxis()->SetBinLabel(i,people[i-1]);
+   }
+   hlab1->Draw();
+   TPaveText *pt = new TPaveText(0.6,0.7,0.98,0.98,"brNDC");
+   pt->SetFillColor(18);
+   pt->SetTextAlign(12);
+   pt->AddText("Use the axis Context Menu LabelsOption");
+   pt->AddText(" \"a\"   to sort by alphabetic order");
+   pt->AddText(" \">\"   to sort by decreasing vakues");
+   pt->AddText(" \"<\"   to sort by increasing vakues");
+   pt->Draw();
+
+   TestReport1(C, "Alphanumeric labels in a 1-d histogram");
+   DoCcode(C);
+   TestReport2(C);
+   delete hlab1;
+}
+
+
 //______________________________________________________________________________
 void tellipse()
 {
@@ -2041,8 +2085,8 @@ void timage()
    C->cd();
 
    TestReport1(C, "TImage");
-///DoCcode(C);
-///TestReport2(C);
+   DoCcode(C);
+   TestReport2(C);
 }
 
 
@@ -2095,6 +2139,28 @@ void zoomfit()
 }
 
 
+//______________________________________________________________________________
+void parallelcoord()
+{
+   // Parallel Coordinates
+
+   TCanvas *C = StartTest(800,700);
+
+   TNtuple *ntuple = (TNtuple*)gFile->Get("ntuple");
+
+   C->Divide(1,2);
+
+   C->cd(1);
+   ntuple->Draw("px:py:pz:random:px*py*pz","","para");
+   C->cd(2);
+   ntuple->Draw("px:py:pz:random:px*py*pz","","candle");
+
+   TestReport1(C, "Parallel Coordinates");
+   DoCcode(C);
+   TestReport2(C);
+}
+
+
 //______________________________________________________________________________
 void clonepad()
 {
diff --git a/test/stressGraphics.ref b/test/stressGraphics.ref
index c13c0dad815..b1927c0e61a 100644
--- a/test/stressGraphics.ref
+++ b/test/stressGraphics.ref
@@ -1,38 +1,39 @@
 Test#   Ref#   Err#   Time
-  1      534   200
-  2     3590   600
-  3      457    50
-  4    23233  1500
-  5      938    50
-  6      429    50
-  7     4654    50
-  8     4971    40
-  9     8722    90
- 10     8059    70
- 11    11838   100
- 12    14736  5000
- 13    19046   400
- 14    14730   100
- 15    22128   300
- 16     3511   600
- 17     4126    40
- 18     7719   300
- 19     4403   100
- 20     6038   150
- 21    15050  5500
- 22    29248  8200
- 23   315847  5500
- 24    28228   300
- 25    71483   400
- 26   211282  6500
- 27   250949  5000
- 28  1478867 35000
- 29   298758  2000
- 30    23500   200
- 31    14755   100
- 32   253386  5000
- 33     2604    50
- 34  1435342  2000
- 35     4837   200
- 36     6436   200
- 37   173989   200
+  1      534    200
+  2     3590    600
+  3      457     50
+  4    23233   1500
+  5      938     50
+  6      429     50
+  7     4654     50
+  8     4971     40
+  9     8722     90
+ 10     8059     70
+ 11    11838    100
+ 12    14736   5000
+ 13    19046    400
+ 14    14730    100
+ 15    22128    300
+ 16     3511    600
+ 17     4622    600
+ 18     4126     40
+ 19     7719    300
+ 20     4403    100
+ 21     6038    200
+ 22    15050   5500
+ 23    29248   8200
+ 24   315847   5500
+ 25    28228    300
+ 26    67878    700
+ 27   211282   6500
+ 28   245315   5000
+ 29  1478867  35000
+ 30   298758   2000
+ 31    23500    200
+ 32    14755    100
+ 33   253386   5000
+ 34     2604     50
+ 35  1226352 210000
+ 36     4837    200
+ 37     6436    200
+ 38  1584818   5000
-- 
GitLab