# Saving the plot generated inside root macro

**URL:** <https://root-forum.cern.ch/t/saving-the-plot-generated-inside-root-macro/40916>\
**Category:** Newbie\
**Created:** [August 8, 2020, 11:35am UTC](https://root-forum.cern.ch/t/saving-the-plot-generated-inside-root-macro/40916 "2020-08-08T11:35:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liam\_hayden](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecccb3/32.png) [@Liam\_hayden](https://root-forum.cern.ch/u/Liam_hayden)\
**Post date:** [August 8, 2020, 11:35am UTC](https://root-forum.cern.ch/t/saving-the-plot-generated-inside-root-macro/40916/1 "2020-08-08T11:35:19Z")

</div>

Hi,  
So I have plotted a histogram. Now is there a command that can be given inside the macro which will allow me to save this in a folder in pdf format. ( I should be also able to set the path of the folder where I want to save this).

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [August 9, 2020, 6:42am UTC](https://root-forum.cern.ch/t/saving-the-plot-generated-inside-root-macro/40916/2 "2020-08-09T06:42:54Z")

</div>

> [@Saveas Pdf to a Specific directory](https://root-forum.cern.ch/t/saveas-pdf-to-a-specific-directory/28672):
>
> Hello, is there any way to save an histogram in pdf format to a specific directory ? I am using c-\> SaveAs(“clust\_hist.pdf”); which saves the histogram to the current directory, but I want to save it in different directory. can anyone guide me ? thanks

---

<div class="post-metadata">

**Author:** ![Liam\_hayden](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecccb3/32.png) [@Liam\_hayden](https://root-forum.cern.ch/u/Liam_hayden)\
**Post date:** [August 9, 2020, 9:58am UTC](https://root-forum.cern.ch/t/saving-the-plot-generated-inside-root-macro/40916/3 "2020-08-09T09:58:17Z")

</div>

Thanks a lot
