diff --git a/plotting/lecture/plotting.tex b/plotting/lecture/plotting.tex index 803fa8f..57fa70b 100644 --- a/plotting/lecture/plotting.tex +++ b/plotting/lecture/plotting.tex @@ -11,123 +11,6 @@ results. severe.}{\url{www.xkcd.com}}\label{xkcdplotting} \end{figure} -\section{What makes a good plot?} -Plot should help/enable the interested reader to get a grasp of the -data and to understand the performed analysis and to critically assess -the presented results. The most important rule is the correct and -complete annotation of the plots. This starts with axis labels and -units and and extends to legends. Incomplete annotation can have -terrible consequences (\figref{xkcdplotting}). - -The principle of \emph{ink minimization} may be used a a guiding -principle for appealing plots. It requires that the relation of amount -of ink spent on the data and that spent on other parts of the plot -should be strongly in favor of the data. Ornamental of otherwise -unnecessary gimicks should not be used in scientific contexts. An -exception can be made if the particular figure was designed for -didactic purposes and sometimes for presentations. - -\begin{important}[Correct labeling of plots] - A data plot must be sufficiently labeled: - \begin{itemize} - \item Every axis must have a label and the correct unit, if it has - one.\\ (e.g. \code[xlabel()]{xlabel('Speed [m/s]'}). - \item When more than one line is plotted, they have to be labeled - using the figure legend, or similar \matlabfun{legend()}. - \item If using subplots that show similar information on the axes, - they should be scaled to show the same ranges to ease comparison - between plots. (e.g. \code[xlim()]{xlim([0 100])}.\\ If one - chooses to ignore this rule one should explicitly state this in - the figure caption and/or the descriptions in the text. - \item Labels must be large enough to be readable. In particular, - when using the figure in a presentation use large enough fonts. - \end{itemize} -\end{important} - - -\section{Things that should be avoided.} - -When plotting scientific data we should take great care to avoid -suggestive or misleading presentations. Unnecessary additions and -fancy graphical effects make a plot frivolous and also violate the -\emph{ink minimization principle}. Illustrations in comic style -(\figref{comicexamplefig}) are not suited for scientific data in most -instances. For presentations or didactic purposes, however, using a -comic style may be helpful to indicate that the figure is a mere -sketch and the exact position of the data points is of no importance. - -\begin{figure}[t] - \includegraphics[width=0.7\columnwidth]{outlier}\vspace{-3ex} - \titlecaption{Comic-like illustration.}{Obviously not suited to - present scientific data. In didactic or illustrative contexts they - can be helpful to focus on the important - aspects.}\label{comicexamplefig} -\end{figure} - - -The following figures show examples of misleading or suggestive -presentations of data. Several of the effects have been exaggerated to -make the point. A little more subtlety these methods are employed to -nudge the viewers experience into the desired direction. You can find -more examples on \url{https://en.wikipedia.org/wiki/Misleading_graph}. - -\begin{figure}[p] - \includegraphics[width=0.35\textwidth]{misleading_pie} - \hspace{0.05\textwidth} - \includegraphics[width=0.35\textwidth]{sample_pie} - \titlecaption{Perspective distortion influences the perceived - size.}{By changing the perspective of the 3-D illustration the - highlighted segment \textbf{C} gains more weight than it should - have. In the left graph segments \textbf{A} and \textbf{C} appear - very similar. The 2-D plot on the right-hand side shows that this - is an - illusion. \url{https://en.wikipedia.org/wiki/Misleading_graph}}\label{misleadingpiefig} -\end{figure} - -\begin{figure}[p] - \includegraphics[width=0.9\textwidth]{plot_scaling.pdf} - \titlecaption{Choosing the figure format and scaling of the axes - influences the perceived strength of a correlation.}{All subplots - show the same data. By choosing a certain figure size we can - pronounce or reduce the perceived strength of the correlation - in the data. Technically all three plots are correct. - }\label{misleadingscalingfig} -\end{figure} - -\begin{figure}[p] - \begin{minipage}[t]{0.3\textwidth} - \includegraphics[width=0.8\textwidth]{improperly_scaled_graph} - \end{minipage} - \begin{minipage}[t]{0.3\textwidth} - \includegraphics[width=0.8\textwidth]{comparison_properly_improperly_graph} - \end{minipage} - \begin{minipage}[t]{0.3\textwidth} - \includegraphics[width=0.7\textwidth]{properly_scaled_graph} - \end{minipage} - \titlecaption{Scaling of markers and symbols.} {In these graphs - symbols have been used to illustrate the measurements made in two - categories. The measured value for category \textbf{B} is actually - three times the measured value for category \textbf{A}. In the - left graph the symbol for category \textbf{B} has been scaled to - triple height while maintaining the proportions. This appears just - fair and correct but leads to the effect that the covered surface - is not increased to the 3-fold but the 9-fold (center plot). The - plot on the right shows how it could have been done correctly. - \url{https://en.wikipedia.org/wiki/Misleading_graph}}\label{misleadingsymbolsfig} -\end{figure} - -By using perspective effects in 3-D plot the perceived size can be -distorted into the desired direction. While the plot is correct in a -strict sense it is rather suggestive -(\figref{misleadingpiefig}). Similarly the choice of figure size and -proportions can lead to different interpretations of the -data. Stretching the y-extent of a graph leads to a stronger -impression of the correlation in the data. Compressing this axis will -lead to a much weaker perceived correlation -(\figref{misleadingscalingfig}). When using symbols to illustrate a -quantity we have to take care not to overrate of difference due to -symbol scaling (\figref{misleadingsymbolsfig}). - \section{The \matlab{} plotting system} Plotting data in \matlab{} is rather straight forward for simple line @@ -720,7 +603,122 @@ Lissajous figure. The basic steps are: movie.}, label=animationlisting, firstline=3, lastline=33, basicstyle=\ttfamily\scriptsize]{movie_example.m} +\section{What makes a good plot?} +Plot should help/enable the interested reader to get a grasp of the +data and to understand the performed analysis and to critically assess +the presented results. The most important rule is the correct and +complete annotation of the plots. This starts with axis labels and +units and and extends to legends. Incomplete annotation can have +terrible consequences (\figref{xkcdplotting}). + +The principle of \emph{ink minimization} may be used a a guiding +principle for appealing plots. It requires that the relation of amount +of ink spent on the data and that spent on other parts of the plot +should be strongly in favor of the data. Ornamental of otherwise +unnecessary gimicks should not be used in scientific contexts. An +exception can be made if the particular figure was designed for +didactic purposes and sometimes for presentations. + +\begin{important}[Correct labeling of plots] + A data plot must be sufficiently labeled: + \begin{itemize} + \item Every axis must have a label and the correct unit, if it has + one.\\ (e.g. \code[xlabel()]{xlabel('Speed [m/s]'}). + \item When more than one line is plotted, they have to be labeled + using the figure legend, or similar \matlabfun{legend()}. + \item If using subplots that show similar information on the axes, + they should be scaled to show the same ranges to ease comparison + between plots. (e.g. \code[xlim()]{xlim([0 100])}.\\ If one + chooses to ignore this rule one should explicitly state this in + the figure caption and/or the descriptions in the text. + \item Labels must be large enough to be readable. In particular, + when using the figure in a presentation use large enough fonts. + \end{itemize} +\end{important} + + +\section{Things that should be avoided.} + +When plotting scientific data we should take great care to avoid +suggestive or misleading presentations. Unnecessary additions and +fancy graphical effects make a plot frivolous and also violate the +\emph{ink minimization principle}. Illustrations in comic style +(\figref{comicexamplefig}) are not suited for scientific data in most +instances. For presentations or didactic purposes, however, using a +comic style may be helpful to indicate that the figure is a mere +sketch and the exact position of the data points is of no importance. + +\begin{figure}[t] + \includegraphics[width=0.7\columnwidth]{outlier}\vspace{-3ex} + \titlecaption{Comic-like illustration.}{Obviously not suited to + present scientific data. In didactic or illustrative contexts they + can be helpful to focus on the important + aspects.}\label{comicexamplefig} +\end{figure} + + +The following figures show examples of misleading or suggestive +presentations of data. Several of the effects have been exaggerated to +make the point. A little more subtlety these methods are employed to +nudge the viewers experience into the desired direction. You can find +more examples on \url{https://en.wikipedia.org/wiki/Misleading_graph}. + +\begin{figure}[p] + \includegraphics[width=0.35\textwidth]{misleading_pie} + \hspace{0.05\textwidth} + \includegraphics[width=0.35\textwidth]{sample_pie} + \titlecaption{Perspective distortion influences the perceived + size.}{By changing the perspective of the 3-D illustration the + highlighted segment \textbf{C} gains more weight than it should + have. In the left graph segments \textbf{A} and \textbf{C} appear + very similar. The 2-D plot on the right-hand side shows that this + is an + illusion. \url{https://en.wikipedia.org/wiki/Misleading_graph}}\label{misleadingpiefig} +\end{figure} + +\begin{figure}[p] + \includegraphics[width=0.9\textwidth]{plot_scaling.pdf} + \titlecaption{Choosing the figure format and scaling of the axes + influences the perceived strength of a correlation.}{All subplots + show the same data. By choosing a certain figure size we can + pronounce or reduce the perceived strength of the correlation + in the data. Technically all three plots are correct. + }\label{misleadingscalingfig} +\end{figure} + +\begin{figure}[p] + \begin{minipage}[t]{0.3\textwidth} + \includegraphics[width=0.8\textwidth]{improperly_scaled_graph} + \end{minipage} + \begin{minipage}[t]{0.3\textwidth} + \includegraphics[width=0.8\textwidth]{comparison_properly_improperly_graph} + \end{minipage} + \begin{minipage}[t]{0.3\textwidth} + \includegraphics[width=0.7\textwidth]{properly_scaled_graph} + \end{minipage} + \titlecaption{Scaling of markers and symbols.} {In these graphs + symbols have been used to illustrate the measurements made in two + categories. The measured value for category \textbf{B} is actually + three times the measured value for category \textbf{A}. In the + left graph the symbol for category \textbf{B} has been scaled to + triple height while maintaining the proportions. This appears just + fair and correct but leads to the effect that the covered surface + is not increased to the 3-fold but the 9-fold (center plot). The + plot on the right shows how it could have been done correctly. + \url{https://en.wikipedia.org/wiki/Misleading_graph}}\label{misleadingsymbolsfig} +\end{figure} +By using perspective effects in 3-D plot the perceived size can be +distorted into the desired direction. While the plot is correct in a +strict sense it is rather suggestive +(\figref{misleadingpiefig}). Similarly the choice of figure size and +proportions can lead to different interpretations of the +data. Stretching the y-extent of a graph leads to a stronger +impression of the correlation in the data. Compressing this axis will +lead to a much weaker perceived correlation +(\figref{misleadingscalingfig}). When using symbols to illustrate a +quantity we have to take care not to overrate of difference due to +symbol scaling (\figref{misleadingsymbolsfig}). \section{Summary} A good plot of scientific data displays the data completely and