问题:表中的标签放置正确,但重叠。有没有办法自动对齐节点附近的标签,以使标签不重叠?这是一个小例子,但我有一个更大的表,这个问题更加严重。我怎样才能从表中只选择一些特定的名称?我怎样才能强制将标签名称打印成两行。在表中的名称中输入“\”作为换行符不起作用。
\documentclass[12pt,a4paper]{report}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Linux Libertine O}
\usepackage[german]{babel}
\usepackage{filecontents}
\usepackage[dvipsnames,svgnames,x11names,fixpdftex]{xcolor}
\usepackage{pgfplots, pgfplotstable
} %Diagramme
\pgfplotsset{compat=newest,
every axis/.append style={
font=\small,
%line width=.7pt,
%tick style={line width=.7pt, color=black}
}
} %Abstand Abszissenbeschriftung in Diagrammen
\begin{document}
\begin{filecontents}{rankdist.dat}
rang distrib tls socut p2012 rbbrl
1 {Sony (Columbia)} 27 24.692 21.790987 254.265931
2 {Fox} 25 22.825 21.096097 219.680717
3 {Disney} 16 17.640 17.141172 200.716283
4 {Warner} 28 19.050 17.716110 197.348198
5 {Paris (SM)} 39 21.248 17.631287 189.518046
6 {Paramount} 12 16.803 12.716975 142.275706
7 {Imagem (Wmix)} 44 17.409 12.419712 136.702831
8 {Downtown/Paris/Riofilme} 6 11.473 9.876740 100.209045
9 {Universal} 17 13.945 9.162490 95.913858
10 {Califórnia (Antonio Fernandes)} 22 3.449 1.763263 21.285077
\end{filecontents}
\begin{figure}[thbp]
\caption {Reihung der Verleiher 2012}\label{abb:rankdist}
\begin{center}
%\small
\begin{tikzpicture}[scale=1]
\begin{axis}[
%colormap={redgreen}{color=(Red) color=(YellowOrange)color=(YellowGreen) color=(Green)},
width=0.95\textwidth,height=0.4\textheight,
%scale only axis,
axis x line=bottom,
axis y line=left,
tick align=center,
%minor ytick={1,2,...,24},
yminorgrids=true,
ymajorgrids=true,
x tick label style={/pgf/number format/1000 sep=},
x tick label style={rotate=45, anchor=north east},
y tick label style={/pgf/number format/1000 sep=},
%xmin=0,xmax=200,
%unbounded coords=jump,
%xtick={1971,1973,...,2011},
%minor xtick={1972,1974,...,2010},
%ymin=0,ymax=3,
%ytick={0,5,...,25},
ylabel={Belegte Kinosäle in Tausend},
xlabel={Bruttoeinspielergebnisse in Mio. BRL},
enlargelimits=0.05,
legend columns=1,
legend style={at={(0,1)},anchor=south west, draw=none},
legend cell align=left
]
\addplot[
scatter,
only marks,
scatter src=explicit,
visualization depends on=\thisrow{p2012}\as\pub,
visualization depends on=\thisrow{tls}\as\tls,
scatter/@pre marker code/.append style={/tikz/mark size=\tls/10}
]
table[x=rbbrl,y=socut,meta=tls]{rankdist.dat};
\addplot[
scatter,
only marks,
no markers,
scatter src=explicit symbolic,
% visualization depends on=\thisrow{tls4}\as\tlsfour,
% scatter/@pre marker code/.append style={/tikz/mark size=1.5*\tlsfour},
nodes near coords, anchor=south west,
every node near coord/.append style={font=\small, black,
%yshift=.1ex,
%xshift=.2ex
},
]
table[x=rbbrl,y=socut,meta=distrib]{rankdist.dat};
\end{axis}
\end{tikzpicture}
\end{center}
\end{figure}
\end{document}