# Saving histograms into a pdf / png format directly from ROOT

**URL:** <https://root-forum.cern.ch/t/saving-histograms-into-a-pdf-png-format-directly-from-root/51131>\
**Category:** ROOT\
**Tags:** python, hist, root\
**Created:** [August 10, 2022, 10:19am UTC](https://root-forum.cern.ch/t/saving-histograms-into-a-pdf-png-format-directly-from-root/51131 "2022-08-10T10:19:19Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [August 11, 2022, 3:42pm UTC](https://root-forum.cern.ch/t/saving-histograms-into-a-pdf-png-format-directly-from-root/51131/19 "2022-08-11T15:42:59Z")

</div>

Aren’t you missing the leading slash when you define `dir`?

Try this:

` dir = "/eos/home/tcarnaha/UL_2018/ ROOT.TFile(dir+"fits_data/muon/generalTracks/Z/Run2018_UL/AltBkg/NUM_LooseID_DEN_genTracks/NUM_LooseID_DEN_genTracks_abseta_1_pt_2.root")`

Does that work?

For `getall` to work, take a look at [Loop over all objects in a ROOT file](https://root-forum.cern.ch/t/loop-over-all-objects-in-a-root-file/10807)

---

_[View the full topic](https://root-forum.cern.ch/t/saving-histograms-into-a-pdf-png-format-directly-from-root/51131)._
