我想在我的图的轴上添加一个标签。这是我的代码:
\begin{figure}[!h]
\centering
\begin{tikzpicture}[scale=1]
\begin{axis}[%
% Lengend position
legend pos = outer north east,
% We need a tick for every data
xtick = data,
% The ticks label are provided in the file as the column named Num
xticklabels from table = {test.dat}{Num}]
% How the data are separated.
% \pgfplotstableset{col sep = tab}
% We need to simulate an x coord since it is litteral in the data file. I choose to index on the line.
\addplot table [x expr = \lineno, y = Min] {test.dat};
\addlegendentry{Min}
\addplot table [x expr = \lineno, y = Moy] {test.dat};
\addlegendentry{Moy}
\addplot table [x expr = \lineno, y = Max] {test.dat};
\addlegendentry{Max}
\end{axis}
\end{tikzpicture}
\caption{Propagation d'une publication générée avec la politique est \bf {Amis Seulement}}
\end{figure}
答案1
你可以选择以下方式:
- 在轴环境的选项部分
xlabel
中使用ylabel
- 使用
\node at (axis cs:xmax,0) {your_x_label_here}
和\node at (axis cs:0,ymax) {your_y_label_here}
在我看来,当您需要通过调整节点选项来获得更准确的标签位置时,第二种方法更容易......