2010-04-24 135 views
0

我想绘制带有轴标签的x-y图。不幸的是,ylabel错位。它看起来取决于实际数据。当使用下面示例中的其他数据行代替上面的行时,它看起来更好。 如何将标签移动到左侧或(更合意)如何才能让pgfplot正确执行此操作?pgfplot标签问题

% !TEX TS-program = pdflatex 
% !TEX encoding = UTF-8 Unicode 
\documentclass{scrartcl} 
\usepackage[utf8]{inputenc} 
\usepackage{tikz} 
\usepackage{pgfplots} 
\begin{document} 
\begin{tikzpicture} 
\begin{axis}[width=13cm,height=8cm, 
    xlabel={I in mA}, ylabel={U in mV}] 
    \addplot[only marks,mark=star] coordinates { 
% (1.36, -0.0177) (45.38, 0.0273) (74.19, 0.0413) 
    (100.88, 0.0533) (134.80, 0.0683) (195.27, 0.1073) 
    }; 
\end{axis} 
\end{tikzpicture} 
\end{document} 

回答

1

pgfplots 1.3有一个新功能,可以将轴标签自动紧密地移动到刻度标签上。由于这会影响间距,因此它不是默认的。

使用

\usepackage{pgfplots} 
\pgfplotsset{compat=1.3} 

在序言中从改进空间中受益。