# How to add a zoomed-in inset to a histogram on a canvas?

**URL:** <https://root-forum.cern.ch/t/how-to-add-a-zoomed-in-inset-to-a-histogram-on-a-canvas/46356>\
**Category:** Newbie\
**Created:** [August 19, 2021, 6:49pm UTC](https://root-forum.cern.ch/t/how-to-add-a-zoomed-in-inset-to-a-histogram-on-a-canvas/46356 "2021-08-19T18:49:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eggsAndCoffee](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@eggsAndCoffee](https://root-forum.cern.ch/u/eggsAndCoffee)\
**Post date:** [August 19, 2021, 6:49pm UTC](https://root-forum.cern.ch/t/how-to-add-a-zoomed-in-inset-to-a-histogram-on-a-canvas/46356/1 "2021-08-19T18:49:38Z")

</div>

Hello,

I have several root files that each contain a single TCanvas, and each TCanvas contains a single TH1D histogram. I would like to somehow add an inset image to the canvas that shows a zoomed-in region of a subset of the histogram, and then save that new canvas (original histogram + inset) as an eps figure. I cannot figure out how to do this though. Has anyone done this previously?

Thank you.

---

<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 20, 2021, 1:56am UTC](https://root-forum.cern.ch/t/how-to-add-a-zoomed-in-inset-to-a-histogram-on-a-canvas/46356/2 "2021-08-20T01:56:41Z")

</div>

> [@Inset for same plot (histogram + TGraph)](https://root-forum.cern.ch/t/inset-for-same-plot-histogram-tgraph/31213):
>
> Dear ROOT experts, I superimposed a stack of histograms and a TGraph on the same plot with two different vertical axes. Now I want to zoom in into a particular x axis range and place it as an inset figure. I have seen many examples of an inset which is different from the actual main plot but none with the same situation as mine. How can I create an inset of the same plot but zoomed into a certain x axis range? Thank you, Amin \_ROOT Version: 6.08/06 \_Platform: Ubuntu 16.04 Compiler: Not P…
