Nodeposition bei Verwendung von symbolic x coords
Verfasst: Do 2. Mär 2017, 12:34
Ich erstelle gerade ein Balkendiagramm. Dabei versuche ich eine Beschriftung ganz Links oder ganz rechts an eine Hilfslinie zubekommen. Ich habe die X-Achse anstelle von Zahlen mit Symbolen versehen damit die Balken gleichmäßig verteilt sind. Ich weiß gerade nicht wie ich die Position bei einen solchen Koordinatensystem außerhalb angeben kann.
hier das Minimalbsp. dazu:
hier das Minimalbsp. dazu:
\documentclass{article} \usepackage[utf8]{inputenc} \usepackage{pgfplots} \usepackage{tikz} \pgfplotsset{compat=newest} \usepgfplotslibrary{units} \begin{document} \begin{figure}\centering \begin{tikzpicture} \pgfplotsset{ legend cell align = left, legend pos = north east, symbolic x coords={14,18,21,25}, xtick=data, } \begin{axis}[ ymajorgrids, no markers, enlargelimits=false, axis on top, ybar=4pt, width=\linewidth, height=9.5cm, axis lines*=left, xlabel={Stickout~\lbrack mm\rbrack}, ylabel=$U \lbrack \mathrm{V} \rbrack$, axis y discontinuity=crunch, %xtick={14,18,21,25}, ytickmin=30, ytickmax=38, ymin=28, ymax=38, bar width=18pt, enlarge x limits=0.2, nodes near coords, every node near coord/.append style= { font=\normalsize, fill=white, anchor=south }, legend pos = north west ] \begin{scope} % Hilfslinie \draw[thick,dashed,black] ({rel axis cs:1,0}|-{axis cs:14,29}) -- ({rel axis cs:0,0}|-{axis cs:25,29}) node[anchor=east,left] at (axis cs:14,29) {$U_{\mathrm{SOLL}}$}; \end{scope} %\node[anchor=east] at (axis cs:14,29) {$U_{\mathrm{SOLL}}$}; \addplot[style={fill=blue!50!cyan},error bars/.cd, y dir=both, y explicit] coordinates { (14,32.3) += (0,1.1) -= (0,1.1) (18,33.4) += (0,1.1) -= (0,1.1) (21,34.3) += (0,1.1) -= (0,1.1) (25,35.0) += (0,1.1) -= (0,1.1)};\addlegendentry{Smart Connector} \addplot[style={fill=red!85!magenta},error bars/.cd, y dir=both, y explicit] coordinates { (14,34.7) += (0,0.7) -= (0,0.7) (18,35.7) += (0,0.6) -= (0,0.6) (21,36.7) += (0,0.6) -= (0,0.6) (25,37.4) += (0,0.6) -= (0,0.6)};\addlegendentry{HKS-WeldAnalyst} \addplot[style={fill=green!50!olive},error bars/.cd, y dir=both, y explicit] coordinates { (14,30.8) += (0,0.7) -= (0,0.7) (18,32.1) += (0,1.5) -= (0,1.5) (21,33.2) += (0,2.4) -= (0,2.4) (25,34.1) += (0,2.4) -= (0,2.4)};\addlegendentry{Fronius TPS 5000} \end{axis} \end{tikzpicture} \end{figure} \end{document}