title: Zooming a portion of figure in a figure-Matlab
body: <p>I have a scatter plot with logarithmic axes and I want to add a small figure on the original figure which zooms on a specific part of the plot. Something like this :
  <a href="https://i.stack.imgur.com/q9Qox.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q9Qox.png" alt="enter image description here"></a></p>
  
  <p>but for a specific part of this code on this graph:</p>
  
  <pre><code>X2=rand(1,100);
  Y2=rand(1,100);
  p2=rand(1,100);
  W_esc_half=rand(1,100);
  scatter(X2,Y2)
  hold on; 
  plot(W_esc_half,p2,'r','LineWidth',2)
  
  
  
    set(gca, 'xScale', 'log')
      set(gca, 'YScale', 'linear')
  </code></pre>