3
$\begingroup$

This question already has an answer here:

How to enlarge the closed curves of any Graph and Show them in a separate Graph within the same big Graph? You can use any Function to Plot such type of Graph.Just_like_the_following_Fig. <code>this_Fig</code>

$\endgroup$

marked as duplicate by user9660, RunnyKine, m_goldberg, Öskå, MarcoB May 1 '16 at 15:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 6
    $\begingroup$ Have you looked at how-to-insert-a-plot-into-another-plot? $\endgroup$ – Rashid Apr 30 '16 at 16:11
  • $\begingroup$ One of ways, p1 = Plot[x Sin[1/x], {x, -1/2, 1/2}, PlotStyle -> {Red}, ImageSize -> {500}, Frame -> True, Axes -> None] after that restrict the PlotRange -> {{-0.02, 0.02} as p2 = Plot[x Sin[1/x], {x, -1/2, 1/2}, PlotRange -> {{-0.02, 0.02}, {-0.02, 0.02}} , PlotStyle -> {Red}] copy the p2 (by single click on it) and then double click on the p1, and paste p2 on it (p1). $\endgroup$ – kamran Apr 30 '16 at 16:47
2
$\begingroup$
plot = 
  Plot[x Sin[1/x], {x, -1/2, 1/2}, 
    PlotStyle -> {Red}, 
    ImageSize -> {500}, 
    Frame -> True, 
    Axes -> None]

plot without inset

smallplot = 
  Plot[x Sin[1/x], {x, -1/10, 1/10}, 
    PlotRange -> {{-0.02, 0.02}, {-0.02, 0.02}} , 
    PlotStyle -> {Red},
    Frame -> True, 
    Axes -> None]

zoomed plot with smaller domain

Now you can combine these plot to make a final plot as follows

finalplot = 
  Plot[x Sin[1/x], {x, -1/2, 1/2}, 
    PlotStyle -> {Red},
    ImageSize -> {500}, 
    Frame -> True, 
    Axes -> None,
    Prolog ->Inset[smallplot, {0.0, .3}]]

Combined plot

I just showed how to combine two plots. You can play with plot and frame styles. To get "zoom-in' effect you need to plot the same function on a smaller domain, then combine them by using Prolog followed by Inset.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.