嗨,我需要一些帮助来定义此图中的标签(\bar{theta}、\underline{theta}、\bar{u}、\underline{u}、B、G)。我想要这样的东西:
它几乎完成了,正如你从我的代码中看到的那样:
\documentclass[a4paper,12pt]{article}
\begin{document}
\begin{center}
\begin{tikzpicture}
\begin{axis}[
scale = 1.2,
xmin = 0, xmax = 10,
ymin = 0, ymax = 10,
axis lines* = left,
xtick = {0}, ytick = \empty,
clip = false,
]
\addplot[color = blue, very thick] coordinates {(9,8.25) (0,6)};
\addplot[color = red, very thick] coordinates {(0,3) (6,11)};
\addplot[color = black, dashed, thick] coordinates {(0, 7.67) (6.5, 7.67) (6.5, 0)};
\addplot[color = black, dashed, thick] coordinates {(0, 3) (6.5, 3)};
\node [right] at (current axis.right of origin){$\zeta$};
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}
谢谢。
答案1
作为起点:
\documentclass[border=3.141592]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines = middle,
xlabel={$\zeta$},
x label style={anchor=west},
%
xmin = 0, xmax = 10,
ymin = 0, ymax = 10,
axis lines* = left,
xtick = {0}, xticklabel={$B$},
ytick = \empty,
clip = false,
no marks,
]
\addplot +[very thick] coordinates {(0,4) (9,8)} node[right] {$\underline{u}$};
\addplot +[very thick] coordinates {(0,3) (6,9)} node[right] {$\overline{u}$};
\draw[dashed] (-0.1,7) node[left] {$\overline{Q}$} -| (6.7,-0.1) node[below] {$G$};
\draw[dashed] (-0.1,3) node[left] {$\underline{Q}$} -| (6.7,-0.1);
\end{axis}
\end{tikzpicture}
\end{document}
已编辑(1):
现在所有标签都已更正。MWE 现在复制了您的草图。使用最新版本的 MiKTeX pgfplots
1.18 进行了测试(并且有效,结果如上所示)。
已编辑(2): 添加的是 x 轴标签(草图上未显示,但在 OP 代码片段中写得非常不寻常)。