Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[11pt]{scrartcl}
- usepackage[utf8]{inputenc}
- usepackage{pgf}
- usepackage{pgfplots}
- usepgfplotslibrary{statistics, external}
- usetikzlibrary{fit,calc}
- usepackage{mathtools}
- usepackage[ngerman]{babel}
- newcommand*{boxplot}[6]{
- % As seen in several examples
- % #1: center, #2: median, #3: 1/4 quartile, #4: 3/4 quartile, #5: min, #6: max
- addplot+[
- line width=.2mm,
- black,
- boxplot prepared={
- lower whisker={#5},
- lower quartile={#3},
- median={#2},
- upper quartile={#4},
- upper whisker={#6},
- draw position = 10,
- box extend = 15,
- whisker extend = 17,
- }
- ]
- coordinates{};
- }
- begin{document}
- begin{table}
- centering
- begin{tabular}{p{7.5cm}|p{7.5cm}}
- hline
- Wie wichtig ist es dir, dass du mit deinen Kommilitonen gut auskommst? &
- begin{tikzpicture}
- begin{axis}[
- height=2cm, width=7cm,
- ybar, ymax=19, ymin=0, ytick={0,19}, yticklabels={0,19},
- xmin=0, xmax=6, xtick={1,...,5}, xticklabels={$text{gar nicht}$,2,3,4,$text{sehr}$}
- ] addplot coordinates {(1,0) (2,0) (3,1) (4,8) (5,10)};
- end{axis}
- end{tikzpicture}
- hspace*{0.3cm}
- begin{tikzpicture}
- begin{axis}[
- height=2cm, width=7cm,
- ymin=0, ymax=19, ytick={0,19}, yticklabels={,},
- xmin=0, xmax=6, xtick={1,...,5}, xticklabels={$text{gar nicht}$,2,3,4,$text{sehr}$},
- boxplot/every median/.style={draw=red},
- ] boxplot{4.4736842105}{5}{3.91966759}{5.027700831}{3}{5}
- end{axis}
- end{tikzpicture}\
- hline
- end{tabular}
- end{table}
- end{document}
Add Comment
Please, Sign In to add comment