添加数轴

添加数轴
\begin{figure} 
\centering
\begin{tikzpicture}

 \draw[>=latex, ->] (-1,0) -- (7,0) node[right] {$E$};
  \draw[>=latex, ->] (0,-1) -- (0,7) node[above] {$V$};

\draw[dashed] (-1, 6) parabola bend (3,1) (6,5);

\end{tikzpicture}
\caption{\textit{V} and \textit{E} along a critical line  }
\end{figure}

一旦我设计了抛物线,我如何添加标签 V1、V5 和 E1...E5 以及图中所示的相对直线在此处输入图片描述

答案1

这里有两种可能性。一种是使用parabola bendintersections,另一种是使用实抛物线(函数)。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{figure} 
\centering
\begin{tikzpicture}
 \draw[-latex] (-1,0) -- (7,0) node[right] {$E$};
 \draw[-latex] (0,-1) -- (0,7) node[above] {$V$};
 \draw[dashed,name path=parabola] (-1, 6) parabola bend (3,1) (6,5);
 \foreach [count=\Y starting from 0] \X in {4,4.4,4.8,5.4}
 {\path[name path=v-\Y] (\X,0) -- ++ (0,7);
 \draw[thin,name intersections={of=parabola and v-\Y,by=i-\Y}]
 (\X,0) node[below]{$E_{\Y}$} -- (i-\Y) -- (0,0 |- i-\Y) node[left]{$V_{\Y}$}; }
\end{tikzpicture}
\caption{$V$ and $E$ along a critical line using intersections.}
\end{figure}

\begin{figure}
\centering
\begin{tikzpicture}[declare function={f(\x)=0.3*(\x-3)*(\x-3)+1;}]
 \draw[-latex] (-1,0) -- (7,0) node[right] {$E$};
 \draw[-latex] (0,-1) -- (0,7) node[above] {$V$};
 \draw[dashed] plot[domain=-1:6,samples=36] ({\x},{f(\x)});
 \foreach [count=\Y starting from 0] \X in {4,4.4,4.8,5.4}
 {
 \draw[thin]
 (\X,0) node[below]{$E_{\Y}$} -- (\X,{f(\X)}) -- (0,{f(\X)})node[left]{$V_{\Y}$}; }
\end{tikzpicture}
\caption{$V$ and $E$ along a critical line using a function.}
\end{figure}
\end{document}

在此处输入图片描述

相关内容