von markusv » Mo 27. Mär 2017, 12:47
Du kannst mit ytick={num1,num2,num3,...} selbst definieren, welche Zahlen angezeigt werden sollen.
Mit yticklabels={num1,num2,num3,...} kannst du einstellen, welche Bezeichnung diese Zahlen erhalten.
Kombinierst du also beides, erhälst du:
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{pgfplots}
\pgfplotsset{width=\textwidth,height=6cm,compat=1.9}
\pgfplotsset{/pgf/number format/read comma as period}
\begin{filecontents}{test.dat}
XOR UN UO
9 0,1464 0,1658
10 0,5522 0,6937
11 2,3192 2,6957
12 10,6797 12,7331
13 79,5394 94,9720
14 406,1020 468,6611
\end{filecontents}
\begin{document}
\pgfplotstableread{test.dat}{\test}
\begin{tikzpicture}
\begin{axis}[
ybar=8pt,
bar width=20pt,
xlabel=xlabel,
ylabel=Zeit (Minuten),
grid=major,
ymode = log,
log origin=infty,
xtick=data,
minor y tick num=2,
xmin=8.5, xmax=14.5,
ymin=0, ymax=533,
ytick = {0.1,10,237,438}, %<--- ergänzt
yticklabels={$10^{-1}$,$10^1$,237,438}, %<--- ergänzt
every node near coord/.append style={
/pgf/number format/fixed zerofill,
/pgf/number format/precision=2
}
]
\addplot[blue,fill=blue!30,nodes near coords] table[x=XOR,y=UN] {\test};
\addplot+[orange,fill=orange!30,nodes near coords,ybar] table[x=XOR,y=UO] {\test};
\end{axis}
\end{tikzpicture}
\end{document}
Du kannst mit [tt]ytick={num1,num2,num3,...}[/tt] selbst definieren, welche Zahlen angezeigt werden sollen.
Mit [tt]yticklabels={num1,num2,num3,...}[/tt] kannst du einstellen, welche Bezeichnung diese Zahlen erhalten.
Kombinierst du also beides, erhälst du:
[code]\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{pgfplots}
\pgfplotsset{width=\textwidth,height=6cm,compat=1.9}
\pgfplotsset{/pgf/number format/read comma as period}
\begin{filecontents}{test.dat}
XOR UN UO
9 0,1464 0,1658
10 0,5522 0,6937
11 2,3192 2,6957
12 10,6797 12,7331
13 79,5394 94,9720
14 406,1020 468,6611
\end{filecontents}
\begin{document}
\pgfplotstableread{test.dat}{\test}
\begin{tikzpicture}
\begin{axis}[
ybar=8pt,
bar width=20pt,
xlabel=xlabel,
ylabel=Zeit (Minuten),
grid=major,
ymode = log,
log origin=infty,
xtick=data,
minor y tick num=2,
xmin=8.5, xmax=14.5,
ymin=0, ymax=533,
ytick = {0.1,10,237,438}, %<--- ergänzt
yticklabels={$10^{-1}$,$10^1$,237,438}, %<--- ergänzt
every node near coord/.append style={
/pgf/number format/fixed zerofill,
/pgf/number format/precision=2
}
]
\addplot[blue,fill=blue!30,nodes near coords] table[x=XOR,y=UN] {\test};
\addplot+[orange,fill=orange!30,nodes near coords,ybar] table[x=XOR,y=UO] {\test};
\end{axis}
\end{tikzpicture}
\end{document}[/code]