For my bachelor thesis I did a questionnaire, now I want to evaluate and visualise it in a diagram, combining multiple values. Most of the answers from this survey are in a scale of 1-5 or 1-6. I want to display them in a histogram for absolute values and also in a boxplot for median, mean, standard deviation,...
To work efficiently with the space, I want to display them in a table, left is the question, right the diagram. Currently the data is processed in two diagrams, instead of one.
What I would like to have, is a combination of those two into one diagram, containing the boxplot and a histogram. Here is an example of what I wanted to do.
After several hours of reading, followed by trial-and-error, I didn't get any further. I wonder if anyone can help me with getting the design right. Here is an image that explains the values in the german examples.
Is it even possible to do this with LaTex?
It would already help to know the term for such a diagram
Edit: This is the minimal code example, generating the plot in the first picture.
\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}
axis
environments whereby the second one is shifted downwards. Or you can use a group plot for this. All this is straightforward, but no one is keen on punching in the texts from your screen shot, I guess.