diff --git a/hist/histpainter/src/THistPainter.cxx b/hist/histpainter/src/THistPainter.cxx index ce9f3007e0013f1443d2ec2c17a59ac906b31bb2..4944e9e0bc8022a972d6e5cde69150a9d773a88e 100644 --- a/hist/histpainter/src/THistPainter.cxx +++ b/hist/histpainter/src/THistPainter.cxx @@ -2080,6 +2080,71 @@ Begin_Macro(source) End_Macro Begin_Html +<p>One <tt>TH2Poly</tt> bin can be a list of polygons. Such bins are defined +by calling <tt>AddBin</tt> with a <tt>TMultiGraph</tt>. The following example +shows a such case: +End_Html +Begin_Macro(source) +{ + TCanvas *ch2p2 = new TCanvas("ch2p2","ch2p2",600,400); + + Int_t i, bin; + const Int_t nx = 48; + char *states [nx] = { + "alabama", "arizona", "arkansas", "california", + "colorado", "connecticut", "delaware", "florida", + "georgia", "idaho", "illinois", "indiana", + "iowa", "kansas", "kentucky", "louisiana", + "maine", "maryland", "massachusetts", "michigan", + "minnesota", "mississippi", "missouri", "montana", + "nebraska", "nevada", "new_hampshire", "new_jersey", + "new_mexico", "new_york", "north_carolina", "north_dakota", + "ohio", "oklahoma", "oregon", "pennsylvania", + "rhode_island", "south_carolina", "south_dakota", "tennessee", + "texas", "utah", "vermont", "virginia", + "washington", "west_virginia", "wisconsin", "wyoming" + }; + Float_t pop[nx] = { + 4708708, 6595778, 2889450, 36961664, 5024748, 3518288, 885122, 18537969, + 9829211, 1545801, 12910409, 6423113, 3007856, 2818747, 4314113, 4492076, + 1318301, 5699478, 6593587, 9969727, 5266214, 2951996, 5987580, 974989, + 1796619, 2643085, 1324575, 8707739, 2009671, 19541453, 9380884, 646844, + 11542645, 3687050, 3825657, 12604767, 1053209, 4561242, 812383, 6296254, + 24782302, 2784572, 621760, 7882590, 6664195, 1819777, 5654774, 544270 + }; + + Double_t lon1 = -130; + Double_t lon2 = -65; + Double_t lat1 = 24; + Double_t lat2 = 50; + TH2Poly *p = new TH2Poly("USA","USA Population",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; + bin = p->AddBin(mg); + } + } + + for (i=0; i<nx; i++) p->Fill(states[i], pop[i]); + + gStyle->SetOptStat(11); + gStyle->SetPalette(1); + p->Draw("COLZ"); + return ch2p2; +} +End_Macro +Begin_Html + +<p> <tt>TH2Poly</tt> histograms can also be plotted using the GL interface using +the option "GLLEGO". <a name="HP21"></a><h3>The SPEC option</h3> @@ -2383,7 +2448,7 @@ The following types of plots are provided: <table border=0> <tr><th valign=top>"GLLEGO"</th><td> -Draw a lego plot. +Draw a lego plot. It works also for <tt>TH2Poly</tt>. </td></tr> <tr><th valign=top>"GLLEGO2</th><td>