# How to set the DrawOption for y Projection using the SetShowProjectionY for a TH2D Histogram

**URL:** <https://root-forum.cern.ch/t/how-to-set-the-drawoption-for-y-projection-using-the-setshowprojectiony-for-a-th2d-histogram/64060>\
**Category:** Newbie\
**Tags:** hist, root\
**Created:** [August 21, 2025, 10:54am UTC](https://root-forum.cern.ch/t/how-to-set-the-drawoption-for-y-projection-using-the-setshowprojectiony-for-a-th2d-histogram/64060 "2025-08-21T10:54:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidK](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@DavidK](https://root-forum.cern.ch/u/DavidK)\
**Post date:** [August 21, 2025, 10:54am UTC](https://root-forum.cern.ch/t/how-to-set-the-drawoption-for-y-projection-using-the-setshowprojectiony-for-a-th2d-histogram/64060/1 "2025-08-21T10:54:42Z")

</div>

I’m using TBrowser to show a TH2D histogram in a root file. I need to make multiple projections to the y-Axis. These Projections always use the “HISTO” draw option but I need to show the error bars. Tabbing into the projection and manually setting the DrawOption for each slice is very tiresome. Setting the “Draw Option” in the TBrowser GUI shows the TH2D in error bar style which breaks the projection. My two questions are:

1. How do I set the default draw option for projections of a TH2D?
2. How do I do these projections in my code to be saved to a root file?

* * *

_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

_ROOT Version:_ ROOT 6.36.02  
_Platform:_ Linux  
_Compiler:_ gcc

* * *

---

<div class="post-metadata">

**Author:** ![devajith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/devajith/32/37165_2.png) [@devajith](https://root-forum.cern.ch/u/devajith)\
**Post date:** [August 21, 2025, 12:06pm UTC](https://root-forum.cern.ch/t/how-to-set-the-drawoption-for-y-projection-using-the-setshowprojectiony-for-a-th2d-histogram/64060/2 "2025-08-21T12:06:52Z")

</div>

Hi @DavidK,

Maybe @linev can help you here.

Cheers,

Dev

---

<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:** [August 21, 2025, 1:27pm UTC](https://root-forum.cern.ch/t/how-to-set-the-drawoption-for-y-projection-using-the-setshowprojectiony-for-a-th2d-histogram/64060/3 "2025-08-21T13:27:00Z")

</div>

May be you can use a script instead of using the browser. It might be easier as it seems you are doing some repetitive operations.
