# Not able to save plots generated from the macro

**URL:** <https://root-forum.cern.ch/t/not-able-to-save-plots-generated-from-the-macro/35019>\
**Category:** Newbie\
**Created:** [July 5, 2019, 8:58pm UTC](https://root-forum.cern.ch/t/not-able-to-save-plots-generated-from-the-macro/35019 "2019-07-05T20:58:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahina](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/shahina/32/19464_2.png) [@shahina](https://root-forum.cern.ch/u/shahina)\
**Post date:** [July 5, 2019, 8:58pm UTC](https://root-forum.cern.ch/t/not-able-to-save-plots-generated-from-the-macro/35019/1 "2019-07-05T20:58:15Z")

</div>

Hi all,

I am using the following macro to generate some plots. While I run this macro the plots appear in the terminal but they are not saved.  
I want to save the plots in the directory that I have created, but I get the following error.

 ![Screenshot%20(12)](https://root-forum.cern.ch/uploads/default/original/3X/5/b/5b828a98f7caeeec58b47f2deab8ca25f7dcef20.jpeg)  
Can you help me with this?

Here is the macro:

[mg25Yields.C](https://root-forum.cern.ch/uploads/short-url/omDaGMEKM0CywKryhb94rolQlq0.C) (11.5 KB)

Here is the link to the root files which is inside the folder runs.  
[https://drive.google.com/open?id=1tG0b4TwpZ7OG86E1O3H8ROjF3VuXiXhg](https://drive.google.com/open?id=1tG0b4TwpZ7OG86E1O3H8ROjF3VuXiXhg)

---

<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 5, 2019, 9:02pm UTC](https://root-forum.cern.ch/t/not-able-to-save-plots-generated-from-the-macro/35019/2 "2019-07-05T21:02:00Z")

</div>

`"mkdir -p Yields/..."`

---

<div class="post-metadata">

**Author:** ![shahina](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/shahina/32/19464_2.png) [@shahina](https://root-forum.cern.ch/u/shahina)\
**Post date:** [July 5, 2019, 9:11pm UTC](https://root-forum.cern.ch/t/not-able-to-save-plots-generated-from-the-macro/35019/3 "2019-07-05T21:11:14Z")

</div>

Getting this error now.

 ![Screenshot%20(13)](https://root-forum.cern.ch/uploads/default/original/3X/d/2/d291c1167cb371db54936bc71031c23e2735f267.jpeg)  
 ![Screenshot%20(14)](https://root-forum.cern.ch/uploads/default/original/3X/0/e/0edfed9dace9fcb90948e7ac2f83f1b9865c4285.jpeg)

---

<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 6, 2019, 9:40am UTC](https://root-forum.cern.ch/t/not-able-to-save-plots-generated-from-the-macro/35019/4 "2019-07-06T09:40:13Z")

</div>

Try to replace all `Form(...)` calls with `TString:Format(...)` calls.
