Logo ROOT  
Reference Guide
TPaletteAxis.cxx
Go to the documentation of this file.
1// @(#)root/histpainter:$Id$
2// Author: Rene Brun 15/11/2002
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "Riostream.h"
13#include "TROOT.h"
14#include "TPaletteAxis.h"
15#include "TVirtualPad.h"
16#include "TVirtualX.h"
17#include "TStyle.h"
18#include "TMath.h"
19#include "TView.h"
20#include "TH1.h"
21#include "TGaxis.h"
22#include "TLatex.h"
23
25
26
27////////////////////////////////////////////////////////////////////////////////
28
29/*! \class TPaletteAxis
30\ingroup Histpainter
31\brief The palette painting class.
32
33A `TPaletteAxis` object is used to display the color palette when
34drawing 2-d histograms.
35
36The `TPaletteAxis` is automatically created drawn when drawing a 2-D
37histogram when the option "Z" is specified.
38
39A `TPaletteAxis` object is added to the histogram list of functions and
40can be retrieved doing:
41
42 TPaletteAxis *palette = (TPaletteAxis*)h->GetListOfFunctions()->FindObject("palette");
43
44then the pointer `palette` can be used to change the palette attributes.
45
46Because the palette is created at painting time only, one must issue a:
47
48 gPad->Update();
49
50before retrieving the palette pointer in order to create the palette. The following
51macro gives an example.
52
53Begin_Macro(source)
54{
55 TCanvas *c1 = new TCanvas("c1","c1",600,400);
56 TH2F *h2 = new TH2F("h2","Example of a resized palette ",40,-4,4,40,-20,20);
57 Float_t px, py;
58 for (Int_t i = 0; i < 25000; i++) {
59 gRandom->Rannor(px,py);
60 h2->Fill(px,5*py);
61 }
62 gStyle->SetPalette(1);
63 h2->Draw("COLZ");
64 gPad->Update();
65 TPaletteAxis *palette = (TPaletteAxis*)h2->GetListOfFunctions()->FindObject("palette");
66 palette->SetY2NDC(0.7);
67 return c1;
68}
69End_Macro
70
71`TPaletteAxis` inherits from `TBox` and `TPave`. The methods
72allowing to specify the palette position are inherited from these two classes.
73
74The palette can be interactively moved and resized. The context menu
75can be used to set the axis attributes.
76
77It is possible to select a range on the axis to set the min/max in z
78
79As default labels and ticks are drawn by `TGAxis` at equidistant (lin or log)
80points as controlled by SetNdivisions.
81If option "CJUST" is given labels and ticks are justified at the
82color boundaries defined by the contour levels.
83In this case no optimization can be done. It is responsiblity of the
84user to adjust minimum, maximum of the histogram and/or the contour levels
85to get a reasonable look of the plot.
86Only overlap of the labels is avoided if too many contour levels are used.
87
88This option is especially useful with user defined contours.
89An example is shown here:
90Begin_Macro(source)
91{
92 gStyle->SetOptStat(0);
93 TCanvas *c1 = new TCanvas("c1","exa_CJUST",300,10,400,400);
94 TH2F *hpxpy = new TH2F("hpxpy","py vs px",40,-4,4,40,-4,4);
95 // Fill histograms randomly
96 TRandom3 randomNum;
97 Float_t px, py;
98 for (Int_t i = 0; i < 25000; i++) {
99 randomNum.Rannor(px,py);
100 hpxpy->Fill(px,py);
101 }
102 hpxpy->SetMaximum(200);
103 Double_t zcontours[5] = {0, 20, 40, 80, 120};
104 hpxpy->SetContour(5, zcontours);
105 hpxpy->GetZaxis()->SetTickSize(0.01);
106 hpxpy->GetZaxis()->SetLabelOffset(0.01);
107 gPad->SetRightMargin(0.13);
108 hpxpy->SetTitle("User contours, CJUST");
109 hpxpy->Draw("COL Z CJUST");
110}
111End_Macro
112*/
113
114
115////////////////////////////////////////////////////////////////////////////////
116/// Palette default constructor.
117
119{
120 fH = 0;
121 SetName("");
122}
123
124
125////////////////////////////////////////////////////////////////////////////////
126/// Palette normal constructor.
127
129 : TPave(x1, y1, x2, y2)
130{
131 fH = h;
132 SetName("palette");
133 TAxis *zaxis = fH->GetZaxis();
135 if (gPad->GetView()) SetBit(kHasView);
136}
137
138
139////////////////////////////////////////////////////////////////////////////////
140/// Palette destructor.
141
143{
144}
145
146
147////////////////////////////////////////////////////////////////////////////////
148/// Palette copy constructor.
149
151{
152 ((TPaletteAxis&)palette).Copy(*this);
153}
154
155
156////////////////////////////////////////////////////////////////////////////////
157/// Assignment operator.
158
160{
161 orig.Copy( *this );
162 return *this;
163}
164
165
166////////////////////////////////////////////////////////////////////////////////
167/// Copy a palette to a palette.
168
170{
171 TPave::Copy(obj);
172 ((TPaletteAxis&)obj).fH = fH;
173 ((TPaletteAxis&)obj).fName = fName;
174}
175
176
177////////////////////////////////////////////////////////////////////////////////
178/// Check if mouse on the axis region.
179
181{
182 Int_t plxmax = gPad->XtoAbsPixel(fX2);
183 Int_t plymin = gPad->YtoAbsPixel(fY1);
184 Int_t plymax = gPad->YtoAbsPixel(fY2);
185 if (px > plxmax && px < plxmax + 30 && py >= plymax && py <= plymin) return px - plxmax;
186
187 //otherwise check if inside the box
188 return TPave::DistancetoPrimitive(px, py);
189}
190
191
192////////////////////////////////////////////////////////////////////////////////
193/// Check if mouse on the axis region.
194
196{
197 if (!gPad) return;
198
199 static Int_t kmode = 0;
200 Int_t plxmin = gPad->XtoAbsPixel(fX1);
201 Int_t plxmax = gPad->XtoAbsPixel(fX2);
202 if (kmode != 0 || px <= plxmax) {
203 if (event == kButton1Down) kmode = 1;
204 TBox::ExecuteEvent(event, px, py);
205 if (event == kButton1Up) kmode = 0;
206 // In case palette coordinates have been modified, recompute NDC coordinates
207 Double_t dpx = gPad->GetX2() - gPad->GetX1();
208 Double_t dpy = gPad->GetY2() - gPad->GetY1();
209 Double_t xp1 = gPad->GetX1();
210 Double_t yp1 = gPad->GetY1();
211 fX1NDC = (fX1 - xp1) / dpx;
212 fY1NDC = (fY1 - yp1) / dpy;
213 fX2NDC = (fX2 - xp1) / dpx;
214 fY2NDC = (fY2 - yp1) / dpy;
215 return;
216 }
217 gPad->SetCursor(kHand);
218 static Double_t ratio1, ratio2;
219 static Int_t px1old, py1old, px2old, py2old;
220 Double_t temp, xmin, xmax;
221
222 switch (event) {
223
224 case kButton1Down:
225 ratio1 = (gPad->AbsPixeltoY(py) - fY1) / (fY2 - fY1);
226 py1old = gPad->YtoAbsPixel(fY1 + ratio1 * (fY2 - fY1));
227 px1old = plxmin;
228 px2old = plxmax;
229 py2old = py1old;
230 gVirtualX->DrawBox(px1old, py1old, px2old, py2old, TVirtualX::kHollow);
231 gVirtualX->SetLineColor(-1);
232 // No break !!!
233
234 case kButton1Motion:
235 gVirtualX->DrawBox(px1old, py1old, px2old, py2old, TVirtualX::kHollow);
236 ratio2 = (gPad->AbsPixeltoY(py) - fY1) / (fY2 - fY1);
237 py2old = gPad->YtoAbsPixel(fY1 + ratio2 * (fY2 - fY1));
238 gVirtualX->DrawBox(px1old, py1old, px2old, py2old, TVirtualX::kHollow);
239 break;
240
241 case kButton1Up:
242 if (gROOT->IsEscaped()) {
243 gROOT->SetEscape(kFALSE);
244 break;
245 }
246
247 ratio2 = (gPad->AbsPixeltoY(py) - fY1) / (fY2 - fY1);
248 xmin = ratio1;
249 xmax = ratio2;
250 if (xmin > xmax) {
251 temp = xmin;
252 xmin = xmax;
253 xmax = temp;
254 temp = ratio1;
255 ratio1 = ratio2;
256 ratio2 = temp;
257 }
258 if (ratio2 - ratio1 > 0.05) {
259 if (fH->GetDimension() == 2) {
260 Double_t zmin = fH->GetMinimum();
261 Double_t zmax = fH->GetMaximum();
262 if (gPad->GetLogz()) {
263 if (zmin <= 0 && zmax > 0) zmin = TMath::Min((Double_t)1,
264 (Double_t)0.001 * zmax);
265 zmin = TMath::Log10(zmin);
266 zmax = TMath::Log10(zmax);
267 }
268 Double_t newmin = zmin + (zmax - zmin) * ratio1;
269 Double_t newmax = zmin + (zmax - zmin) * ratio2;
270 if (newmin < zmin)newmin = fH->GetBinContent(fH->GetMinimumBin());
271 if (newmax > zmax)newmax = fH->GetBinContent(fH->GetMaximumBin());
272 if (gPad->GetLogz()) {
273 newmin = TMath::Exp(2.302585092994 * newmin);
274 newmax = TMath::Exp(2.302585092994 * newmax);
275 }
276 fH->SetMinimum(newmin);
277 fH->SetMaximum(newmax);
279 }
280 gPad->Modified(kTRUE);
281 }
282 gVirtualX->SetLineColor(-1);
283 kmode = 0;
284 break;
285 }
286}
287
288
289////////////////////////////////////////////////////////////////////////////////
290/// Returns the color index of the bin (i,j).
291///
292/// This function should be used after an histogram has been plotted with the
293/// option COL or COLZ like in the following example:
294///
295/// h2->Draw("COLZ");
296/// gPad->Update();
297/// TPaletteAxis *palette = (TPaletteAxis*)h2->GetListOfFunctions()->FindObject("palette");
298/// Int_t ci = palette->GetBinColor(20,15);
299///
300/// Then it is possible to retrieve the RGB components in the following way:
301///
302/// TColor *c = gROOT->GetColor(ci);
303/// float x,y,z;
304/// c->GetRGB(x,y,z);
305
307{
308 Double_t zc = fH->GetBinContent(i, j);
309 return GetValueColor(zc);
310}
311
312
313////////////////////////////////////////////////////////////////////////////////
314/// Displays the z value corresponding to cursor position py.
315
316char *TPaletteAxis::GetObjectInfo(Int_t /* px */, Int_t py) const
317{
318 Double_t z;
319 static char info[64];
320
321 Double_t zmin = fH->GetMinimum();
322 Double_t zmax = fH->GetMaximum();
323 Int_t y1 = gPad->GetWh() - gPad->VtoPixel(fY1NDC);
324 Int_t y2 = gPad->GetWh() - gPad->VtoPixel(fY2NDC);
325 Int_t y = gPad->GetWh() - py;
326
327 if (gPad->GetLogz()) {
328 if (zmin <= 0 && zmax > 0) zmin = TMath::Min((Double_t)1,
329 (Double_t)0.001 * zmax);
330 Double_t zminl = TMath::Log10(zmin);
331 Double_t zmaxl = TMath::Log10(zmax);
332 Double_t zl = (zmaxl - zminl) * ((Double_t)(y - y1) / (Double_t)(y2 - y1)) + zminl;
333 z = TMath::Power(10., zl);
334 } else {
335 z = (zmax - zmin) * ((Double_t)(y - y1) / (Double_t)(y2 - y1)) + zmin;
336 }
337
338 snprintf(info, 64, "(z=%g)", z);
339 return info;
340}
341
342
343////////////////////////////////////////////////////////////////////////////////
344/// Returns the color index of the given z value
345///
346/// This function should be used after an histogram has been plotted with the
347/// option COL or COLZ like in the following example:
348///
349/// h2->Draw("COLZ");
350/// gPad->Update();
351/// TPaletteAxis *palette = (TPaletteAxis*)h2->GetListOfFunctions()->FindObject("palette");
352/// Int_t ci = palette->GetValueColor(30.);
353///
354/// Then it is possible to retrieve the RGB components in the following way:
355///
356/// TColor *c = gROOT->GetColor(ci);
357/// float x,y,z;
358/// c->GetRGB(x,y,z);
359
361{
362 Double_t wmin = fH->GetMinimum();
363 Double_t wmax = fH->GetMaximum();
364 Double_t wlmin = wmin;
365 Double_t wlmax = wmax;
366
367 if (gPad->GetLogz()) {
368 if (wmin <= 0 && wmax > 0) wmin = TMath::Min((Double_t)1,
369 (Double_t)0.001 * wmax);
370 wlmin = TMath::Log10(wmin);
371 wlmax = TMath::Log10(wmax);
372 }
373
374 Int_t ncolors = gStyle->GetNumberOfColors();
375 Int_t ndivz = fH->GetContour();
376 if (ndivz == 0) return 0;
377 ndivz = TMath::Abs(ndivz);
378 Int_t theColor, color;
379 Double_t scale = ndivz / (wlmax - wlmin);
380
381 if (fH->TestBit(TH1::kUserContour) && gPad->GetLogz()) zc = TMath::Log10(zc);
382 if (zc < wlmin) zc = wlmin;
383
384 color = Int_t(0.01 + (zc - wlmin) * scale);
385
386 theColor = Int_t((color + 0.99) * Double_t(ncolors) / Double_t(ndivz));
387 return gStyle->GetColorPalette(theColor);
388}
389
390
391////////////////////////////////////////////////////////////////////////////////
392/// Paint the palette.
393
395{
397
398 SetFillStyle(1001);
399 Double_t ymin = fY1;
400 Double_t ymax = fY2;
401 Double_t xmin = fX1;
402 Double_t xmax = fX2;
403 Double_t wmin = fH->GetMinimum();
404 Double_t wmax = fH->GetMaximum();
405 Double_t wlmin = wmin;
406 Double_t wlmax = wmax;
407 Double_t y1, y2, w1, w2, zc;
408
409 if ((wlmax - wlmin) <= 0) {
410 Double_t mz = wlmin * 0.1;
411 if (mz == 0) mz = 0.1;
412 wlmin = wlmin - mz;
413 wlmax = wlmax + mz;
414 wmin = wlmin;
415 wmax = wlmax;
416 }
417
418 if (gPad->GetLogz()) {
419 if (wmin <= 0 && wmax > 0) wmin = TMath::Min((Double_t)1,
420 (Double_t)0.001 * wmax);
421 wlmin = TMath::Log10(wmin);
422 wlmax = TMath::Log10(wmax);
423 }
424 Double_t ws = wlmax - wlmin;
425 Int_t ncolors = gStyle->GetNumberOfColors();
426 Int_t ndivz = fH->GetContour();
427 if (ndivz == 0) return;
428 ndivz = TMath::Abs(ndivz);
429 Int_t theColor, color;
430 // import Attributes already here since we might need them for CJUST
432 // case option "CJUST": put labels directly at color boundaries
433 TLatex *label = NULL;
434 TLine *line = NULL;
435 Double_t prevlab = 0;
436 TString opt(fH->GetDrawOption());
437 if (opt.Contains("CJUST", TString::kIgnoreCase)) {
438 label = new TLatex();
442 line = new TLine();
445 }
446 Double_t scale = ndivz / (wlmax - wlmin);
447 for (Int_t i = 0; i < ndivz; i++) {
448
449 zc = fH->GetContourLevel(i);
450 if (fH->TestBit(TH1::kUserContour) && gPad->GetLogz())
451 zc = TMath::Log10(zc);
452 w1 = zc;
453 if (w1 < wlmin) w1 = wlmin;
454
455 w2 = wlmax;
456 if (i < ndivz - 1) {
457 zc = fH->GetContourLevel(i + 1);
458 if (fH->TestBit(TH1::kUserContour) && gPad->GetLogz())
459 zc = TMath::Log10(zc);
460 w2 = zc;
461 }
462
463 if (w2 <= wlmin) continue;
464 y1 = ymin + (w1 - wlmin) * (ymax - ymin) / ws;
465 y2 = ymin + (w2 - wlmin) * (ymax - ymin) / ws;
466
468 color = i;
469 } else {
470 color = Int_t(0.01 + (w1 - wlmin) * scale);
471 }
472
473 theColor = Int_t((color + 0.99) * Double_t(ncolors) / Double_t(ndivz));
476 gPad->PaintBox(xmin, y1, xmax, y2);
477 // case option "CJUST": put labels directly
478 if (label) {
479 Double_t lof = fAxis.GetLabelOffset()*(gPad->GetUxmax()-gPad->GetUxmin());
480 // the following assumes option "S"
481 Double_t tlength = fAxis.GetTickSize() * (gPad->GetUxmax()-gPad->GetUxmin());
482 Double_t lsize = fAxis.GetLabelSize();
483 Double_t lsize_user = lsize*(gPad->GetUymax()-gPad->GetUymin());
484 Double_t zlab = fH->GetContourLevel(i);
485 if (gPad->GetLogz()&& !fH->TestBit(TH1::kUserContour)) {
486 zlab = TMath::Power(10, zlab);
487 }
488 // make sure labels dont overlap
489 if (i == 0 || (y1 - prevlab) > 1.5*lsize_user) {
490 label->PaintLatex(xmax + lof, y1, 0, lsize, Form("%g", zlab));
491 prevlab = y1;
492 }
493 line->PaintLine(xmax-tlength, y1, xmax, y1);
494 if (i == ndivz-1) {
495 // label + tick at top of axis
496 if ((y2 - prevlab > 1.5*lsize_user))
497 label->PaintLatex(xmax + lof, y2, 0, lsize, Form("%g",fH->GetMaximum()));
498 line->PaintLine(xmax-tlength, y2, xmax, y2);
499 }
500 }
501 }
502
503 // Take primary divisions only
504 Int_t ndiv = fH->GetZaxis()->GetNdivisions();
505 Bool_t isOptimized = ndiv>0;
506 Int_t absDiv = abs(ndiv);
507 Int_t maxD = absDiv/1000000;
508 ndiv = absDiv%100 + maxD*1000000;
509 if (!isOptimized) ndiv = -ndiv;
510
511 char chopt[6] = "S ";
512 chopt[1] = 0;
513 strncat(chopt, "+L", 3);
514 if (ndiv < 0) {
515 ndiv = TMath::Abs(ndiv);
516 strncat(chopt, "N", 2);
517 }
518 if (gPad->GetLogz()) {
519 wmin = TMath::Power(10., wlmin);
520 wmax = TMath::Power(10., wlmax);
521 strncat(chopt, "G", 2);
522 }
523 if (label) {
524 // case option "CJUST", cleanup
525 delete label;
526 delete line;
527 } else {
528 // default
529 fAxis.PaintAxis(xmax, ymin, xmax, ymax, wmin, wmax, ndiv, chopt);
530 }
531}
532
533
534////////////////////////////////////////////////////////////////////////////////
535/// Save primitive as a C++ statement(s) on output stream out.
536
537void TPaletteAxis::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
538{
539 //char quote = '"';
540 out << " " << std::endl;
541 if (gROOT->ClassSaved(TPaletteAxis::Class())) {
542 out << " ";
543 } else {
544 out << " " << ClassName() << " *";
545 }
546 if (fOption.Contains("NDC")) {
547 out << "palette = new " << ClassName() << "(" << fX1NDC << "," << fY1NDC << "," << fX2NDC << "," << fY2NDC
548 << "," << fH->GetName() << ");" << std::endl;
549 } else {
550 out << "palette = new " << ClassName() << "(" << fX1 << "," << fY1 << "," << fX2 << "," << fY2
551 << "," << fH->GetName() << ");" << std::endl;
552 }
553 out << " palette->SetLabelColor(" << fAxis.GetLabelColor() << ");" << std::endl;
554 out << " palette->SetLabelFont(" << fAxis.GetLabelFont() << ");" << std::endl;
555 out << " palette->SetLabelOffset(" << fAxis.GetLabelOffset() << ");" << std::endl;
556 out << " palette->SetLabelSize(" << fAxis.GetLabelSize() << ");" << std::endl;
557 out << " palette->SetTitleOffset(" << fAxis.GetTitleOffset() << ");" << std::endl;
558 out << " palette->SetTitleSize(" << fAxis.GetTitleSize() << ");" << std::endl;
559 SaveFillAttributes(out, "palette", -1, -1);
560 SaveLineAttributes(out, "palette", 1, 1, 1);
561}
562
563
564////////////////////////////////////////////////////////////////////////////////
565/// Unzoom the palette
566
568{
569 TView *view = gPad->GetView();
570 if (view) {
571 delete view;
572 gPad->SetView(0);
573 }
574 fH->GetZaxis()->SetRange(0, 0);
575 if (fH->GetDimension() == 2) {
576 fH->SetMinimum();
577 fH->SetMaximum();
579 }
580}
@ kButton1Motion
Definition: Buttons.h:20
@ kButton1Up
Definition: Buttons.h:19
@ kButton1Down
Definition: Buttons.h:17
void Class()
Definition: Class.C:29
@ kHand
Definition: GuiTypes.h:373
#define h(i)
Definition: RSha256.hxx:106
static const double x2[5]
static const double x1[5]
int Int_t
Definition: RtypesCore.h:43
const Bool_t kFALSE
Definition: RtypesCore.h:90
double Double_t
Definition: RtypesCore.h:57
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
@ kVAlignCenter
Definition: TAttText.h:53
@ kHAlignLeft
Definition: TAttText.h:52
float xmin
Definition: THbookFile.cxx:93
float ymin
Definition: THbookFile.cxx:93
float xmax
Definition: THbookFile.cxx:93
float ymax
Definition: THbookFile.cxx:93
#define gROOT
Definition: TROOT.h:406
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
Definition: TStyle.h:410
#define gPad
Definition: TVirtualPad.h:287
#define gVirtualX
Definition: TVirtualX.h:338
#define snprintf
Definition: civetweb.c:1540
virtual Int_t GetNdivisions() const
Definition: TAttAxis.h:36
virtual void Modify()
Change current fill area attributes if necessary.
Definition: TAttFill.cxx:211
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition: TAttFill.h:37
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition: TAttFill.h:39
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
Definition: TAttFill.cxx:234
virtual Color_t GetLineColor() const
Return the line color.
Definition: TAttLine.h:33
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TAttLine.h:40
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
Definition: TAttLine.cxx:270
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition: TAttText.h:41
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition: TAttText.h:43
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition: TAttText.h:45
Class to manage histogram axis.
Definition: TAxis.h:30
virtual void SetRange(Int_t first=0, Int_t last=0)
Set the viewing range for the axis from bin first to last.
Definition: TAxis.cxx:914
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TBox.cxx:231
Double_t fX1
X of 1st point.
Definition: TBox.h:30
Double_t fY2
Y of 2nd point.
Definition: TBox.h:33
Double_t fX2
X of 2nd point.
Definition: TBox.h:32
Double_t fY1
Y of 1st point.
Definition: TBox.h:31
virtual void PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t &wmin, Double_t &wmax, Int_t &ndiv, Option_t *chopt="", Double_t gridlength=0, Bool_t drawGridOnly=kFALSE)
Control function to draw an axis.
Definition: TGaxis.cxx:954
Float_t GetLabelOffset() const
Definition: TGaxis.h:81
virtual void ImportAxisAttributes(TAxis *axis)
Internal method to import TAxis attributes to this TGaxis.
Definition: TGaxis.cxx:904
Int_t GetLabelFont() const
Definition: TGaxis.h:80
Float_t GetTitleOffset() const
Definition: TGaxis.h:83
Float_t GetTitleSize() const
Definition: TGaxis.h:84
Int_t GetLabelColor() const
Definition: TGaxis.h:79
Float_t GetTickSize() const
Definition: TGaxis.h:92
Float_t GetLabelSize() const
Definition: TGaxis.h:82
The TH1 histogram class.
Definition: TH1.h:56
TAxis * GetZaxis()
Definition: TH1.h:318
virtual Int_t GetDimension() const
Definition: TH1.h:278
@ kUserContour
user specified contour levels
Definition: TH1.h:161
@ kIsZoomed
bit set when zooming on Y axis
Definition: TH1.h:164
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
Definition: TH1.cxx:8006
virtual void SetMaximum(Double_t maximum=-1111)
Definition: TH1.h:394
virtual void SetMinimum(Double_t minimum=-1111)
Definition: TH1.h:395
virtual Int_t GetMaximumBin() const
Return location of bin with maximum value in the range.
Definition: TH1.cxx:8036
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH1.cxx:4907
virtual Double_t GetContourLevel(Int_t level) const
Return value of contour number level.
Definition: TH1.cxx:7894
virtual Int_t GetMinimumBin() const
Return location of bin with minimum value in the range.
Definition: TH1.cxx:8121
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
Definition: TH1.cxx:8091
virtual Int_t GetContour(Double_t *levels=0)
Return contour values into array levels if pointer levels is non zero.
Definition: TH1.cxx:7875
To draw Mathematical Formula.
Definition: TLatex.h:18
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Main drawing function.
Definition: TLatex.cxx:2050
A simple line.
Definition: TLine.h:23
virtual void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
Definition: TLine.cxx:384
TString fName
Definition: TNamed.h:32
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Mother of all ROOT objects.
Definition: TObject.h:37
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:187
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:128
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Definition: TObject.cxx:341
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:694
void ResetBit(UInt_t f)
Definition: TObject.h:186
The palette painting class.
Definition: TPaletteAxis.h:29
void Copy(TObject &palette) const
Copy a palette to a palette.
virtual ~TPaletteAxis()
Palette destructor.
TGaxis fAxis
Definition: TPaletteAxis.h:32
TPaletteAxis & operator=(const TPaletteAxis &)
Assignment operator.
TPaletteAxis()
Palette default constructor.
TString fName
pointer to parent histogram
Definition: TPaletteAxis.h:34
virtual void SetName(const char *name="")
Definition: TPaletteAxis.h:58
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Check if mouse on the axis region.
Int_t GetBinColor(Int_t i, Int_t j)
Returns the color index of the bin (i,j).
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Check if mouse on the axis region.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual void Paint(Option_t *option="")
Paint the palette.
virtual void UnZoom()
Unzoom the palette.
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Displays the z value corresponding to cursor position py.
Int_t GetValueColor(Double_t zc)
Returns the color index of the given z value.
A TBox with a bordersize and a shadow option.
Definition: TPave.h:19
virtual void ConvertNDCtoPad()
Convert pave coordinates from NDC to Pad coordinates.
Definition: TPave.cxx:139
Double_t fX2NDC
X2 point in NDC coordinates.
Definition: TPave.h:24
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a pave.
Definition: TPave.cxx:207
TString fOption
Pave style.
Definition: TPave.h:30
Double_t fY2NDC
Y2 point in NDC coordinates.
Definition: TPave.h:25
void Copy(TObject &pave) const
Copy this pave to pave.
Definition: TPave.cxx:185
Double_t fX1NDC
X1 point in NDC coordinates.
Definition: TPave.h:22
Double_t fY1NDC
Y1 point in NDC coordinates.
Definition: TPave.h:23
Basic string class.
Definition: TString.h:131
@ kIgnoreCase
Definition: TString.h:263
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:619
Int_t GetColorPalette(Int_t i) const
Return color number i in current palette.
Definition: TStyle.cxx:1056
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
Definition: TStyle.cxx:1122
See TView3D.
Definition: TView.h:25
TLine * line
Double_t y[n]
Definition: legend1.C:17
Double_t Exp(Double_t x)
Definition: TMath.h:717
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Definition: TMath.h:725
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:180
Double_t Log10(Double_t x)
Definition: TMath.h:754
Short_t Abs(Short_t d)
Definition: TMathBase.h:120
void ws()
Definition: ws.C:66