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}

user3713179
  • 635
  • 2
  • 11
  • 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? – Jasper Habicht Nov 10 '22 at 15:43
  • The area surrounding the intersection point T_ {0,2} – user3713179 Nov 10 '22 at 15:44
  • Yes, this is what you wrote already, but how do you want it to look like? – Jasper Habicht Nov 10 '22 at 16:00
  • Make sure the x domain is reduced to an intersection point environment. e.g. the intersection point has absissa x = 1: I'd like to reduce the x domain to (-0.5,0.5) – user3713179 Nov 10 '22 at 16:47
  • 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 Nov 10 '22 at 16:55
  • 1
    Or are you interested in something like https://tex.stackexchange.com/questions/14432/tikz-spy-library-with-pgfplots-opacity-and-grid? – Marijn Nov 10 '22 at 16:55
  • Yes, exactly! Something like this – user3713179 Nov 10 '22 at 16:57
  • I copy-pasted the code from the linked question into your plot and I got https://i.stack.imgur.com/uATxi.png, I'm not sure that is actually very useful in terms of presenting the intersection more clearly... – Marijn Nov 10 '22 at 17:04

0 Answers0