2010-04-24 89 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} 

在序言中從改進空間中受益。