我如何创建水上三级跳远图形 - pgfplot?

我如何创建水上三级跳远图形 - pgfplot?

我怎样才能创建像图片中那样的水上三级跳远图形 在此处输入图片描述

\documentclass[border=3mm]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
  axis lines=left,
  xtick=\empty,
  ytick=\empty,
  enlargelimits=true,
  name=myAxis,
  clip=false,
    xlabel=$ T $,
    ylabel=$ P $,
  xlabel style={at=(ticklabel cs:1)},
  ylabel style={at=(ticklabel cs:1),rotate=-90}]



\end{axis}
\end{tikzpicture}
\end{document}

答案1

所以这只是一个起点,但几乎所有必要的成分都在pgfplots手册中很好地解释过了。

在此处输入图片描述

\documentclass[border=3mm]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{intersections}
\usepgfplotslibrary{fillbetween}

\pgfplotsset{compat=1.13}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
  axis lines=left,
  xtick={0.5},
  xticklabels={273.16 K},
  ytick=\empty,
  name=myAxis,
  clip=false,
  xlabel=$ T $,
  ylabel=$ P $,
  xlabel style={at=(ticklabel cs:1)},
  ylabel style={at=(ticklabel cs:1),rotate=-90}
  ]

\addplot[name path=lower] coordinates{(0.0,0.5) (0.5,0.5) (0.5,0.0)};

\path[name path=bottom]
(\pgfkeysvalueof{/pgfplots/xmin},0) --
(\pgfkeysvalueof{/pgfplots/xmax},0);

\addplot[red,opacity=0.3] fill between[of=lower and bottom];

\addplot[name path=solid] coordinates{ (0.5,0.5) (0.4,0.8) (0.0,0.8)};
\addplot[blue,opacity=0.3] fill between[of=solid and lower];

\addplot coordinates{ (0.5,0.5) (0.4,0.8) (0.0,0.8)};

\addplot[blue,domain=0.5:1,samples=100,]{0.5+2*(x-0.5)^2};

\node at (0.25,0.65) {solid};
\node at (0.75,0.25) {vapor};

\end{axis}
\end{tikzpicture}
\end{document}

相关内容