0

I plot a function with PlotRange -> All called pl1 and again plot the same but this time with PlotRange -> a finite number called pl2. Now I want to show pl1 in large size and pl2 inside it (exactly in top right of it or any arbitrary position) with a small size. A toy example can be

pl1 = Plot[Exp[x], {x, 0, 10}, PlotRange -> All]
pl2 = Plot[Exp[x], {x, 0, 10}, PlotRange -> 50]

How can I do it? I can use GraphicsGrid but I have no idea how to change the size and position of two graphics? BaselinePosition is useless without changing the sizes.

Note that in reality, I have plotted several functions in a single plot and I need to see the points where these functions intersect in a magnified plot (pl2).

Wisdom
  • 1,258
  • 7
  • 13
  • 1
    Plot[Exp[x], {x, 0, 10}, PlotRange -> All, Epilog -> Inset[ Plot[Exp[x], {x, 0, 4}, PlotRange -> {0, 50}], Scaled[{.4, .6}]]] – Bob Hanlon Jan 21 '22 at 14:55

1 Answers1

1
pl1 = Plot[Exp[x], {x, 0, 10}, PlotRange -> All]
pl2 = Plot[Exp[x], {x, 0, 5}
  , GridLines -> Automatic
  , PlotRange -> 50
  , Background -> Nest[Lighter, Yellow, 3]]

pl3 = Plot[Exp[x]
  , {x, 0, 10}
  , PlotRange -> All
  , GridLines -> Automatic
  , Epilog -> {Inset[pl2, {2, 10000}, {0, 0}]}
  ]

Here (0,0) of the inset plot is aligned with (2,10000) in the main plot.

enter image description here

Syed
  • 52,495
  • 4
  • 30
  • 85