[plotting] use the new figure, several fixes

This commit is contained in:
Jan Grewe 2018-02-06 15:23:27 +01:00
parent 6f8df67467
commit a8a0219c84

View File

@ -66,8 +66,8 @@ sketch and the exact position of the data points is of no importance.
The following figures show examples of misleading or suggestive The following figures show examples of misleading or suggestive
presentaions of data. Several of the effects have been axaggerated to presentations of data. Several of the effects have been exaggerated to
make the point. A little more subtlely these methods are employed to make the point. A little more subtlety these methods are employed to
nudge the viewers experience into the desired direction. You can find nudge the viewers experience into the desired direction. You can find
more examples on \url{https://en.wikipedia.org/wiki/Misleading_graph}. more examples on \url{https://en.wikipedia.org/wiki/Misleading_graph}.
@ -75,7 +75,7 @@ more examples on \url{https://en.wikipedia.org/wiki/Misleading_graph}.
\includegraphics[width=0.35\textwidth]{misleading_pie} \includegraphics[width=0.35\textwidth]{misleading_pie}
\hspace{0.05\textwidth} \hspace{0.05\textwidth}
\includegraphics[width=0.35\textwidth]{sample_pie} \includegraphics[width=0.35\textwidth]{sample_pie}
\titlecaption{Perspective distortion influendes the perceived \titlecaption{Perspective distortion influences the perceived
size.}{By changing the perspective of the 3-D illustration the size.}{By changing the perspective of the 3-D illustration the
highlighted segment \textbf{C} gains more weight than it should highlighted segment \textbf{C} gains more weight than it should
have. In the left graph segments \textbf{A} and \textbf{C} appear have. In the left graph segments \textbf{A} and \textbf{C} appear
@ -85,21 +85,13 @@ more examples on \url{https://en.wikipedia.org/wiki/Misleading_graph}.
\end{figure} \end{figure}
\begin{figure}[p] \begin{figure}[p]
\begin{minipage}[t]{0.3\textwidth} \includegraphics[width=0.9\textwidth]{plot_scaling.pdf}
\includegraphics[width=0.9\textwidth]{line_graph1} \titlecaption{Choosing the figure format and scaling of the axes
\end{minipage} influences the perceived strength of a correlation.}{All subplots
\begin{minipage}[t]{0.3\textwidth} show the same data. By choosing a certain figure size we can
\includegraphics[width=0.9\textwidth]{line_graph1_3} pronounce or reduce the perceived strength of the correlation
\end{minipage} in the data. Technically all three plots are correct.
\begin{minipage}[t]{0.3\textwidth} }\label{misleadingscalingfig}
\includegraphics[width=0.9\textwidth]{line_graph1_4}
\end{minipage}
\titlecaption{Chosing the figure format influences the erceived
strength of a correlation.}{All three subplots show the same data.
By choosing a certain figure size we can pronounce or to reduce
the perceived strength of the correlation in th data. Techincally
all three plots are correct.
\url{https://en.wikipedia.org/wiki/Misleading_graph}}\label{misleadingscalingfig}
\end{figure} \end{figure}
\begin{figure}[p] \begin{figure}[p]
@ -116,8 +108,8 @@ more examples on \url{https://en.wikipedia.org/wiki/Misleading_graph}.
symbols have been used to illustrate the measurements made in two symbols have been used to illustrate the measurements made in two
categories. The measured value for category \textbf{B} is actually categories. The measured value for category \textbf{B} is actually
three times the measured value for category \textbf{A}. In the three times the measured value for category \textbf{A}. In the
left graph the symbol for catergory \textbf{B} has been scaled to left graph the symbol for category \textbf{B} has been scaled to
triple heigth while maintaining the porpotions. This appears jusst triple height while maintaining the proportions. This appears just
fair and correct but leads to the effect that the covered surface 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 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. plot on the right shows how it could have been done correctly.
@ -217,15 +209,15 @@ number of datasets.
\subsection{Simple plotting} \subsection{Simple plotting}
Creating a simple line-plot is rather easy. Assuming there exists a Creating a simple line-plot is rather easy. Assuming there exists a
varaible \varcode{y} in the \codeterm{Workspace} that contains the variable \varcode{y} in the \codeterm{Workspace} that contains the
measurement data it is enough to call \code[plot()]{plot(y)}. At the measurement data it is enough to call \code[plot()]{plot(y)}. At the
first call of this function a new window will be opened and the data first call of this function a new window will be opened and the data
will be plotted with as a line plot. If you repeatedly call this will be plotted with as a line plot. If you repeatedly call this
function the current plot will be replaced unless the the function the current plot will be replaced unless the \code[hold]{hold
\code[hold]{hold on} command was issued before. If it was, the current on} command was issued before. If it was, the current plot is held
plot is held and a second line will be added to it. Calling and a second line will be added to it. Calling \code[hold]{hold off}
\code[hold]{hold off} will release the plot and any subsequent will release the plot and any subsequent plotting will replace the
plotting will replace the previous plot. previous plot.
In our previous call to \varcode{plot} we have provided just a single In our previous call to \varcode{plot} we have provided just a single
variable containing the y-values of the plot. The x-axis will be variable containing the y-values of the plot. The x-axis will be
@ -239,8 +231,8 @@ plotted as a line plot with a solid blue line of the with 1pt. A
second plot that is added to the figure will be plotted in red using second plot that is added to the figure will be plotted in red using
the same standard settings. The order of the used colors depends on the same standard settings. The order of the used colors depends on
the \enterm{colormap} settings which can be adjusted to personal taste the \enterm{colormap} settings which can be adjusted to personal taste
or need. Table\,\ref{plotlinestyles} shows some predefined values or need. Table\,\ref{plotlinestyles} shows some predefined values that
that can be chosen for the line style, the marker, or the color. For can be chosen for the line style, the marker, or the color. For
additional options consult the help. additional options consult the help.
\begin{table}[tp] \begin{table}[tp]
@ -302,7 +294,7 @@ unit. By calling the functions \code[xlabel]{xlabel('Time [ms]')} and
\code[ylabel]{ylabel{'Voltage [mV]'}} these can be set. By default the \code[ylabel]{ylabel{'Voltage [mV]'}} these can be set. By default the
axes will be scaled to show the whole data range. The extremes will be axes will be scaled to show the whole data range. The extremes will be
selected as the closest integer for small values of the next full selected as the closest integer for small values of the next full
multiple of tens, hundreds, thousands, etc. depending on the maximum multiple of tens, hundreds, thousands, etc.\ depending on the maximum
value. If these defaults do not match our needs the limits of the axes value. If these defaults do not match our needs the limits of the axes
can be explicitly set with the functions \code[xlim()]{xlim()} and can be explicitly set with the functions \code[xlim()]{xlim()} and
\code[ylim()]{ylim()} functions. To do this, the functions expect a \code[ylim()]{ylim()} functions. To do this, the functions expect a
@ -348,15 +340,15 @@ example.
\subsection{Changing the figure properties} \subsection{Changing the figure properties}
\begin{table}[tp] \begin{table}[tp]
\titlecaption{Incomple list of available figure properties.}{For a complete reference consult the \matlab{} help or select the property editor while having the figuree background selected \titlecaption{Incomplete list of available figure properties.}{For a complete reference consult the \matlab{} help or select the property editor while having the figure background selected
(\figref{ploteditorfig}).}\label{plotfigureprops} (\figref{ploteditorfig}).}\label{plotfigureprops}
\begin{tabular*}{1\textwidth}{lp{6.6cm}p{5.7cm}} \hline \begin{tabular*}{1\textwidth}{lp{6.6cm}p{5.7cm}} \hline
\textbf{property} & \textbf{description} & \textbf{options} \textbf{property} & \textbf{description} & \textbf{options}
\erh \\ \erh \\
\hline \code{Color} & Background color of the figure, not the drawing area. & Any RGB, CMYK values. \erb \hline \code{Color} & Background color of the figure, not the drawing area. & Any RGB, CMYK values. \erb
\\ \code{PaperPosition} & Position of the axes on the paper. & 4-element vector containing the positions of the botom-left and top-right corners. \\ \\ \code{PaperPosition} & Position of the axes on the paper. & 4-element vector containing the positions of the bottom-left and top-right corners. \\
\code{PaperSize} & Size of the paper. & 2-element vector defining width and height.\\ \code{PaperSize} & Size of the paper. & 2-element vector defining width and height.\\
\code{PaperUnits} & Unit in which size and postition are given. & $\{'inches' | 'centimeters' | \code{PaperUnits} & Unit in which size and position are given. & $\{'inches' | 'centimeters' |
'normalized' | 'points'\}$\\ 'normalized' | 'points'\}$\\
\code{Visible} & Defines whether the plot should actually be drawn on screen. Useful when plots should not be displayed but directly saved to file. & $\{'on' | 'off'\}$\\ \hline \code{Visible} & Defines whether the plot should actually be drawn on screen. Useful when plots should not be displayed but directly saved to file. & $\{'on' | 'off'\}$\\ \hline
\end{tabular*} \end{tabular*}
@ -472,8 +464,8 @@ figures\,\ref{regularsubplotsfig}, \ref{irregularsubplotsfig}).
grid \figref{regularsubplotsfig}.}, label=regularsubplotlisting, grid \figref{regularsubplotsfig}.}, label=regularsubplotlisting,
basicstyle=\ttfamily\scriptsize]{regular_subplot.m} basicstyle=\ttfamily\scriptsize]{regular_subplot.m}
By default, all suplots have the same size, if something else is By default, all subplots have the same size, if something else is
desired, e.g., one suplot should span a whole row, while two others desired, e.g., one subplot should span a whole row, while two others
are smaller and placed side by side in the same row, the third are smaller and placed side by side in the same row, the third
argument of \varcode{subplot} can be a vector or numbers that should argument of \varcode{subplot} can be a vector or numbers that should
be joined. These have, of course, be adjacent numbers be joined. These have, of course, be adjacent numbers
@ -483,7 +475,7 @@ listing\,\ref{irregularsubplotslisting}).
\begin{figure}[ht] \begin{figure}[ht]
\includegraphics[width=0.5\linewidth]{irregular_subplot} \includegraphics[width=0.5\linewidth]{irregular_subplot}
\titlecaption{Subplots of different size.}{The third argument of \titlecaption{Subplots of different size.}{The third argument of
\varcode{subpot} may be a vector of cells that should be joined \varcode{subplot} may be a vector of cells that should be joined
into the same subplot. See into the same subplot. See
listing\,\ref{irregularsubplotslisting}}\label{irregularsubplotsfig} listing\,\ref{irregularsubplotslisting}}\label{irregularsubplotsfig}
\end{figure} \end{figure}
@ -500,6 +492,7 @@ used cells of the grid by passing a vector as the third argument to
label=irregularsubplotslisting, label=irregularsubplotslisting,
basicstyle=\ttfamily\scriptsize]{irregular_subplot.m} basicstyle=\ttfamily\scriptsize]{irregular_subplot.m}
\subsection{Annotations, text} \subsection{Annotations, text}
Sometimes want to highlight certain parts of a plot or simply add an Sometimes want to highlight certain parts of a plot or simply add an
@ -510,7 +503,7 @@ the plot. While \varcode{text} simply prints out the given text string
at the defined position (for example line in at the defined position (for example line in
listing\,\ref{regularsubplotlisting}) the \varcode{annotation} listing\,\ref{regularsubplotlisting}) the \varcode{annotation}
function allows to add some more advanced highlights like arrows, function allows to add some more advanced highlights like arrows,
lines, elipses, or rectangles. Figure\,\ref{annotationsplot} shows lines, ellipses, or rectangles. Figure\,\ref{annotationsplot} shows
some examples, the respective code can be found in some examples, the respective code can be found in
listing\,\ref{annotationsplotlisting}. For more options consult the listing\,\ref{annotationsplotlisting}. For more options consult the
documentation. documentation.