<commit_before>/// \file
/// \ingroup tutorial_hist
/// Example of candle plot with 2-D histograms.
///
/// \macro_image
/// \macro_code
///
/// \author <NAME>

void candleplot() {

   gStyle->SetTimeOffset(0);
   TRandom *rand = new TRandom();
   TDatime *dateBegin = new TDatime(2010,1,1,0,0,0);
   TDatime *dateEnd = new TDatime(2011,1,1,0,0,0);

   TH2I *h1 = new TH2I("h1","Machine A + B",12,dateBegin->Convert(),dateEnd->Convert(),1000,0,1000);
   TH2I *h2 = new TH2I("h2","Machine B",12,dateBegin->Convert(),dateEnd->Convert(),1000,0,1000);

   h1->GetXaxis()->SetTimeDisplay(1);
   h1->GetXaxis()->SetTimeFormat("%m/%y");
   h1->GetXaxis()->SetTitle("Date [month/year]");

   float Rand;
   for (int i = dateBegin->Convert(); i < dateEnd->Convert(); i+=86400*30) {
      for (int j = 0; j < 1000; j++) {
         Rand = rand->Gaus(500+sin(i/10000000.)*100,50); h1->Fill(i,Rand);
         Rand = rand->Gaus(500+sin(i/11000000.)*100,70); h2->Fill(i,Rand);
      }
   }

   h1->SetBarWidth(0.4);
   h1->SetBarOffset(-0.25);

   h2->SetBarWidth(0.4);
   h2->SetBarOffset(0.25);
   h2->SetLineColor(kRed);

   TCanvas *c1 = new TCanvas();

   h1->Draw("candle2");
   h2->Draw("candle3 same");

   TLegend *leg = new TLegend(0.6,0.7,0.7,0.8);
   leg->AddEntry(h1,"Machine A","f");
   leg->AddEntry(h2,"Machine B","f");
   leg->Draw();
}<commit_msg>Uses the new option of TPad::BluidLegend<commit_after>/// \file
/// \ingroup tutorial_hist
/// Example of candle plot with 2-D histograms.
///
/// \macro_image
/// \macro_code
///
/// \author <NAME>

void candleplot() {

   gStyle->SetTimeOffset(0);
   TRandom *rand = new TRandom();
   TDatime *dateBegin = new TDatime(2010,1,1,0,0,0);
   TDatime *dateEnd = new TDatime(2011,1,1,0,0,0);

   TH2I *h1 = new TH2I("h1","Machine A + B",12,dateBegin->Convert(),dateEnd->Convert(),1000,0,1000);
   TH2I *h2 = new TH2I("h2","Machine B",12,dateBegin->Convert(),dateEnd->Convert(),1000,0,1000);

   h1->GetXaxis()->SetTimeDisplay(1);
   h1->GetXaxis()->SetTimeFormat("%m/%y");
   h1->GetXaxis()->SetTitle("Date [month/year]");

   float Rand;
   for (int i = dateBegin->Convert(); i < dateEnd->Convert(); i+=86400*30) {
      for (int j = 0; j < 1000; j++) {
         Rand = rand->Gaus(500+sin(i/10000000.)*100,50); h1->Fill(i,Rand);
         Rand = rand->Gaus(500+sin(i/11000000.)*100,70); h2->Fill(i,Rand);
      }
   }

   h1->SetBarWidth(0.4);
   h1->SetBarOffset(-0.25);

   h2->SetBarWidth(0.4);
   h2->SetBarOffset(0.25);
   h2->SetLineColor(kRed);

   TCanvas *c1 = new TCanvas();

   h1->Draw("candle2");
   h2->Draw("candle3 same");

   gPad->BuildLegend(0.6,0.7,0.7,0.8,"","f");
}
{'fraction_non_alphanumeric': 0.22977592100265856, 'fraction_numerical': 0.09798708697303456, 'mean_word_length': 3.51027397260274, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3368037', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1074, 'n_words': 173}