<commit_before>//This tutorial illustrates how to create an histogram with polygonal
//bins (TH2Poly), fill it and draw it. The initial data are stored
//in TMultiGraphs. They represent the USA.
//The initial data have been downloaded from: http://www.maproom.psu.edu/dcw/
//Author: <NAME>

void th2polyUSA()
{
   TCanvas *usa = new TCanvas("USA", "USA");
   usa->ToggleEventStatus();

   Double_t x1 = -130;
   Double_t x2 = -65;
   Double_t y1 = 24;
   Double_t y2 = 50;
   TH2Poly *p = new TH2Poly("USA","USA",x1,x2,y1,y2);

   TFile *f;
   f = TFile::Open("http://root.cern.ch/files/usa.root");

   TMultiGraph *mg;
   TKey *key;
   TIter nextkey(gDirectory->GetListOfKeys());
   while (key = (TKey*)nextkey()) {
      obj = key->ReadObj();
      if (obj->InheritsFrom("TMultiGraph")) {
         mg = (TMultiGraph*)obj;
         p->AddBin(mg);
      }
   }

   TRandom r;
   Double_t px,py;

   gBenchmark->Start("Partitioning");
   p->ChangePartition(100, 100);
   gBenchmark->Show("Partitioning");

   for (Int_t i=0; i<500000; i++) {
      px = (x2-x1)*r.Gaus(2.,1)+(x2+x1)/2;
      py = (y2-y1)*r.Gaus(2.,1)+(y2+y1)/2;
      p->Fill(px,py);
   }
   gBenchmark->Show("Filling");

   gStyle->SetOptStat(11);
   gStyle->SetPalette(1); 
   p->Draw("COL");
   printf("Nbins = %d Minimum = %g Maximum = %g Integral = %f \n",
          p->GetNumberOfBins(),
          p->GetMinimum(),
          p->GetMaximum(),
          p->Integral("width"));
}<commit_msg>- New version using mercator projection<commit_after>//This tutorial illustrates how to create an histogram with polygonal
//bins (TH2Poly), fill it and draw it using GL. The initial data are stored
//in TMultiGraphs. They represent the USA.
//
//The initial data have been downloaded from: http://www.maproom.psu.edu/dcw/
//This database was developed in 1991/1992 and national boundaries reflect
//political reality as of that time.
//
//Author: <NAME>

void th2polyUSA()
{
	gStyle->SetCanvasPreferGL(true);
   TCanvas *usa = new TCanvas("USA", "USA");
   usa->ToggleEventStatus();
   Double_t lon1 = -130;
   Double_t lon2 = -65;
   Double_t lat1 = 24;
   Double_t lat2 = 50;
   TH2Poly *p = new TH2Poly("USA","USA",lon1,lon2,lat1,lat2);

   TFile *f;
   f = TFile::Open("http://root.cern.ch/files/usa.root");

   TMultiGraph *mg;
   TKey *key;
   TIter nextkey(gDirectory->GetListOfKeys());
   while (key = (TKey*)nextkey()) {
      obj = key->ReadObj();
      if (obj->InheritsFrom("TMultiGraph")) {
         mg = (TMultiGraph*)obj;
         p->AddBin(mg);
      }
   }

   TRandom r;
   Double_t longitude, latitude;
   Double_t x, y, dr = TMath::Pi()/180, rd = 180/TMath::Pi();

   p->ChangePartition(100, 100);

   for (Int_t i=0; i<500000; i++) {
      longitude = r.Uniform(dr*lon1,dr*lon2);
      latitude  = r.Uniform(-dr*90,dr*90);
      x         = rd*longitude;
      y         = 39*TMath::Log(TMath::Tan((TMath::Pi()/4)+(latitude/2)));
      p->Fill(x,y);
   }

   gStyle->SetOptStat(11);
   gStyle->SetPalette(1); 
   p->Draw("glhp");
}
{'fraction_non_alphanumeric': 0.17430278884462153, 'fraction_numerical': 0.03718459495351926, 'mean_word_length': 2.974934036939314, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1333505', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1111, 'n_words': 254}