Paper margins for postscript-files

Dear Rooters!

I would like to change the size of the unprinted margins of a ps-file.

So, what I have done is:

``````TCanvas *c = new TCanvas("c","c",830,1100);

//draw histos into Canvas
//...

c->Print("myPsFile.ps","Portrait");``````

It seems that, whatever the size and dimensions of the Canvas are, Print() always rescales the content to fit onto a sheet of paper, such that the size of the margins left blank is always the same.

How do I change those margins?

Tobias Nebel

you can change the canvas margins:

``````{
TCanvas *c = new TCanvas("c","c",830,1100);
c->SetTopMargin(0.4589552);
TF1 fun1("sin(x)","sin(x)",0,6.28);
fun1.Draw("L");
gStyle->SetFrameBorderMode(0);
gStyle->SetCanvasColor(0);
}
``````

Hi!
It only helps to some extend:
The code

[code]{
TCanvas *c = new TCanvas(“c”,“c”,830,1100);
c->SetTopMargin(0);
c->SetBottomMargin(0);
c->SetLeftMargin(0);
c->SetRightMargin(0);

TF1 fun1(“sin(x)”,“sin(x)”,0,6.28);
fun1.Draw(“L”);
gStyle->SetFrameBorderMode(0);
gStyle->SetCanvasColor(0);
c->Print(“myPsFile.ps”,“Portrait”);
}
[/code]

produces the attached ps-file.
But how can I access the remaining top margin (which is still quite big) and make it smaller?

Thanks!!

Tobias
myPsFile.ps (8.77 KB)

You cannot, there is always a margin around the paper. The minimum margin you will get is when the canvas is in the A4 proportion (or letter depending the paper you are using).

Try also to produce EPS instead of PS. EPS has no paper margins.