From 792ab47701eef9ed7c77ca44fb642b53189aba33 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 26 Jul 2011 23:26:28 +0000 Subject: numericplots (14jul11) git-svn-id: svn://tug.org/texlive/trunk@23241 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/numericplots/BasicFunctionality.tex | 374 ++++- .../doc/latex/numericplots/DataTestRealData.tex | 129 +- .../doc/latex/numericplots/FurtherExamples.tex | 19 - .../doc/latex/numericplots/MatlabSupport.tex | 77 + .../doc/latex/numericplots/MultiplePlots.tex | 76 +- .../doc/latex/numericplots/NumericPlots.pdf | Bin 108189 -> 153190 bytes .../doc/latex/numericplots/NumericPlotsDoc.tex | 20 +- .../doc/latex/numericplots/README.TEXLIVE | 2 +- .../texmf-dist/doc/latex/numericplots/README.doc | 4 +- .../doc/latex/numericplots/Roll406_Ref2288.tex | 1759 ++++++++++++++++++++ .../doc/latex/numericplots/TechnicalDetails.tex | 11 +- .../doc/latex/numericplots/TestPlots.tex | 176 +- .../texmf-dist/doc/latex/numericplots/history.tex | 41 +- .../latex/numericplots/keys_NumericDataPlot.tex | 54 + .../texmf-dist/doc/latex/numericplots/options.tex | 15 +- 15 files changed, 2485 insertions(+), 272 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/numericplots/MatlabSupport.tex create mode 100644 Master/texmf-dist/doc/latex/numericplots/Roll406_Ref2288.tex create mode 100644 Master/texmf-dist/doc/latex/numericplots/keys_NumericDataPlot.tex (limited to 'Master/texmf-dist/doc/latex/numericplots') diff --git a/Master/texmf-dist/doc/latex/numericplots/BasicFunctionality.tex b/Master/texmf-dist/doc/latex/numericplots/BasicFunctionality.tex index b738a0e4789..3a9298b5f55 100644 --- a/Master/texmf-dist/doc/latex/numericplots/BasicFunctionality.tex +++ b/Master/texmf-dist/doc/latex/numericplots/BasicFunctionality.tex @@ -1,4 +1,4 @@ -% Copyright 2010 Thomas König, Alexander Michel +% Copyright 2010 Thomas Koenig, Alexander Michel % % This file is part of NumericPlots. % @@ -153,7 +153,7 @@ To plot multiple data in one plot call \newline {\IdentI} \listplot[style=StdLineStyB] {\IdentII} - + \putSE{\LegendDefinition{ \LegLine{style=StdLineStyA} & IdentI \\ \LegLine{style=StdLineStyB} & IdentII @@ -188,9 +188,9 @@ The commands \texttt{plotxAxis} and \texttt{plotyAxis} take the options \texttt{LabelOption} and \texttt{TickLabelOption} which may be used to eliminate or change the look of the labels. -Standard values for \texttt{LabelOption} and \texttt{TickLabelOption} may be set -by \verb|\newcommand{\StdLabelOption}{\color{blue}| and -\verb|\newcommand{\StdTickLabelOption}{\small}|. +Standard values for \texttt{LabelOption} and \texttt{TickLabelOption} may be set\\ +by \verb|\newcommand{\StdLabelOption}{\color{blue}|\\ +and \verb|\newcommand{\StdTickLabelOption}{\small}|. The option \texttt{xLabelSep} for \verb|\plotxAxis| (and \texttt{yLabelSep} for \verb|\plotyAxis|) may be used to set the seperation between the axis and the label. Standard value @@ -260,7 +260,7 @@ command NDPput, see the following example. \listplot[style=StdLineStyA] {\IdentI} - + % put some stuff somewhere \NDPput[x=1.2, y=75, RefPoint=br]{text} \NDPput[x=1.2, y=100]{$a^2$} @@ -269,8 +269,8 @@ command NDPput, see the following example. \NDPput[x=1.6, y=100]{\pnode{A}} \NDPput[x=1.8, y=150]{\pnode{B}} % ...and draw a line between them - \ncline{A}{B} - + \ncline{A}{B} + % or put the legend at a specific position \NDPput[x=1.8, y=75]{\LegendDefinition{ \LegLine{style=StdLineStyA} & IdentI @@ -292,7 +292,7 @@ command NDPput, see the following example. \listplot[style=StdLineStyA] {\IdentI} - + % put some stuff somewhere \NDPput[x=1.2, y=75, RefPoint=br]{text} \NDPput[x=1.2, y=100]{$a^2$} @@ -301,8 +301,8 @@ command NDPput, see the following example. \NDPput[x=1.6, y=100]{\pnode{A}} \NDPput[x=1.8, y=150]{\pnode{B}} % ...and draw a line between them - \ncline{A}{B} - + \ncline{A}{B} + % or put the legend at a specific position \NDPput[x=1.8, y=75]{\LegendDefinition{ \LegLine{style=StdLineStyA} & IdentI @@ -310,10 +310,32 @@ command NDPput, see the following example. \end{NumericDataPlot} \end{minipage} -Alternatively, stuff can be placed within the plot with \verb|\rput|. +For convenience the commands \verb|\putXX{object}| where +$XX\in\left(N,S,E,W,NW,NE,SW,SE\right)$ are defined to place something in the +North, South,\ldots, SouthEast corner of the plot. Also, the command +\verb|\putExpY{xx}| and \verb|\putExpX{xx}| may be used to place exponents at +the axes. \begin{minipage}[T]{0.5\linewidth} \begin{verbatim} + \begin{NumericDataPlot} + ... + \putExpY{$\times 10^{-3}$} + \putExpX{$\times 10^{-6}$} + + \putN{N} + \putS{S} + \putW{W} + \putE{E} + \putNW{NW} + \putNE{NE} + \putSW{SW} + \putSE{SE} + \end{NumericDataPlot} + \end{verbatim} +\end{minipage} +\begin{minipage}[T]{0.5\linewidth} + \vspace{10pt} \begin{NumericDataPlot} {\textwidth}{5cm} \setxAxis @@ -326,7 +348,30 @@ Alternatively, stuff can be placed within the plot with \verb|\rput|. \listplot[style=StdLineStyA] {\IdentI} - + + \putExpY{$\times 10^{-3}$} + \putExpX{$\times 10^{-6}$} + + \putN{N} + \putS{S} + \putW{W} + \putE{E} + \putNW{NW} + \putNE{NE} + \putSW{SW} + \putSE{SE} + \end{NumericDataPlot} +\end{minipage} + + +Alternatively, stuff can be placed +within the plot with \verb|\rput|. + +\begin{minipage}[T]{0.5\linewidth} + \begin{verbatim} + \begin{NumericDataPlot} + ... + % put text in the middle of the plot \rput{45}(500,500){text} % put a formula in the lower left corner @@ -336,8 +381,8 @@ Alternatively, stuff can be placed within the plot with \verb|\rput|. \NDPput[x=1.2, y=125]{\pnode{A}} \rput(750,900){\Rnode{B}{peak}} % ...and draw a line between them - \ncline{<-}{A}{B} - + \ncline{<-}{A}{B} + % or put the legend at a specific position \rput{-45}(750,250){\LegendDefinition{ \LegLine{style=StdLineStyA} & IdentI @@ -359,7 +404,7 @@ Alternatively, stuff can be placed within the plot with \verb|\rput|. \listplot[style=StdLineStyA] {\IdentI} - + % put text in the middle of the plot \rput{45}(500,500){text} % put a formula in the lower left corner @@ -369,8 +414,8 @@ Alternatively, stuff can be placed within the plot with \verb|\rput|. \NDPput[x=1.2, y=125]{\pnode{A}} \rput(750,900){\Rnode{B}{peak}} % ...and draw a line between them - \ncline{<-}{A}{B} - + \ncline{<-}{A}{B} + % or put the legend at a specific position \rput{-45}(750,250){\LegendDefinition{ \LegLine{style=StdLineStyA} & IdentI @@ -380,7 +425,184 @@ Alternatively, stuff can be placed within the plot with \verb|\rput|. -\subsection{Line Styles} +% ================================= +% | | +% | Linestyles and colors | +% | | +% ================================= + +\subsection{Linestyles and colors} + +While using the package, there are predefined linestyles which may be used: + +\begin{minipage}{0.6\linewidth} + \centering + \small + + \input{DataTestRealData} + + \begin{NumericDataPlot}[]{\linewidth}{0.7\linewidth} + \setxAxis{xMin=2, xMax=17, xO=5, Dx=4} + \setyAxis{yMin=20, yMax=70, yO=20, Dy=20} + + \plotxAxis[NoLabel, AxisStyle=Boxed]{} + \plotyAxis[NoLabel, AxisStyle=Boxed]{} + + \listplot[style=StdLineStyA]{\DataA} + \listplot[style=StdLineStyB]{\DataB} + \listplot[style=StdLineStyC]{\DataC} + \listplot[style=StdLineStyD]{\DataD} + \listplot[style=StdLineStyE]{\DataE} + \listplot[style=StdLineStyF]{\DataF} + \listplot[style=StdLineStyG]{\DataG} + \end{NumericDataPlot} +\end{minipage} +\begin{minipage}{0.4\linewidth} + \centering + \LegendDefinition{ + \LegLine{style=StdLineStyA} & StdLineStyA \\ + \LegLine{style=StdLineStyB} & StdLineStyB \\ + \LegLine{style=StdLineStyC} & StdLineStyC \\ + \LegLine{style=StdLineStyD} & StdLineStyD \\ + \LegLine{style=StdLineStyE} & StdLineStyE \\ + \LegLine{style=StdLineStyF} & StdLineStyF \\ + \LegLine{style=StdLineStyG} & StdLineStyG \\ + } +\end{minipage} + +When using the package option \texttt{BW} the standard line styles will be +replaced by their black and white counterparts: + +\begin{minipage}{0.6\linewidth} + \centering + \small + + \input{DataTestRealData} + + \begin{NumericDataPlot}[]{\linewidth}{0.7\linewidth} + \setxAxis{xMin=2, xMax=17, xO=5, Dx=4} + \setyAxis{yMin=20, yMax=70, yO=20, Dy=20} + + \plotxAxis[NoLabel, AxisStyle=Boxed]{} + \plotyAxis[NoLabel, AxisStyle=Boxed]{} + + \listplot[style=BWStdLineStyA]{\DataA} + \listplot[style=BWStdLineStyB]{\DataB} + \listplot[style=BWStdLineStyC]{\DataC} + \listplot[style=BWStdLineStyD]{\DataD} + \listplot[style=BWStdLineStyE]{\DataE} + \listplot[style=BWStdLineStyF]{\DataF} + \listplot[style=BWStdLineStyG]{\DataG} + \end{NumericDataPlot} +\end{minipage} +\begin{minipage}{0.4\linewidth} + \centering + \LegendDefinition{ + \LegLine{style=BWStdLineStyA} & BWStdLineStyA \\ + \LegLine{style=BWStdLineStyB} & BWStdLineStyB \\ + \LegLine{style=BWStdLineStyC} & BWStdLineStyC \\ + \LegLine{style=BWStdLineStyD} & BWStdLineStyD \\ + \LegLine{style=BWStdLineStyE} & BWStdLineStyE \\ + \LegLine{style=BWStdLineStyF} & BWStdLineStyF \\ + \LegLine{style=BWStdLineStyG} & BWStdLineStyG \\ + } +\end{minipage} + +For values which are nearly the same (reference and measurement, e.g.) the +following line styles may be used: + +\begin{minipage}{0.6\linewidth} + \centering + \small + + \input{DataTestRealData} + + \begin{NumericDataPlot}[]{\linewidth}{0.7\linewidth} + \setxAxis{xMin=2, xMax=17, xO=5, Dx=4} + \setyAxis{yMin=20, yMax=70, yO=20, Dy=20} + + \plotxAxis[NoLabel, AxisStyle=Boxed]{} + \plotyAxis[NoLabel, AxisStyle=Boxed]{} + + \listplot[style=StdLineStyX]{\DataC} + \listplot[style=StdLineStyY]{\DataC} + + \listplot[style=BWStdLineStyX]{\DataD} + \listplot[style=BWStdLineStyY]{\DataD} + \end{NumericDataPlot} +\end{minipage} +\begin{minipage}{0.4\linewidth} + \centering + \LegendDefinition{ + \LegLine{style=StdLineStyX} & StdLineStyX \\ + \LegLine{style=StdLineStyY} & StdLineStyY \\ + \LegLine{style=BWStdLineStyX} & BWStdLineStyX \\ + \LegLine{style=BWStdLineStyY} & BWStdLineStyY \\ + } +\end{minipage} + +It is, of course, possible to redefine the available linestyles or to define new +linestyles. + +\begin{minipage}[T]{0.5\linewidth} + \begin{verbatim} + \definecolor{MyColor}{cmyk}{0.6 0.21 1.0 0.2} + \newpsstyle{MyLine} + {linecolor=MyColor, linewidth=2pt, + linestyle=dashed, + dash=1pt 1pt 4pt 1pt 1pt 3pt, + dotstyle=*, showpoints=true, + dotsize=5pt} + \newpsstyle{MyLineA} + {linecolor=blue, linestyle=dotted, + dotstyle=asterisk, showpoints=true} + + \listplot[style=MyLine] + {\IdentI} + \listplot[style=MyLineA] + {\IdentII} + + \putSE{\LegendDefinition{ + \LegLine{style=MyLine} & IdentI + \LegLine{style=MyLineA} & IdentII + }} + \end{verbatim} +\end{minipage} +\begin{minipage}[T]{0.5\linewidth} + \begin{NumericDataPlot} + {\textwidth}{5cm} + + \definecolor{MyColor}{cmyk}{0.6 0.21 1.0 0.2} + \newpsstyle{MyLine}{linecolor=MyColor, linewidth=2pt, linestyle=dashed, + dash=1pt 1pt 4pt 1pt 1pt 3pt, dotstyle=*, showpoints=true, dotsize=5pt} + \newpsstyle{MyLineA}{linecolor=blue, linestyle=dotted, + dotstyle=asterisk, showpoints=true} + + \setxAxis + {xMin=1, xMax=1.6, Dx=0.2} + \setyAxis + {yMin=50, yMax=150, Dy=25} + + \plotxAxis[NoLabel]{} + \plotyAxis[NoLabel]{} + + \listplot[style=MyLine] + {\IdentI} + \listplot[style=MyLineA] + {\IdentII} + + \putSE{\LegendDefinition{ + \LegLine{style=MyLine} & IdentI + }} + \end{NumericDataPlot} +\end{minipage} + + +% ================================= +% | | +% | Legend | +% | | +% ================================= \subsection{Legend} @@ -400,15 +622,23 @@ follwing examples. \LegLine{style=StdLineStyB, linewidth=3pt} & second legend } \begin{verbatim} + \newpsstyle{LegendBoxStyle}% + {framearc=0.2, fillstyle=solid, fillcolor=yellow, opacity=0.2} \LegendDefinition[nrCols=2]{ \LegLine{style=StdLineStyA} & IdentI & \LegLine{style=StdLineStyB, linewidth=3pt} & legend 2 + \newpsstyle{LegendBoxStyle}% + {fillstyle=solid, fillcolor=white} } \end{verbatim} + \newpsstyle{LegendBoxStyle}% + {framearc=0.2, fillstyle=solid, fillcolor=yellow, opacity=0.2} \LegendDefinition[nrCols=2]{ \LegLine{style=StdLineStyA} & IdentI & \LegLine{style=StdLineStyB, linewidth=3pt} & legend 2 } + \newpsstyle{LegendBoxStyle}% + {fillstyle=solid, fillcolor=white} \begin{verbatim} \LegendDefinition[LabelOrientation=c]{ \LegLine{style=StdLineStyA} & IdentI\\ @@ -427,7 +657,7 @@ follwing examples. \subsection{Add Lines to the Plot} Horizontal and vertical lines may be added to the plot with the commands -\verb|\NDPhline{coord}| and \verb|\NDPvline{coord}|. It is also possible to put +\verb|\NDPhline{coord}|, \verb|\NDPvline{coord}| and \verb|\NDPline{coord}|. It is also possible to put nodes and draw lines between them, see placing stuff\ldots \begin{minipage}[T]{0.5\linewidth} @@ -444,7 +674,7 @@ nodes and draw lines between them, see placing stuff\ldots \listplot[style=StdLineStyA] {\IdentI} - + \NDPhline[linecolor=LineColorD]{73} \NDPvline[linecolor=LineColorE, linestyle=dashed]{1.5} \NDPline[linecolor=red]{1.1}{75}{1.3}{125} @@ -465,14 +695,70 @@ nodes and draw lines between them, see placing stuff\ldots \listplot[style=StdLineStyA] {\IdentI} - + \NDPhline[linecolor=LineColorD]{73} \NDPvline[linecolor=LineColorE, linestyle=dashed]{1.5} \NDPline[linecolor=red]{1.1}{75}{1.3}{125} \end{NumericDataPlot} \end{minipage} +\subsection{Add Boxes to the Plot} +Horizontal and vertical boxes may be added to the plot with the commands +\verb|\NDPhbox{coord}|, \verb|\NDPvbox{coord}| and \verb|\NDPbox{coord}|. It is also possible to put +nodes and draw lines between them, see placing stuff\ldots + +\begin{minipage}[T]{0.5\linewidth} + \begin{verbatim} + \begin{NumericDataPlot} + {\textwidth}{5cm} + \setxAxis + {xMin=1, xMax=1.6, Dx=0.2} + \setyAxis + {yMin=50, yMax=150, Dy=25} + + \plotxAxis[NoLabel]{} + \plotyAxis[NoLabel]{} + + \NDPhbox[fillstyle=solid,fillcolor=green]% + {75.0}{100.0}% + + \listplot[style=StdLineStyA] {\IdentI} + + \NDPvbox[fillstyle=solid,fillcolor=red] + {1.4}{1.5} + + \NDPbox[fillstyle=solid,% + fillcolor=orange, opacity=0.2, linestyle=none]% + {1.1}{60}{1.15}{130} + \end{NumericDataPlot} + \end{verbatim} +\end{minipage} +\begin{minipage}[T]{0.5\linewidth} + \vspace{10pt} + \begin{NumericDataPlot} + {\textwidth}{5cm} + \setxAxis + {xMin=1, xMax=1.6, Dx=0.2} + \setyAxis + {yMin=50, yMax=150, Dy=25} + + \plotxAxis[NoLabel]{} + \plotyAxis[NoLabel]{} + + \NDPhbox[fillstyle=solid,fillcolor = green]% + {75.0}{100.0}% + + \listplot[style=StdLineStyA] {\IdentI} + + \NDPvbox[fillstyle=solid,fillcolor=red] + {1.4}{1.5} + + \NDPbox[fillstyle=solid,% + fillcolor=orange, opacity=0.2, linestyle=none]% + {1.1}{60}{1.15}{130} + \end{NumericDataPlot} +\end{minipage} \subsection{Grid} @@ -586,47 +872,3 @@ the axis. To avoid this, plot the grid first and then plot the axis as shown. -\subsection{export2latex.m} - -The function \texttt{export2latex(data, filename, [options])} may be used to -export data from Matlab to be used with NumericPlots.sty. The function takes the two parameters -data and filename, where filename is the name of the file where the data should -be stored with full path but without extension. Data is a structure with the -three entries x, y, and ident, where x are the x-data, y the y-data and ident is -an identifier to have access to the data in Latex. To access the data in Latex -the command \verb+\Data+ is used. - -The parameter data may be provided as an 1xK array if each entry of the array is -a structure with the entries x, y and ident. There may be an additional entry -descr. -\begin{itemize} - \item data(1,i).x = $X_i$ - \item data(1,i).y = $Y_i$ - \item data(1,i).ident = Identifier - \item (data(1,i).descr = Description) -\end{itemize} -Identifier must be a valid Latex command name, which basically means it must be -a string without numbers. - -For every entry of data, $X$ and $Y$ must be arrays of the same size -$M\text{x}N$. If $M>1$, each column of the array is exported to the file and the -identifier is expanded by the roman representation of the column number. - -It might be useful to do a \texttt{interp1} before exporting the data to get -smaller files and to use less of \TeX's memory. ($\rightarrow$ script -Patrick?!?) - -The optional parameter \texttt{options} might be used to control which -additional information is provided in the output file. -\begin{itemize} - \item \texttt{options.DataBoundaries} [true] If set to true, the output file - contains the commands \verb+\DataXmin+, \verb+\DataXmax+, \verb+\DataYmin+ and - \verb+\DataYmax+ which may be used to define the axis. - \item \texttt{options.AxisBoundaries} [false] If set to true, the output file - contains the commands \verb+\DataXminAxis+, \verb+\DataXmaxAxis+, - \verb+\DataYminAxis+ and \verb+\DataYmaxAxis+ which may be used to define the - axis. In contrary to the DataBoundaries the AxisBoundaries add an additional - gap of \texttt{options.AxisBoundariesGap} [10] percent of the full scale to - the data boundaries such that the plot doesn't touch the axis. -\end{itemize} - diff --git a/Master/texmf-dist/doc/latex/numericplots/DataTestRealData.tex b/Master/texmf-dist/doc/latex/numericplots/DataTestRealData.tex index 6941e99a213..985ee468f20 100644 --- a/Master/texmf-dist/doc/latex/numericplots/DataTestRealData.tex +++ b/Master/texmf-dist/doc/latex/numericplots/DataTestRealData.tex @@ -1,7 +1,7 @@ % data written by export2latex % date: 10-Mar-2010 -\def\DataDBforce{ +\def\DataA{ 2 58.828 3 56.353 4 58.817 @@ -20,37 +20,7 @@ 17 48.876 } -\def\DataDBforceC{ -2 50.828 -3 50.353 -4 56.817 -} - -\def\DataDBforceD{ -2 40.828 -3 40.353 -4 46.817 -} - -\def\DataDBforceE{ -2 30.828 -3 30.353 -4 36.817 -} - -\def\DataDBforceF{ -2 20.828 -3 20.353 -4 26.817 -} - -\def\DataDBforceG{ -2 60.828 -3 60.353 -4 66.817 -} - -\def\DataRESforce{ +\def\DataB{ 2 62.894 3 59.824 4 59.908 @@ -68,6 +38,101 @@ 16 30.646 17 28.224 } +\def\DataC{ + 2.0000 52.5244 + 3.0000 52.9925 + 4.0000 52.7279 + 5.0000 51.7954 + 6.0000 50.4234 + 7.0000 48.9477 + 8.0000 47.7296 + 9.0000 47.0674 + 10.0000 47.1232 + 11.0000 47.8834 + 12.0000 49.1618 + 13.0000 50.6454 + 14.0000 51.9710 + 15.0000 52.8140 + 16.0000 52.9681 + 17.0000 52.3955 +} + +\def\DataD{ +2.0000 48.9294 + 3.0000 47.7015 + 4.0000 46.1762 + 5.0000 44.5214 + 6.0000 42.9193 + 7.0000 41.5462 + 8.0000 40.5534 + 9.0000 40.0500 + 10.0000 40.0916 + 11.0000 40.6736 + 12.0000 41.7318 + 13.0000 43.1498 + 14.0000 44.7715 + 15.0000 46.4183 + 16.0000 47.9090 + 17.0000 49.0795 +} + +\def\DataE{ + 2.0000 55.0918 + 3.0000 57.2074 + 4.0000 58.8597 + 5.0000 59.9770 + 6.0000 60.5465 + 7.0000 60.6154 + 8.0000 60.2864 + 9.0000 59.7056 + 10.0000 59.0472 + 11.0000 58.4936 + 12.0000 58.2160 + 13.0000 58.3549 + 14.0000 59.0052 + 15.0000 60.2054 + 16.0000 61.9334 + 17.0000 64.1090 +} + +\def\DataF{ +2 20.828 +3 20.353 +4 26.817 +5 20.828 +6 20.353 +7 26.817 +8 22.828 +9 23.353 +10 24.817 +11 20.828 +12 28.353 +13 26.817 +14 22.828 +15 27.353 +16 26.817 +17 24.9 +} + +\def\DataG{ + 2.0000 34.2537 + 3.0000 33.1056 + 4.0000 32.5301 + 5.0000 32.3504 + 6.0000 32.4343 + 7.0000 32.6791 + 8.0000 33.0000 + 9.0000 33.3209 + 10.0000 33.5657 + 11.0000 33.6496 + 12.0000 33.4699 + 13.0000 32.8944 + 14.0000 31.7463 + 15.0000 29.7847 + 16.0000 26.6776 + 17.0000 21.9643 +} + \def\DataDBhex{ 2 93 diff --git a/Master/texmf-dist/doc/latex/numericplots/FurtherExamples.tex b/Master/texmf-dist/doc/latex/numericplots/FurtherExamples.tex index 458a1906899..f770c7ebc45 100644 --- a/Master/texmf-dist/doc/latex/numericplots/FurtherExamples.tex +++ b/Master/texmf-dist/doc/latex/numericplots/FurtherExamples.tex @@ -1,22 +1,3 @@ -% Copyright 2010 Thomas König, Alexander Michel -% -% This file is part of NumericPlots. -% -% NumericPlots is free software: you can redistribute it and/or modify -% it under the terms of the GNU General Public License as published by -% the Free Software Foundation, either version 3 of the License, or -% any later version. -% -% NumericPlots is distributed in the hope that it will be useful, -% but WITHOUT ANY WARRANTY; without even the implied warranty of -% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -% GNU General Public License for more details. -% -% You should have received a copy of the GNU General Public License -% along with NumericPlots. If not, see . - -\part{Examples} - \section{Further Examples} \def\MoreData{ diff --git a/Master/texmf-dist/doc/latex/numericplots/MatlabSupport.tex b/Master/texmf-dist/doc/latex/numericplots/MatlabSupport.tex new file mode 100644 index 00000000000..32802955b88 --- /dev/null +++ b/Master/texmf-dist/doc/latex/numericplots/MatlabSupport.tex @@ -0,0 +1,77 @@ +\subsection{export2latex.m} + +The function \texttt{export2latex(data, filename, [options])} may be used to +export data from Matlab to be used with NumericPlots.sty. The function takes the two parameters +data and filename, where filename is the name of the file where the data should +be stored with full path but without extension. Data is a structure with the +three entries x, y, and ident, where x are the x-data, y the y-data and ident is +an identifier to have access to the data in Latex. To access the data in Latex +the command \verb+\Data+ is used. + +The parameter data may be provided as an 1xK array if each entry of the array is +a structure with the entries x, y and ident. There may be an additional entry +descr. +\begin{itemize} + \item data(1,i).x = $X_i$ + \item data(1,i).y = $Y_i$ + \item data(1,i).ident = Identifier + \item (data(1,i).descr = Description) +\end{itemize} +Identifier must be a valid Latex command name, which basically means it must be +a string without numbers. + +For every entry of data, $X$ and $Y$ must be arrays of the same size +$M\text{x}N$. If $M>1$, each column of the array is exported to the file and the +identifier is expanded by the roman representation of the column number. + +It might be useful to do a \texttt{interp1} before exporting the data to get +smaller files and to use less of \TeX's memory. ($\rightarrow$ script +Patrick?!?) + +The optional parameter \texttt{options} might be used to control which +additional information is provided in the output file. +\begin{itemize} + \item \texttt{options.DataBoundaries} [true] If set to true, the output file + contains the commands \verb+\DataXmin+, \verb+\DataXmax+, \verb+\DataYmin+ and + \verb+\DataYmax+ which may be used to define the axis. + \item \texttt{options.AxisBoundaries} [false] If set to true, the output file + contains the commands \verb+\DataXminAxis+, \verb+\DataXmaxAxis+, + \verb+\DataYminAxis+ and \verb+\DataYmaxAxis+ which may be used to define the + axis. In contrary to the DataBoundaries the AxisBoundaries add an additional + gap of \texttt{options.AxisBoundariesGap} [10] percent of the full scale to + the data boundaries such that the plot doesn't touch the axis. +\end{itemize} + +\subsection{struct2latex.m} +The function \texttt{struct2latex(data,[xname],[downsample],[filename],[postfix],[options])} may be used to export a Matlab struct to be used with NumericPlots.sty. The function is based on export2latex and the \verb+options+ argument is given to export2latex. The optional argument \verb+xname+ specifies the fieldname of the x-data. If no \verb+xname+ is given, you have to chose one via popup. All other fields are treated like y-data. Furthermore, the identifier of the y-data are equal to the fieldnames and have to be valid Latex commands (fieldnames with numbers are not supported). The struct2latex command only supports 1 dimensional arrays (row vectors). Column vectors are mapped for propper export without warning. With the optional argument \verb+downsample+ (integer>0) it is possible to downsample the data for smaller files. A warning is given when data points exceed $5000$. Usually $1000$ data points are enough for a propper plot in latex. The optional argument \verb+filename+ specifies the outputname with path of the texfile. If no filename is given, it has to be chosen via popup. The optional argument \verb+postfix+ can be used to put a postfix after the fieldname in the identifier of the y-data. The \verb+options+ argument is also optional and equal to the options argument of the function export2latex. + +Matlab example. +\begin{verbatim} + % data for struct2latex should be row-vectors. anyway, column-vectors are + % mapped to row-vectors. matrices are not supported + + %% export row-vectors + t = [1:0.1:10]; + + data.time = t; + data.sin = sin(t); + data.cos = cos(t); + data.exp = exp(t); + data.tan = tan(t); + + %struct2latex(data,xname,downsample,filename,postfix,options) + %downsample,filename,postfix,options are optional arguments + struct2latex(data,'time',1,'texdataA','row'); +\end{verbatim} + +\subsection{dspace2struct} +The function \texttt{dspace2struct(dataname,version)} may be used to import \texttt{.mat} created by \textsc{dSpace} to \textsc{Matlab}. It returns a \textsc{Matlab} struct out of the provided variables \verb+dataname+ and \verb+version+. Thereby \verb+dataname+ is the name of the \textsc{dSpace} \verb+.mat+ file and the optional string argument \verb+version+ has to be equal \verb+version = 'NG'+ if \textsc{dSpace Control Desk Next Generation} is used. It is convenient to chose a unique signal name in \textsc{Matlab/Simulink} because they will be the same in \textsc{dSpace}. The function \texttt{dspace2struct(dataname,version)} just adopts the names provided by \textsc{dSpace} and use them as fieldnames. The time vector will always be called \verb+.time+. + +Matlab example. +\begin{verbatim} + dataOG = dspace2struct(measurements) %Old Control Desk + dataNG = dspace2struct(measurements,'NG') %Control Desk Next Generation +\end{verbatim} + +\subsection{dspace2latex} +The function \texttt{dspace2latex} is just a combination of \texttt{dspace2struct} and \texttt{struct2latex} with commonly used arguments. It is a simple and quick way to export measurements from \textsc{dSpace} to \LaTeX{} without any revision of the data. \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/numericplots/MultiplePlots.tex b/Master/texmf-dist/doc/latex/numericplots/MultiplePlots.tex index e286e1fa9cf..b2490bcf445 100644 --- a/Master/texmf-dist/doc/latex/numericplots/MultiplePlots.tex +++ b/Master/texmf-dist/doc/latex/numericplots/MultiplePlots.tex @@ -1,4 +1,4 @@ -% Copyright 2010 Thomas König, Alexander Michel +% Copyright 2010 Thomas Koenig, Alexander Michel % % This file is part of NumericPlots. % @@ -45,13 +45,13 @@ showpoints=true, dotsize=10pt} \plotxAxis{Stichnummer} \plotyAxis{$F_{roll}$ in $\mega\newton$} - \listplot[style=Database]{\DataDBforce} - \listplot[style=Result]{\DataRESforce} - \listplot[style=StdLineStyC]{\DataDBforceC} - \listplot[style=StdLineStyD]{\DataDBforceD} - \listplot[style=StdLineStyE]{\DataDBforceE} - \listplot[style=StdLineStyF]{\DataDBforceF} - \listplot[style=StdLineStyG]{\DataDBforceG} + \listplot[style=Database]{\DataA} + \listplot[style=Result]{\DataB} + \listplot[style=StdLineStyC]{\DataC} + \listplot[style=StdLineStyD]{\DataD} + \listplot[style=StdLineStyE]{\DataE} + \listplot[style=StdLineStyF]{\DataF} + \listplot[style=StdLineStyG]{\DataG} % set the y-axis for the plot in the middle of the left side % x-axis remains the same @@ -62,8 +62,8 @@ showpoints=true, dotsize=10pt} \rput[t]{0}(250,550){a) Ein plot} - \listplot[style=Database]{\DataDBforce} - \listplot[style=Result]{\DataRESforce} + \listplot[style=Database]{\DataA} + \listplot[style=Result]{\DataB} % set axis for the plot at the right side \setxAxis{xMin=2, xMax=17, Dx=4, xCoordMin=600, xCoordMax=1050} @@ -73,13 +73,13 @@ showpoints=true, dotsize=10pt} \plotxAxis{Stichnummer} \plotyAxis[NoLabel, TickSep=10]{$F_{roll}$ in $\mega\newton$} - \listplot[style=Database]{\DataDBforce} - \listplot[style=Result]{\DataRESforce} - \listplot[style=StdLineStyC]{\DataDBforceC} - \listplot[style=StdLineStyD]{\DataDBforceD} - \listplot[style=StdLineStyE]{\DataDBforceE} - \listplot[style=StdLineStyF]{\DataDBforceF} - \listplot[style=StdLineStyG]{\DataDBforceG} + \listplot[style=Database]{\DataA} + \listplot[style=Result]{\DataB} + \listplot[style=StdLineStyC]{\DataC} + \listplot[style=StdLineStyD]{\DataD} + \listplot[style=StdLineStyE]{\DataE} + \listplot[style=StdLineStyF]{\DataF} + \listplot[style=StdLineStyG]{\DataG} % set the axis for the plot at the top \setxAxis{xMin=8, xMax=17, Dx=1, xCoordMin=0, xCoordMax=1050} @@ -90,8 +90,8 @@ showpoints=true, dotsize=10pt} \plotyAxis[NoLabel]{$F_{roll}$ in $\mega\newton$} % plot only part of the data - \listplot[style=Database, xStart=11, xEnd=17]{\DataDBforce} - \listplot[style=Result, xStart=8, xEnd=13]{\DataRESforce} + \listplot[style=Database, xStart=11, xEnd=17]{\DataA} + \listplot[style=Result, xStart=8, xEnd=13]{\DataB} \end{NumericDataPlot} @@ -123,13 +123,13 @@ showpoints=true, dotsize=10pt} \plotxAxis{Stichnummer} \plotyAxis{$F_{roll}$ in $\mega\newton$} - \listplot[style=Database]{\DataDBforce} - \listplot[style=Result]{\DataRESforce} - \listplot[style=StdLineStyC]{\DataDBforceC} - \listplot[style=StdLineStyD]{\DataDBforceD} - \listplot[style=StdLineStyE]{\DataDBforceE} - \listplot[style=StdLineStyF]{\DataDBforceF} - \listplot[style=StdLineStyG]{\DataDBforceG} + \listplot[style=Database]{\DataA} + \listplot[style=Result]{\DataB} + \listplot[style=StdLineStyC]{\DataC} + \listplot[style=StdLineStyD]{\DataD} + \listplot[style=StdLineStyE]{\DataE} + \listplot[style=StdLineStyF]{\DataF} + \listplot[style=StdLineStyG]{\DataG} % set the y-axis for the plot in the middle of the left side % x-axis remains the same @@ -140,8 +140,8 @@ showpoints=true, dotsize=10pt} \rput[t]{0}(250,550){a) Ein plot} - \listplot[style=Database]{\DataDBforce} - \listplot[style=Result]{\DataRESforce} + \listplot[style=Database]{\DataA} + \listplot[style=Result]{\DataB} % set axis for the plot at the right side \setxAxis{xMin=2, xMax=17, Dx=4, xCoordMin=600, xCoordMax=1050} @@ -151,13 +151,13 @@ showpoints=true, dotsize=10pt} \plotxAxis{Stichnummer} \plotyAxis[NoLabel, TickSep=10]{$F_{roll}$ in $\mega\newton$} - \listplot[style=Database]{\DataDBforce} - \listplot[style=Result]{\DataRESforce} - \listplot[style=StdLineStyC]{\DataDBforceC} - \listplot[style=StdLineStyD]{\DataDBforceD} - \listplot[style=StdLineStyE]{\DataDBforceE} - \listplot[style=StdLineStyF]{\DataDBforceF} - \listplot[style=StdLineStyG]{\DataDBforceG} + \listplot[style=Database]{\DataA} + \listplot[style=Result]{\DataB} + \listplot[style=StdLineStyC]{\DataC} + \listplot[style=StdLineStyD]{\DataD} + \listplot[style=StdLineStyE]{\DataE} + \listplot[style=StdLineStyF]{\DataF} + \listplot[style=StdLineStyG]{\DataG} % set the axis for the plot at the top \setxAxis{xMin=8, xMax=17, Dx=1, xCoordMin=0, xCoordMax=1050} @@ -168,8 +168,8 @@ showpoints=true, dotsize=10pt} \plotyAxis[NoLabel]{$F_{roll}$ in $\mega\newton$} % plot only part of the data - \listplot[style=Database, xStart=11, xEnd=17]{\DataDBforce} - \listplot[style=Result, xStart=8, xEnd=13]{\DataRESforce} + \listplot[style=Database, xStart=11, xEnd=17]{\DataA} + \listplot[style=Result, xStart=8, xEnd=13]{\DataB} \end{NumericDataPlot} @@ -177,4 +177,4 @@ showpoints=true, dotsize=10pt} \LegendDefinition[nrCols=1, LabelOrientation=r]{ \LegLine{style=Database} & Werte aus der Datenbank \\ \LegLine{style=Result} & Modell} -\end{center} \ No newline at end of file +\end{center} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/numericplots/NumericPlots.pdf b/Master/texmf-dist/doc/latex/numericplots/NumericPlots.pdf index c0816a9f8b0..35f89558c41 100644 Binary files a/Master/texmf-dist/doc/latex/numericplots/NumericPlots.pdf and b/Master/texmf-dist/doc/latex/numericplots/NumericPlots.pdf differ diff --git a/Master/texmf-dist/doc/latex/numericplots/NumericPlotsDoc.tex b/Master/texmf-dist/doc/latex/numericplots/NumericPlotsDoc.tex index 9d6cbdb98fe..53cabbab2f5 100644 --- a/Master/texmf-dist/doc/latex/numericplots/NumericPlotsDoc.tex +++ b/Master/texmf-dist/doc/latex/numericplots/NumericPlotsDoc.tex @@ -1,4 +1,4 @@ -% Copyright 2010 Thomas König, Alexander Michel, Michael Baumgart +% Copyright 2010 Thomas Koenig, Alexander Michel, Michael Baumgart % % This file is part of NumericPlots. % @@ -22,6 +22,7 @@ % \usepackage{floatbarrier} % \usepackage{showexpl} \usepackage{etex} % use e-TeX’s extended register set + % options for package: % BW: black and white % AxisStyle=