0

Can you see the intersection point called T_{0,2}? From this graph, I'd like to draw only the zoomed part surrounding the intersection point T_{0,2}. How can I accomplish such a thing?

\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{intersections}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\pgfmathdeclarefunction{gauss}{2}{%
  \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%
}

\begin{document}

\begin{figure}
    \centering
    \scalebox{1.5}{
    \begin{tikzpicture}
        \begin{axis}[
            yticklabels=\empty, xticklabels=\empty,
            width=8cm,
            height=6cm,
            domain=-2:3, ymin = 0.07, xmin = -2, enlargelimits=upper,
            xtick=\empty, ytick=\empty,
            clip mode=individual,
            xlabel={$T_0$}, ylabel={$\Delta T$},
            ]
            \addplot[smooth,red,samples=50,domain=-2:3,name path=gaussian]{8 * gauss(1,0.75)};
            \addplot[smooth,blue,name path=line]{x*1.13 + 1.36};
            \fill 
                [name intersections={of=gaussian and line, name=i, total=\t}] 
                [red, opacity=1, every node/.style={above left, black, opacity=1}] 
                \foreach \s in {2,...,\t}{
                    (i-\s) circle (2pt)
                    node [above left] {}
                };
            \node[circle,draw=black!80,fill=yellow,scale=0.3,label=below:\scriptsize{$T_{C}$}] at (i-1|-0,0.07) {};
            \draw[dotted] (i-2)--(i-2|-0,0);
            \node[circle,draw=black!80,fill=yellow,scale=0.3,label=below:\scriptsize{$T_{0,1}$}] at (i-2|-0,0.07) {};
            \draw[dotted] (i-3)--(i-3|-0,0);
            \node[circle,draw=black!80,fill=yellow,scale=0.3,label=below:\scriptsize{$T_{0,2}$}] at (i-3|-0,0.07) {};

        \end{axis}
    \end{tikzpicture}
    }
\end{figure}

\end{document}
8
  • Sorry, I am not sure that I understand what you want to achieve. Which zoomed part do you mean exactly? How should the part be zoomed? Commented Nov 10, 2022 at 15:43
  • The area surrounding the intersection point T_ {0,2} Commented Nov 10, 2022 at 15:44
  • Yes, this is what you wrote already, but how do you want it to look like? Commented Nov 10, 2022 at 16:00
  • 1
    Do you mean automatically? Of course you can just manually set the domain to 1:2 and change the xmin/xmax/ymin/ymax accordingly. I don't think it can be automated because you first need to plot the curves before PGFplots can compute where the intersections are.
    – Marijn
    Commented Nov 10, 2022 at 16:55
  • 1
    Or are you interested in something like tex.stackexchange.com/questions/14432/…?
    – Marijn
    Commented Nov 10, 2022 at 16:55

0

Browse other questions tagged .