# How to set default marker style of TGraph when drawing on canvas?

**URL:** <https://root-forum.cern.ch/t/how-to-set-default-marker-style-of-tgraph-when-drawing-on-canvas/56631>\
**Category:** Newbie\
**Tags:** root\
**Created:** [October 6, 2023, 2:48pm UTC](https://root-forum.cern.ch/t/how-to-set-default-marker-style-of-tgraph-when-drawing-on-canvas/56631 "2023-10-06T14:48:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Youngju](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/youngju/32/24024_2.png) [@Youngju](https://root-forum.cern.ch/u/Youngju)\
**Post date:** [October 6, 2023, 2:48pm UTC](https://root-forum.cern.ch/t/how-to-set-default-marker-style-of-tgraph-when-drawing-on-canvas/56631/1 "2023-10-06T14:48:06Z")

</div>

Hello,

I want to change the default marker style of TGraph when drawing on the TCanvas.

I tried gStyle-\>SetMarkerStyle(3) before generating a canvas, but it didn’t work…

Is there some methods?

Cheers,  
Youngju

---

<div class="post-metadata">

**Author:** ![yus](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/9fc348/32.png) [@yus](https://root-forum.cern.ch/u/yus)\
**Post date:** [October 7, 2023, 9:17pm UTC](https://root-forum.cern.ch/t/how-to-set-default-marker-style-of-tgraph-when-drawing-on-canvas/56631/2 "2023-10-07T21:17:51Z")

</div>

Hi,

check this out: [SetMarker globally?](https://roottalk.root.cern.narkive.com/ANnuZxRF/setmarker-globally)

---

<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:** [October 10, 2023, 9:13am UTC](https://root-forum.cern.ch/t/how-to-set-default-marker-style-of-tgraph-when-drawing-on-canvas/56631/3 "2023-10-10T09:13:20Z")

</div>

Welcome to the ROOT forum.

```auto
void graph() {
   gStyle->SetMarkerStyle(kFullCircle);

   auto gr = new TGraph();
   for (int i=0; i<20; i++) gr->AddPoint(i*0.1, 10*sin(i*0.1+0.2));

   gr->Draw("ACP");
}

```

 ![Screenshot 2023-10-10 at 11.13.12](https://root-forum.cern.ch/uploads/default/original/3X/5/4/542f9f093639c2e17ee90bdd6d8e8ad819f30346.png)

---

<div class="post-metadata">

**Author:** ![Youngju](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/youngju/32/24024_2.png) [@Youngju](https://root-forum.cern.ch/u/Youngju)\
**Post date:** [October 11, 2023, 7:24am UTC](https://root-forum.cern.ch/t/how-to-set-default-marker-style-of-tgraph-when-drawing-on-canvas/56631/4 "2023-10-11T07:24:22Z")

</div>

Thanks for your help, but  
typing belows lines on the interpreter doesn’t change the markerstyle when I draw new graph using toolbar.  
gStyle-\>SetMarkerStyle(20);  
gStyle-\>SetMarkerSize(0.25);  
gROOT-\>ForceStyle();

---

<div class="post-metadata">

**Author:** ![Youngju](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/youngju/32/24024_2.png) [@Youngju](https://root-forum.cern.ch/u/Youngju)\
**Post date:** [October 11, 2023, 7:26am UTC](https://root-forum.cern.ch/t/how-to-set-default-marker-style-of-tgraph-when-drawing-on-canvas/56631/5 "2023-10-11T07:26:22Z")

</div>

Thanks for your help, but what I wanted was change the default marker style when I draw the graph using Toolbar (Click the mouse on the Canvas).

---

<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:** [October 11, 2023, 7:40am UTC](https://root-forum.cern.ch/t/how-to-set-default-marker-style-of-tgraph-when-drawing-on-canvas/56631/6 "2023-10-11T07:40:22Z")

</div>

Oh, I see ! The toolbar is just a toy graphics editor. There is no setting for that.
