# Saved canvas is magnified in top left corner

**URL:** <https://root-forum.cern.ch/t/saved-canvas-is-magnified-in-top-left-corner/19444>\
**Category:** ROOT\
**Created:** [June 30, 2015, 9:39am UTC](https://root-forum.cern.ch/t/saved-canvas-is-magnified-in-top-left-corner/19444 "2015-06-30T09:39:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alkass](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@Alkass](https://root-forum.cern.ch/u/Alkass)\
**Post date:** [June 30, 2015, 9:39am UTC](https://root-forum.cern.ch/t/saved-canvas-is-magnified-in-top-left-corner/19444/1 "2015-06-30T09:39:22Z")

</div>

Hi

After filling a TCanvas,

```auto
TCanvas *c1= new TCanvas("c1","stacked hists",600,600);
c1->Divide(3,3);

          for (int i=0;i<CutN;i++){

          sprintf(tt,"%s%i","mutau/met_MT_",i);
          hmet_MT[i] = (TH2D*) file->Get(tt);
          c1->cd(i+1);hmet_MT[i]->Draw("colz");
}

	c1->Update();
        c1->SaveAs("met_MT_"+fileName+".png");

```

The problem is that the TCanvas is not saved properly

 ![](https://root-forum.cern.ch/uploads/default/original/2X/9/9c0bec2768ec1a4b01329f8b10b7e96a9a10c4d9.png)  

but while running the code, the canvas that pops up is split properly…  
thanks in advance

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [June 30, 2015, 9:42am UTC](https://root-forum.cern.ch/t/saved-canvas-is-magnified-in-top-left-corner/19444/2 "2015-06-30T09:42:02Z")

</div>

I think this is the same bug as reported here:

> [@Print / saveas png draws axis title twice with offset](https://root-forum.cern.ch/t/print-saveas-png-draws-axis-title-twice-with-offset/19142/7):
>
> I am able to reproduce this problem on my Ubuntu 14.04. It is related to two lines in the “rootlogon.C”: gStyle-\>SetCanvasDefH(RequestedH); gStyle-\>SetCanvasDefW(RequestedW); As soon as “RequestedH” and/or “RequestedW” exceed physical dimensions of my screen, I also get “spurious” contents in the “bottom” and/or “right” side in the “test1.png” file (but not in another saved pictures and not on the screen). I can clearly see that, when the “png\_double\_x\_axis\_title” macro starts, ROOT opens a…

---

<div class="post-metadata">

**Author:** ![Alkass](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@Alkass](https://root-forum.cern.ch/u/Alkass)\
**Post date:** [June 30, 2015, 9:48am UTC](https://root-forum.cern.ch/t/saved-canvas-is-magnified-in-top-left-corner/19444/3 "2015-06-30T09:48:37Z")

</div>

Ok, thanks

So, temporarily, what is working for me is to just execute my script with the “-b” flag as well ie

`
root -l script.C -b`

so in the silent mode actually my canvases are save in the dimensions and are filled properly if I open them afterwards.

Regards

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [September 14, 2017, 10:55am UTC](https://root-forum.cern.ch/t/saved-canvas-is-magnified-in-top-left-corner/19444/4 "2017-09-14T10:55:19Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> I think this is the same bug as reported here:  
> [Print / saveas png draws axis title twice with offset - #7 by Wile\_E\_Coyote](https://root-forum.cern.ch/t/print-saveas-png-draws-axis-title-twice-with-offset/19142/7)

As the problem Wile refer to has been fixed this one (according to him) might be fixed toot. Unfortunately I cannot try it because the macro posted at the top cannot be executed.
