12void hist051_Graphics_candle_plot_stack()
16 auto dateBegin =
new TDatime(2010, 1, 1, 0, 0, 0);
17 auto dateEnd =
new TDatime(2011, 1, 1, 0, 0, 0);
19 auto h1 =
new TH2I(
"h1",
"Machine A", 6, dateBegin->Convert(), dateEnd->Convert(), bins, 0, 1000);
20 auto h2 =
new TH2I(
"h2",
"Machine B", 6, dateBegin->Convert(), dateEnd->Convert(), bins, 0, 1000);
21 auto hsum =
new TH2I(
"h4",
"Sum", 6, dateBegin->Convert(), dateEnd->Convert(), bins, 0, 1000);
24 for (
int i = dateBegin->Convert(); i < dateEnd->Convert(); i += 86400 * 30) {
25 for (
int j = 0; j < 1000; j++) {
26 Rand = rng->Gaus(500 +
sin(i / 10000000.) * 100, 50);
29 Rand = rng->Gaus(500 +
sin(i / 12000000.) * 100, 50);
35 h2->SetLineColor(
kRed);
36 hsum->SetFillColor(
kGreen);
39 auto hs =
new THStack(
"hs",
"Machine A+B");
41 hs->Add(h2,
"candle2");
42 hs->Add(hsum,
"violin1");
44 hs->GetXaxis()->SetNdivisions(410);
48 hs->GetXaxis()->SetTimeDisplay(1);
49 hs->GetXaxis()->SetTimeFormat(
"%d/%m/%y");
50 hs->GetXaxis()->SetNdivisions(-6);
51 hs->GetXaxis()->SetTitle(
"Date [day/month/year]");
54 gPad->BuildLegend(0.75, 0.75, 0.95, 0.95,
"");
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
2-D histogram with an int per channel (see TH1 documentation)
This is the base class for the ROOT Random number generators.
RVec< PromoteType< T > > sin(const RVec< T > &v)