# Removing Initial C1 Canvas

**URL:** <https://root-forum.cern.ch/t/removing-initial-c1-canvas/34970>\
**Category:** Newbie\
**Tags:** hist\
**Created:** [July 2, 2019, 9:37pm UTC](https://root-forum.cern.ch/t/removing-initial-c1-canvas/34970 "2019-07-02T21:37:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmcfadde](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/a587f6/32.png) [@nmcfadde](https://root-forum.cern.ch/u/nmcfadde)\
**Post date:** [July 2, 2019, 9:37pm UTC](https://root-forum.cern.ch/t/removing-initial-c1-canvas/34970/1 "2019-07-02T21:37:36Z")

</div>

Hi,

I am drawing a histogram on a canvas I created:  
hTripletChargeWeighted-\>Fit(“SingleExpoPlusConstant”,"","",startFit,stopFit);  
TCanvas \* cTripletFit = new TCanvas(“Triplet Fit”,“Triplet Fit”);  
cTripletFit-\>cd();  
hTripletChargeWeighted-\>Draw();

It draws the histogram on the canvas just fine, but it first draws the same histogram on a canvas called “c1”. I guess this is the default canvas? My question is this: How do I get rid of this default canvas “c1” when I want to draw my histogram on my own custom canvas?

---

<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:** [July 2, 2019, 10:06pm UTC](https://root-forum.cern.ch/t/removing-initial-c1-canvas/34970/2 "2019-07-02T22:06:33Z")

</div>

Replace the “Draw” line with the “Fit” line.

---

<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:** [July 3, 2019, 8:18am UTC](https://root-forum.cern.ch/t/removing-initial-c1-canvas/34970/3 "2019-07-03T08:18:50Z")

</div>

See also:  
[https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292/2](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292/2)

---

<div class="post-metadata">

**Author:** ![nmcfadde](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/a587f6/32.png) [@nmcfadde](https://root-forum.cern.ch/u/nmcfadde)\
**Post date:** [July 3, 2019, 2:47pm UTC](https://root-forum.cern.ch/t/removing-initial-c1-canvas/34970/4 "2019-07-03T14:47:20Z")

</div>

Thank you for the advice, it seems to have worked.
