| 1 |
// @(#)root/graf:$Name: $:$Id: TMultiGraph.cxx,v 1.2 2000/12/13 15:13:50 brun Exp $ |
// @(#)root/graf:$Name: $:$Id: TMultiGraph.cxx,v 1.3 2001/01/30 15:41:17 brun Exp $ |
| 2 |
// Author: Rene Brun 12/10/2000 |
// Author: Rene Brun 12/10/2000 |
| 3 |
|
|
| 4 |
/************************************************************************* |
/************************************************************************* |
| 171 |
for (i=0;i<nch;i++) chopt[i] = toupper(option[i]); |
for (i=0;i<nch;i++) chopt[i] = toupper(option[i]); |
| 172 |
chopt[nch] = 0; |
chopt[nch] = 0; |
| 173 |
Double_t *x, *y; |
Double_t *x, *y; |
| 174 |
|
TGraph *g; |
| 175 |
|
|
| 176 |
l = strstr(chopt,"A"); |
l = strstr(chopt,"A"); |
| 177 |
if (l) { |
if (l) { |
| 178 |
*l = ' '; |
*l = ' '; |
|
TGraph *g; |
|
| 179 |
TIter next(fGraphs); |
TIter next(fGraphs); |
| 180 |
Int_t npt = 100; |
Int_t npt = 100; |
| 181 |
Double_t maximum, minimum, rwxmin, rwxmax, rwymin, rwymax, uxmin, uxmax, dx, dy; |
Double_t maximum, minimum, rwxmin, rwxmax, rwymin, rwymax, uxmin, uxmax, dx, dy; |
|
if (fHistogram) { |
|
| 182 |
rwxmin = gPad->GetUxmin(); |
rwxmin = gPad->GetUxmin(); |
| 183 |
rwxmax = gPad->GetUxmax(); |
rwxmax = gPad->GetUxmax(); |
| 184 |
rwymin = gPad->GetUymin(); |
rwymin = gPad->GetUymin(); |
| 185 |
rwymax = gPad->GetUymax(); |
rwymax = gPad->GetUymax(); |
| 186 |
minimum = fHistogram->GetMinimumStored(); |
if (fHistogram) { |
| 187 |
maximum = fHistogram->GetMaximumStored(); |
//cleanup in case of a previous unzoom |
| 188 |
if (minimum == -1111) minimum = fHistogram->GetYaxis()->GetXmin(); |
if (fHistogram->GetMinimum() >= fHistogram->GetMaximum()) { |
| 189 |
if (maximum == -1111) maximum = fHistogram->GetYaxis()->GetXmax(); |
delete fHistogram; |
| 190 |
|
fHistogram = 0; |
| 191 |
|
} |
| 192 |
|
} |
| 193 |
|
if (fHistogram) { |
| 194 |
|
minimum = fHistogram->GetYaxis()->GetXmin(); |
| 195 |
|
maximum = fHistogram->GetYaxis()->GetXmax(); |
| 196 |
uxmin = gPad->PadtoX(rwxmin); |
uxmin = gPad->PadtoX(rwxmin); |
| 197 |
uxmax = gPad->PadtoX(rwxmax); |
uxmax = gPad->PadtoX(rwxmax); |
| 198 |
} else { |
} else { |
| 215 |
} |
} |
| 216 |
if (rwxmin == rwxmax) rwxmax += 1.; |
if (rwxmin == rwxmax) rwxmax += 1.; |
| 217 |
if (rwymin == rwymax) rwymax += 1.; |
if (rwymin == rwymax) rwymax += 1.; |
| 218 |
dx = 0.1*(rwxmax-rwxmin); |
dx = 0.05*(rwxmax-rwxmin); |
| 219 |
dy = 0.1*(rwymax-rwymin); |
dy = 0.05*(rwymax-rwymin); |
| 220 |
uxmin = rwxmin - dx; |
uxmin = rwxmin - dx; |
| 221 |
uxmax = rwxmax + dx; |
uxmax = rwxmax + dx; |
| 222 |
minimum = rwymin - dy; |
minimum = rwymin - dy; |
| 227 |
if (fMaximum != -1111) rwymax = maximum = fMaximum; |
if (fMaximum != -1111) rwymax = maximum = fMaximum; |
| 228 |
if (uxmin < 0 && rwxmin >= 0) { |
if (uxmin < 0 && rwxmin >= 0) { |
| 229 |
if (gPad->GetLogx()) uxmin = 0.9*rwxmin; |
if (gPad->GetLogx()) uxmin = 0.9*rwxmin; |
| 230 |
else uxmin = 0; |
//else uxmin = 0; |
| 231 |
} |
} |
| 232 |
if (uxmax > 0 && rwxmax <= 0) { |
if (uxmax > 0 && rwxmax <= 0) { |
| 233 |
if (gPad->GetLogx()) uxmax = 1.1*rwxmax; |
if (gPad->GetLogx()) uxmax = 1.1*rwxmax; |
| 234 |
else uxmax = 0; |
//else uxmax = 0; |
| 235 |
} |
} |
| 236 |
if (minimum < 0 && rwymin >= 0) { |
if (minimum < 0 && rwymin >= 0) { |
| 237 |
if(gPad->GetLogy()) minimum = 0.9*rwymin; |
if(gPad->GetLogy()) minimum = 0.9*rwymin; |
| 238 |
else minimum = 0; |
//else minimum = 0; |
| 239 |
} |
} |
| 240 |
if (maximum > 0 && rwymax <= 0) { |
if (maximum > 0 && rwymax <= 0) { |
| 241 |
if(gPad->GetLogy()) maximum = 1.1*rwymax; |
if(gPad->GetLogy()) maximum = 1.1*rwymax; |
| 242 |
else maximum = 0; |
//else maximum = 0; |
| 243 |
} |
} |
| 244 |
if (minimum <= 0 && gPad->GetLogy()) minimum = 0.001*maximum; |
if (minimum <= 0 && gPad->GetLogy()) minimum = 0.001*maximum; |
| 245 |
if (uxmin <= 0 && gPad->GetLogx()) { |
if (uxmin <= 0 && gPad->GetLogx()) { |
| 249 |
rwymin = minimum; |
rwymin = minimum; |
| 250 |
rwymax = maximum; |
rwymax = maximum; |
| 251 |
if (fHistogram) { |
if (fHistogram) { |
| 252 |
fHistogram->SetMinimum(rwymin); |
fHistogram->GetYaxis()->SetLimits(rwymin,rwymax); |
|
fHistogram->SetMaximum(rwymax); |
|
| 253 |
} |
} |
| 254 |
|
|
| 255 |
//*-*- Create a temporary histogram to draw the axis |
//*-*- Create a temporary histogram to draw the axis |
| 269 |
fHistogram->Paint(); |
fHistogram->Paint(); |
| 270 |
} |
} |
| 271 |
|
|
|
TGraph *g; |
|
| 272 |
if (fGraphs) { |
if (fGraphs) { |
| 273 |
TIter next(fGraphs); |
TIter next(fGraphs); |
| 274 |
while ((g = (TGraph*) next())) { |
while ((g = (TGraph*) next())) { |