diff --git a/statistics/lecture_statistics.tex b/statistics/lecture_statistics.tex index 1307974..46c390d 100755 --- a/statistics/lecture_statistics.tex +++ b/statistics/lecture_statistics.tex @@ -374,7 +374,7 @@ geeignet. Der Pearson Korrelationskoeffizient ist es nicht. \frametitle{Darstellung nominaler Daten} \framesubtitle{Bar-Plot f\"ur Anzahl/ rel. H\"aufigkeit} \begin{center} - \includegraphics[width=.6\linewidth]{figs/nominaldataplot} + \includegraphics[width=.8\linewidth]{figs/nominaldataplot} \end{center} \end{frame} %------------------------------------------------------------- @@ -403,6 +403,46 @@ set(gcf, 'PaperPosition',[0.0 0.0 11.7 9.0]); \end{lstlisting} \end{frame} +%------------------------------------------------------------- +\begin{frame}[fragile] + \frametitle{Darstellung nominaler Daten} + \framesubtitle{Pie-Chart f\"ur Anzahl/ rel. H\"aufigkeit} + \begin{center} + \includegraphics[width=.8\linewidth]{figs/nominaldataplot2} + \end{center} +\end{frame} +%------------------------------------------------------------- +\begin{frame}[fragile] + \frametitle{Darstellung nominaler Daten} + \framesubtitle{\"Ubung} + \begin{task}{Pie-Chart} + Plotte dieselben Daten ($n_{py}=50$, $n_{in}=90$) als Pie-Chart in Matlab. + \end{task} +\end{frame} +%------------------------------------------------------------- +\begin{frame}[fragile] + \frametitle{Darstellung nominaler Daten} + \framesubtitle{Pie-Chart f\"ur Anzahl/ rel. H\"aufigkeit} + \scriptsize +\begin{lstlisting} +data = [50, 90]; +h = pie(data, [1,0], {'pyramidal (n=50)', 'interneuron (n=90)'}) +hText = findobj(h,'Type','text') % text object handles + +set(h(1), 'FaceColor', [.2,.2,.2]); +set(h(2), 'Rotation', 45); +set(h(3), 'FaceColor', [.8,.8,.8]); +set(h(4), 'Rotation', 45); + +title('cell count') +set(gca,'XTick',1:2,'XTickLabel',{'pyramidal', 'interneuron'}) +box('off') +set(gcf, 'PaperUnits', 'centimeters'); +set(gcf, 'PaperSize', [11.7 9.0]); +set(gcf, 'PaperPosition',[0.0 0.0 11.7 9.0]); +\end{lstlisting} +\end{frame} + \end{document} diff --git a/statistics/matlab/nominal_plots.m b/statistics/matlab/nominal_plots.m index d4f4d5b..9abd78b 100644 --- a/statistics/matlab/nominal_plots.m +++ b/statistics/matlab/nominal_plots.m @@ -1,5 +1,6 @@ close all -% cell type +% cell type bar +figure() bar([1,2], [50, 90], 'facecolor', 'k') ylabel('cell count') xlabel('cell type') @@ -10,3 +11,21 @@ set(gca,'XTick',1:2,'XTickLabel',{'pyramidal', 'interneuron'},'FontSize',20) set(gcf, 'PaperUnits', 'centimeters'); set(gcf, 'PaperSize', [11.7 9.0]); set(gcf, 'PaperPosition',[0.0 0.0 11.7 9.0]); + +% cell type pie +figure() +data = [50, 90]; +h = pie(data, [1,0], {'pyramidal (n=50)', 'interneuron (n=90)'}) +hText = findobj(h,'Type','text') % text object handles + +set(h(1), 'FaceColor', [.2,.2,.2]); +set(h(2), 'Rotation', 45); +set(h(3), 'FaceColor', [.8,.8,.8]); +set(h(4), 'Rotation', 45); + +title('cell count') +set(gca,'XTick',1:2,'XTickLabel',{'pyramidal', 'interneuron'}) +box('off') +set(gcf, 'PaperUnits', 'centimeters'); +set(gcf, 'PaperSize', [11.7 9.0]); +set(gcf, 'PaperPosition',[0.0 0.0 11.7 9.0]);