26 TAxis* paxold = ph->GetXaxis();
28 ticksize = paxold->GetTickLength();
29 ndiv = paxold->GetNdivisions();
42 if ( gPad == 0 )
return 3;
44 gPad->GetRangeAxis(xmin, ymin, xmax, ymax);
45 double xax1 = gPad->GetUxmin();
46 double xax2 = gPad->GetUxmax();
47 double yax = gPad->GetUymax();
49 if ( gPad->GetLogx() ) {
50 xax1 =
pow(10.0, xax1);
51 xax2 =
pow(10.0, xax2);
52 xmin =
pow(10.0, xmin);
53 xmax =
pow(10.0, xmax);
56 if ( gPad->GetLogy() ) {
59 TGaxis* paxnew =
new TGaxis(xax1, yax, xax2, yax,
60 xmin, xmax, 510, sopt.c_str());
61 if ( ticksize > 0 ) paxnew->SetTickSize(ticksize);
62 if ( ndiv > 0 ) paxnew->SetNdivisions(ndiv);
63 string name =
"TopAxis";
64 paxnew->SetName(name.c_str());
65 TList* pobjs = gPad->GetListOfPrimitives();
66 for (
int iobj=0; iobj<pobjs->GetEntries(); ++iobj ) {
67 TGaxis* paxold =
dynamic_cast<TGaxis*
>(pobjs->At(iobj));
70 if ( paxold->GetName() ==
name ) {
71 pobjs->RemoveAt(iobj);
86 TAxis* paxold = ph->GetYaxis();
88 ticksize = paxold->GetTickLength();
89 ndiv = paxold->GetNdivisions();
102 if ( gPad == 0 )
return 3;
104 gPad->GetRangeAxis(xmin, ymin, xmax, ymax);
105 double xax = gPad->GetUxmax();
106 double yax1 = gPad->GetUymin();
107 double yax2 = gPad->GetUymax();
109 if ( gPad->GetLogx() ) {
110 xax =
pow(10.0, xax);
112 if ( gPad->GetLogy() ) {
113 yax1 =
pow(10.0, yax1);
114 yax2 =
pow(10.0, yax2);
115 ymin =
pow(10.0, ymin);
116 ymax =
pow(10.0, ymax);
119 if ( gPad->GetLogy() ) sopt +=
"G";
120 TGaxis* paxnew =
new TGaxis(xax, yax1, xax, yax2,
121 ymin, ymax, 510, sopt.c_str());
122 if ( ticksize > 0 ) paxnew->SetTickLength(ticksize);
123 if ( ndiv > 0 ) paxnew->SetNdivisions(ndiv);
124 string name =
"RightAxis";
125 paxnew->SetName(name.c_str());
126 TList* pobjs = gPad->GetListOfPrimitives();
127 for (
int iobj=0; iobj<pobjs->GetEntries(); ++iobj ) {
128 TGaxis* paxold =
dynamic_cast<TGaxis*
>(pobjs->At(iobj));
130 if ( paxold->GetName() ==
name ) {
131 pobjs->RemoveAt(iobj);
143 if ( gPad ==
nullptr )
return 1;
144 if ( gStyle ==
nullptr )
return 2;
145 gPad->SetFrameFillColor(gStyle->GetColorPalette(0));
static int addaxistop(TH1 *ph=0)
static int fixFrameFillColor()
static int addaxis(TH1 *ph=0)
static int addaxisright(TH1 *ph=0)