von brucke » Do 2. Mai 2013, 16:18
Hallo Zusammen,
ich habe ein Problem mit dem pgfplots Package. Ich möchte ein Diagramm haben das auf der x Achse die Jahre 2012 und 2016 steht hat. Aber aus unbekannten Gründen steht auf der xAchse
2012 2012 2012 2016 2016 2016 und das verstehe ich nicht...
Hier mein Minimalbeispiel:
\documentclass[10pt,a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{pgfplots}
\pgfplotsset{width=0.7\textwidth, compat = newest}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
% width=0.7\textwidth,
ybar,
title=Verteilung,
ylabel=Anteil,
xlabel=Jahr,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-1},
bar width=7pt,
unbounded coords = jump,
symbolic x coords={2012, 2016},
]
\addplot table[y=Android] {daten.csv};
\addplot table[y=iOS] {daten.csv};
\addplot table[y=WindowsPhone] {daten.csv};
\addplot table[y=BlackBerryOS] {daten.csv};
\addplot table[y=Andere] {daten.csv};
\legend{Android, iOS, WindowsPhone, BlackBerryOS, Andere};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
Hier die Daten:
Jahr Android iOS WindowsPhone BlackBerryOS Andere
2012 68.30 18.80 2.60 4.70 5.60
2016 63.80 19.10 11.40 4.10 1.60
Ich hoffe ihr könnt mir helfen...?
Vielen Dank
mfg
Brucke
Hallo Zusammen,
ich habe ein Problem mit dem pgfplots Package. Ich möchte ein Diagramm haben das auf der x Achse die Jahre 2012 und 2016 steht hat. Aber aus unbekannten Gründen steht auf der xAchse
2012 2012 2012 2016 2016 2016 und das verstehe ich nicht...
Hier mein Minimalbeispiel:
[code]
\documentclass[10pt,a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{pgfplots}
\pgfplotsset{width=0.7\textwidth, compat = newest}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
% width=0.7\textwidth,
ybar,
title=Verteilung,
ylabel=Anteil,
xlabel=Jahr,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-1},
bar width=7pt,
unbounded coords = jump,
symbolic x coords={2012, 2016},
]
\addplot table[y=Android] {daten.csv};
\addplot table[y=iOS] {daten.csv};
\addplot table[y=WindowsPhone] {daten.csv};
\addplot table[y=BlackBerryOS] {daten.csv};
\addplot table[y=Andere] {daten.csv};
\legend{Android, iOS, WindowsPhone, BlackBerryOS, Andere};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
[/code]
Hier die Daten:
[code]
Jahr Android iOS WindowsPhone BlackBerryOS Andere
2012 68.30 18.80 2.60 4.70 5.60
2016 63.80 19.10 11.40 4.10 1.60
[/code]
Ich hoffe ihr könnt mir helfen...?
Vielen Dank
mfg
Brucke