von Gast » Mi 16. Sep 2015, 13:22
Ich sehe gerade, dass der Online-Editor von dem Code oben nicht ganz begeistert ist (der Block in \makeatletter/\\makeatother ist übrigens dort nicht nötig, das war noch über). Mit der neusten Version von PGFPlots (Version 3.12) geht es bei mir auf dem Rechner aber schon.
Das \let\percent\@percentchar kommt von
How do I get a % sign in symbolic x coords in pgfplots
\documentclass[12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{pgfplots}
\makeatletter
\let\percent\@percentchar
\makeatother
\begin{document}
\begin{figure}[htb]\centering
\begin{tikzpicture}
\begin{axis}[
width=21cm,
height=9.5cm,
ybar=3pt,
bar width=30pt,
nodes near coords,
enlarge x limits=0.2,
legend cell align=left,
xtick={data},
symbolic x coords={Blabla Ma.-\percent},
ymin=0,
ymax=100,
ytick={0,10,20,30,40,50,60,70,80,90,100}]
%Daten
\addplot[black,fill=lightgray,error bars/.cd,y dir=both,y explicit] coordinates {
(Blabla Ma.-\percent,10.29)};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
funktioniert auch mit der älteren Version von PGFPlots bei Overleaf.
Ich sehe gerade, dass der Online-Editor von dem Code oben nicht ganz begeistert ist (der Block in [tt]\makeatletter[/tt]/[tt]\\makeatother[/tt] ist übrigens dort nicht nötig, das war noch über). Mit der neusten Version von PGFPlots (Version 3.12) geht es bei mir auf dem Rechner aber schon.
Das [tt]\let\percent\@percentchar[/tt] kommt von [url=http://tex.stackexchange.com/q/64789/35864]How do I get a % sign in symbolic x coords in pgfplots[/url]
[code]\documentclass[12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{pgfplots}
\makeatletter
\let\percent\@percentchar
\makeatother
\begin{document}
\begin{figure}[htb]\centering
\begin{tikzpicture}
\begin{axis}[
width=21cm,
height=9.5cm,
ybar=3pt,
bar width=30pt,
nodes near coords,
enlarge x limits=0.2,
legend cell align=left,
xtick={data},
symbolic x coords={Blabla Ma.-\percent},
ymin=0,
ymax=100,
ytick={0,10,20,30,40,50,60,70,80,90,100}]
%Daten
\addplot[black,fill=lightgray,error bars/.cd,y dir=both,y explicit] coordinates {
(Blabla Ma.-\percent,10.29)};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}[/code]
funktioniert auch mit der älteren Version von PGFPlots bei Overleaf.