例如[Fig 1]
,如何在我的函数下添加标题,以及如何引用该图?
我的代码:
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel=$\mu(x)$
]
% invoke external gnuplot as
% calculator:
\addplot[smooth,samples=180,domain=0.0001:20] {1/(1+(1/x))};
\end{axis}
\end{tikzpicture}
答案1
您可以将您的情节放在figure
环境中,并像往常一样添加标题。
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel=$\mu(x)$
]
% invoke external gnuplot as
% calculator:
\addplot[smooth,samples=180,domain=0.0001:20] {1/(1+(1/x))};
\end{axis}
\end{tikzpicture}
\caption{This is my plot}\label{fig:myplot}
\end{figure}
From \ref{fig:myplot} I don't get nothing.
\end{document}