I would like to ask if it is possible to add a kind of "zoom" effect by using tikz ? More precisely : I am trying to reproduce a figure like this :
Thanks to another user : I am able to plot the two figures separately as I want. But then I want to do this kind of zooming effect to be more understood in my text.
\documentclass{article}
\usepackage{caption}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{accents}
%%%%%%%%SECTIONS/AGENCEMENT%%%
\usepackage{enumitem}
\usepackage{pgf, tikz, adjustbox}
\usetikzlibrary{patterns, matrix, positioning}
\usetikzlibrary{arrows.meta,
patterns.meta
}
\begin{document}
%%%%%%%%%%%%%FIGURE 4%%%%%%%%%%%%%%%
\begin{figure}[h]
\centering
\begin{tikzpicture}[
> = Straight Barb,
dot/.style = {circle, fill, inner sep=2.0pt, node contents={}},
every label/.append style = {label distance =2pt, inner sep=1pt, fill=white},
samples = 101,
domain = 0:10
]
% axis
\draw[-stealth] (-2.5, 0) -- (13, 0) node[right] {$\underline{e}_x$}; % x-axis
\draw[-stealth] (0, -0.5) -- ( 0,4.3) node[above] {$\underline{e}_z$}; % y-axis
\foreach \i in {-2,-1,0, ...,12}
\draw (\i, 1mm) -- ++ (0,-2mm);
% function
\draw[very thick, blue]
plot ({\x}, {(exp(1-(\x^2)/16)) + 1/2}) -- (10,1/2);
\path[pattern={Lines[angle=45,distance={3pt},
line width=0.2pt]},
pattern color=blue]
plot ({\x}, {(exp(1-(\x^2)/16)) + 1/2}) |- (0,0) ;
\node[right] at (2,1.2) {$V$};
% domain
\path (0,0) node[red,dot,label=below left:$0$] (0,3.2) node[dot,label=left:$h_0$] (10,0) node[red,dot,label=below:$L$];
\end{tikzpicture}
\caption{This is it}
\end{figure}
\begin{figure}[h]
\centering
\begin{tikzpicture}[
> = Straight Barb,
dot/.style = {circle, fill, inner sep=2.0pt, node contents={}},
every label/.append style = {label distance =2pt, inner sep=1pt, fill=white},
samples = 101,
domain = 0:10
]
% axis
\draw[-stealth] (-2.5, 0) -- (13, 0) node[right] {$\underline{e}_x$}; % x-axis
\draw[-stealth] (0, -0.5) -- ( 0,4.3) node[above] {$\underline{e}_z$}; % y-axis
\foreach \i in {-2,-1,0, ...,12}
\draw (\i, 1mm) -- ++ (0,-2mm);
% function
\draw[very thick, blue]
plot ({\x}, {2*exp(-\x/5) + 1/2}) -- (10,0.75);
\path[pattern={Lines[angle=45,distance={3pt},
line width=0.2pt]},
pattern color=blue]
plot ({\x}, {2*exp(-\x/5)+ 1/2}) |- (0,0) ;
\node[right] at (2,1.2) {$V$};
% domain
\path (0,0) node[red,dot,label=below left:$L$] (10,0) node[red,dot,label=below:$\infty$];
\end{tikzpicture}
\end{figure}
\end{document}