Tick mark labels

lijowski@cosray2.wustl.edu
14 Sep 1998 14:38:01 -0000


Hello,

Below is a macro which illustrates the problem.
In the original plot 10^4 are hidden behind
the plots titles. In order to see I have to move
the plots title by hand to the right. In this
particular case I don't even see 4.

Regards,

Michal Lijowski

P.S. Fons and Rene, would be better for you if I hold my questions until
the mid-October?

------------------------------------------------------------------------
Michal Lijowski Washington University
Research Associate St. Louis, MO 63130-4899, USA
Department of Physics phone: 314-935-6285
Campus Box 1105 email: lijowski@cosray2.wustl.edu
------------------------------------------------------------------------

{
//Reset ROOT
gROOT->Reset();

gBenchmark->Start("test_ps_2a");

// Int_t type = 111;
Int_t type = 112;
// Int_t type = 113;

Int_t nentries = 6280;
Float_t xx[nentries], yy1[nentries], yy2[nentries];

xx[0] = -3.1415;
yy1[0] = sin(xx[0]) * 1.0E+06 + 1.0E+08;
yy2[0] = cos(xx[0]) * 1.0E+06 + 1.0E+08;
for (Int_t ii = 1; ii < nentries; ii++) {
xx[ii] = xx[ii - 1] + 0.001;
yy1[ii] = sin(xx[ii]) * 1.0E+06 + 1.0E+08;
yy2[ii] = cos(xx[ii]) * 1.0E+06 + 1.0E+08;
}

Float_t xmin[4] = {0.02, 0.52, 0.02, 0.52};
Float_t xmax[4] = {0.48, 0.98, 0.48, 0.98};
Float_t ymin[4] = {0.52, 0.52, 0.02, 0.02};
Float_t ymax[4] = {0.98, 0.98, 0.48, 0.48};
TPad *pad[4];

TPostScript ps("test_ps_2a.ps", type);
ps.Range(26, 18);

Int_t nplots = 4;
char ctitle[10], gtitle[80], htitle[80] = "My plot";

c1 = new TCanvas("c1", htitle, 800, 600);

for (ii = 0; ii < nplots; ii++) {
Int_t ll = fmod(ii, 4);
printf(" ll = %3d\n", ll);
if (ll == 0) {
ps -> NewPage();
c1 = new TCanvas("c1", htitle, 800, 600);
printf(" ll = %d\n", ll);
for (Int_t jj = 0; jj < 4; jj++) {
pad[jj] = new TPad("pad", "This is pad", xmin[jj], ymin[jj], xmax[jj], ymax[jj], 0);
pad[jj] -> Draw();
}
}

pad[ll] -> cd();
if (fmod(ii, 2) == 0) {
gr = new TGraph(nentries, xx, yy1);
gr ->SetFillColor(0);
gr ->SetLineColor(7);
gr ->SetLineWidth(2);
sprintf(gtitle, "Sine function Pad %d", ii);
gr ->SetTitle(gtitle);
}
else {
gr = new TGraph(nentries, xx, yy2);
gr ->SetFillColor(0);
gr ->SetLineColor(12);
gr ->SetLineWidth(3);
sprintf(gtitle, "Cosine function Pad %d", ii);
gr ->SetTitle(gtitle);
}

gr->Draw("AL");
if (ll == 3 || ii == nplots - 1) {
c1.Update();
}
}

ps.Close();
gBenchmark->Show("test_ps_2a");
}