# Set TCanvas size in batch mode

**URL:** <https://root-forum.cern.ch/t/set-tcanvas-size-in-batch-mode/6626>\
**Category:** ROOT\
**Created:** [June 3, 2008, 8:10pm UTC](https://root-forum.cern.ch/t/set-tcanvas-size-in-batch-mode/6626 "2008-06-03T20:10:37Z")\
**Posts on this page:** 1\
**Showing post:** 17

<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:** [February 3, 2026, 12:52pm UTC](https://root-forum.cern.ch/t/set-tcanvas-size-in-batch-mode/6626/17 "2026-02-03T12:52:54Z")

</div>

BTW. This magic statement sequence is expected always to [set the correct canvas size (i.e., in any mode, interactive or batch)](https://root-forum.cern.ch/t/tcanvas-setwindowsize-extension-proposal/26226):

`c->SetWindowSize(w, h); c->SetWindowSize(w + (w - c->GetWw()), h + (h - c->GetWh()));`

---

_[View the full topic](https://root-forum.cern.ch/t/set-tcanvas-size-in-batch-mode/6626)._
