[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
presentaions of data. Several of the effects have been axaggerated to
make the point. A little more subtlely these methods are employed to
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}.
@ -75,7 +75,7 @@ more examples on \url{https://en.wikipedia.org/wiki/Misleading_graph}.
\includegraphics[width=0.35\textwidth]{misleading_pie}
\hspace{0.05\textwidth}
\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
highlighted segment \textbf{C} gains more weight than it should
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}
\begin{figure}[p]
\begin{minipage}[t]{0.3\textwidth}
\includegraphics[width=0.9\textwidth]{line_graph1}
\end{minipage}
\begin{minipage}[t]{0.3\textwidth}
\includegraphics[width=0.9\textwidth]{line_graph1_3}
\end{minipage}
\begin{minipage}[t]{0.3\textwidth}
\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}
\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]
@ -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
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 catergory \textbf{B} has been scaled to
triple heigth while maintaining the porpotions. This appears jusst
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.
@ -217,15 +209,15 @@ number of datasets.
\subsection{Simple plotting}
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
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
function the current plot will be replaced unless the the
\code[hold]{hold on} command was issued before. If it was, the current
plot is held and a second line will be added to it. Calling
\code[hold]{hold off} will release the plot and any subsequent
plotting will replace the previous plot.
function the current plot will be replaced unless the \code[hold]{hold
on} command was issued before. If it was, the current plot is held
and a second line will be added to it. Calling \code[hold]{hold off}
will release the plot and any subsequent plotting will replace the
previous plot.
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
@ -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
the same standard settings. The order of the used colors depends on
the \enterm{colormap} settings which can be adjusted to personal taste
or need. Table\,\ref{plotlinestyles} shows some predefined values
that can be chosen for the line style, the marker, or the color. For
or need. Table\,\ref{plotlinestyles} shows some predefined values that
can be chosen for the line style, the marker, or the color. For
additional options consult the help.
\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
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
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
can be explicitly set with the functions \code[xlim()]{xlim()} and
\code[ylim()]{ylim()} functions. To do this, the functions expect a
@ -348,15 +340,15 @@ example.
\subsection{Changing the figure properties}
\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}
\begin{tabular*}{1\textwidth}{lp{6.6cm}p{5.7cm}} \hline
\textbf{property} & \textbf{description} & \textbf{options}
\erh \\
\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{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'\}$\\
\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*}
@ -472,8 +464,8 @@ figures\,\ref{regularsubplotsfig}, \ref{irregularsubplotsfig}).
grid \figref{regularsubplotsfig}.}, label=regularsubplotlisting,
basicstyle=\ttfamily\scriptsize]{regular_subplot.m}
By default, all suplots have the same size, if something else is
desired, e.g., one suplot should span a whole row, while two others
By default, all subplots have the same size, if something else is
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
argument of \varcode{subplot} can be a vector or numbers that should
be joined. These have, of course, be adjacent numbers
@ -483,7 +475,7 @@ listing\,\ref{irregularsubplotslisting}).
\begin{figure}[ht]
\includegraphics[width=0.5\linewidth]{irregular_subplot}
\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
listing\,\ref{irregularsubplotslisting}}\label{irregularsubplotsfig}
\end{figure}
@ -500,6 +492,7 @@ used cells of the grid by passing a vector as the third argument to
label=irregularsubplotslisting,
basicstyle=\ttfamily\scriptsize]{irregular_subplot.m}
\subsection{Annotations, text}
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
listing\,\ref{regularsubplotlisting}) the \varcode{annotation}
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
listing\,\ref{annotationsplotlisting}. For more options consult the
documentation.