#include "../LineColors.h"
#include <string>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <vector>
#include "TH1F.h"
#include "TCanvas.h"
Go to the source code of this file.
Definition at line 27 of file test_LineColors.cxx.
28 const string myname =
"test_LineColors: ";
29 cout << myname <<
"Starting test" <<
endl;
31 cout << myname <<
"NDEBUG must be off." <<
endl;
34 string line =
"-----------------------------";
37 cout << myname << line <<
endl;
38 cout << myname <<
"Create histos." <<
endl;
39 TH1* ph0 =
new TH1F(
"hrate",
"Rate; x; y", 50, 0, 10);
42 for (
int ibin=0; ibin<50; ++ibin ) {
43 ph0->SetBinContent(ibin+1, 0.02*ibin);
50 cout << myname << iidx <<
": " << icol <<
endl;
51 TH1* ph =
dynamic_cast<TH1*
>(ph0->Clone());
53 ph->SetLineColor(icol);
57 cout << myname << line <<
endl;
58 cout << myname <<
"Draw histos." <<
endl;
59 TCanvas* pcan =
new TCanvas;
60 ph0->SetMaximum(ncol + 0.2);
62 for ( TH1* ph : hsts ) ph->Draw(
"hist same");
64 pcan->Print(
"test_LineColors.png");
static ColorType color(Index icolin, Index ncol=size())
void line(double t, double *p, double &x, double &y, double &z)
QTextStream & endl(QTextStream &s)