Warning, /education/labplot/doc/latex/using.tex is written in an unsupported language. File is not indexed.

0001 \part{Using LabPlot}
0002 
0003 \chapter{Interface}\label{ch:interface}
0004 \section{Main Area}\label{sec:main_area}
0005 \section{Project Explorer}\label{sec:project_explorer}
0006 \section{Properties Explorer}\label{sec:properties_explorer}
0007 \section{Worksheet}\label{sec:worksheet}
0008 
0009 \chapter{Data Containers}\label{ch:data_container}
0010 \section{Spreadsheet}\label{sec:spreadsheet}
0011 The spreadsheet is the main part of LabPlot when working with data and consists of columns.
0012 Column is the basic data set in LabPlot used for plotting and data analysis.
0013 Every column of the spreadsheet is specified by its name and the type - numeric, text, month names, day names and date and time.
0014 Also, for each type different representation formats can be assigned like decimal or scientific format for numeric columns etc.
0015 
0016 You can mask selected data points in the spreadsheet (\menuchoice{Selection}{Mask Selection} from the spreadsheet cell context menu).
0017 Masked data is not plotted and is also excluded from data analysis functions like fitting etc.
0018 Alternatively, you can mask or drop values in a column (\menuitem{Mask Values} or \menuitem{Drop Values} from the column context menu) by specifying a range.
0019 When specifying which values to mask or to drop, several operators (“equal to”, “greater than”, “lesser than”, etc.) are available.
0020 These operations can help to hide or to remove some outliers in the data set prior to, e.g., performing a fit to this data set.
0021 
0022 Any spreadsheet function can be reached via the context menu (\rmb).
0023 You can cut, copy and paste between spreadsheets, generate, normalize and sort data and finally make plots out of your data.
0024 \begin{figure}
0025 \includegraphics[width=\textwidth]{images/spreadsheet.png}
0026 \caption{Spreadsheet showing some imported data.}
0027 \end{figure}
0028 
0029 New data can be produced either by entering it manually in the spreadsheet or by generating the data according to a certain prescription.
0030 LabPlot provides 5 different methods to generate data, accessible via the context menu of the column:
0031 \begin{itemize}
0032 \item \textbf{Row Numbers} - values in the column are set according to its row number, this provide an easy way to quickly create an index.
0033 %
0034 \item \textbf{Constant Values} - values in the column are set to a constant value provided by the user.
0035 %
0036 \item \textbf{Equidistant values} (for numeric columns only) - given the minimal and the maximal values, the equidistant values can be either generated
0037 by fixing the total number of values in that range or by fixing the increment (distance).
0038 %
0039 \item \textbf{Random values} (for numeric columns only) - values are randomly generated according to the selected distribution.
0040 To generate uniformly distributed random numbers, select "Flat" distribution.
0041 In the simplest cases a non-uniform distribution is calculated analytically from the uniform distribution of a random number generator by applying
0042 an appropriate transformation. More complicated distributions are created by the acceptance-rejection method, which compares the desired distribution
0043 against a distribution which is similar and known analytically.
0044 %
0045 \item \textbf{Function values} (for numeric columns only) - values are generated according to a mathematical function provided by the user,
0046 a column (data set) containing the function arguments has to be provided.
0047 It is possible to define a multivariant function and to provide a data set (a column in a spreadsheet) for each of the variables.
0048 The corresponding dialog supports the creation of arbitrary number of variables
0049 \end{itemize}
0050 
0051 % TODO
0052 % \begin{figure}
0053 % \includegraphics[width=\linewidth]{images/spreadsheet_generate_equidistant_values.png}
0054 % \caption{Dialog for generating equidistant numbers}
0055 % \end{figure}
0056 % \begin{figure}
0057 % \includegraphics[width=\linewidth]{images/spreadsheet_generate_random_values.png}
0058 % \caption{Dialog for generating equidistant numbers}
0059 % \end{figure}
0060 % \begin{figure}
0061 % \includegraphics[width=\linewidth]{images/spreadsheet_generate_multivariant_function_values.png}
0062 % \caption{Dialog for generating equidistant numbers}
0063 % \end{figure}
0064 
0065 Already existing data can be imported into a spreadsheet from external files via the "Import Data" dialog (s.a. \nameref{sec:import}).
0066 Imported data will be stored in the project file. Changes on data, performed either in the spreadsheet or in the external file after the import, are not synchronized anymore.
0067 
0068 The data in the spreadsheet can be exported to an external file (s.a. \nameref{sec:export}).
0069 
0070 
0071 
0072 \section{Matrix}\label{sec:matrix}
0073 Matrix is another container for matrix-like data. This container is presented like a table or, alternatively, as a two-dimensional greyscale image.
0074 The elements of such a table/matrix can be thought as being the$z$-values, $z=z(x,y)$, with $x$ and $y$ values being the row and column numbers, respectively.
0075 The transition from the row and column numbers to the logical coordinates is done via an explicit user-defined mapping of both representations.
0076 \begin{figure}
0077 \includegraphics[width=\textwidth]{images/matrix.png}
0078 \caption{Matrix with 500x500 values in the ranges $x=[0,1]$ and $y=[0,1]$. The cell values, $z$, are given by $z=z(x,y)$.}
0079 \end{figure}
0080 
0081 The matrix data can either be entered manually or via an import from an external file.
0082 Similar to the data generation for a column in a \nameref{sec:spreadsheet}, the matrix can be filled with constant values or via a formula, too.
0083 % TODO
0084 % \begin{figure}
0085 % \includegraphics[width=\textwidth]{images/matrix_function_values.png}
0086 % \caption{Image view of a matrix together with the formula that was used to generate the matrix elements}
0087 % \end{figure}
0088 
0089 %TODO: export matrix to different formats
0090 
0091 \section{Workbook}\label{sec:workbook}
0092 Workbook helps the user to better organize and to group different data containers (Spreadsheet and Matrix).
0093 This object serves as the parent container for multiple Spreadsheet- and/or Matrix-objects and puts them together in a view with multiple tabs.
0094 \begin{figure}
0095 \includegraphics[width=\textwidth]{images/workbook.png}
0096 \caption{Workbook combining two spreadsheets and one matrix in one container.}
0097 \end{figure}
0098 
0099 With folders it is already possible to bring some structure in the \nameref{sec:project_explorer} and to group together several related objects
0100 (spreadsheets with data stemming from text files of similar origin, red, green and blue values of an image imported into three different matrices, etc.).
0101 With Workbook the user has the possibility for another additional grouping.
0102 
0103 
0104 \chapter{2D Plotting}\label{ch:2d_plotting}
0105 \section{Plots}\label{sec:2d_plots}
0106 \section{Curves}\label{sec:2d_curves}
0107 \section{Legends}\label{sec:2d_legends}
0108 
0109 
0110 % \chapter{3D Plotting}
0111 
0112 \chapter{Themes and Templates}\label{ch:themes_templates}
0113 
0114 
0115 \chapter{Data Analysis}\label{ch:data_analysis}
0116 \section{Data reduction}\label{sec:data_reduction}
0117 \section{Differentiation}\label{sec:differentiation}
0118 \section{Integration}\label{sec:integration}
0119 \section{Interpolation}\label{sec:interpolation}
0120 \section{Smoothing}\label{sec:smoothing}
0121 \section{Curve Fitting}\label{sec:curve_fitting}
0122 LabPlot calculates several statistical measures that help to estimate the goodness of the fit.
0123 
0124 \textbf{Sum of squared errors (SSE)} (also known as residual sum of squares (RSS) or sum of squared residuals (SSR)):
0125 \begin{eqnarray*}
0126 SSE = \sum_{i=1}^n (\bar y -y)^2.
0127 \end{eqnarray*}
0128 \textbf{Mean squared error (MSE):}
0129 \begin{eqnarray*}
0130 MSE = \frac{1}{n} \sum_{i=1}^n (\bar y -y)^2.
0131 \end{eqnarray*}
0132 \textbf{Root-mean squared error (RMSE):}
0133 \begin{eqnarray*}
0134 RMSE = \sqrt{MSE}.
0135 \end{eqnarray*}
0136 \textbf{Mean absolute error (MAE):}
0137 \begin{eqnarray*}
0138 MAE = \frac{1}{n} \sum_{i=1}^n |\bar y -y|^2.
0139 \end{eqnarray*}
0140 \textbf{Residual mean square (RMS):}
0141 \begin{eqnarray*}
0142 RMS = \frac{SSE}{n-p}.
0143 \end{eqnarray*}
0144 \textbf{Residual standard deviation (RSD):}
0145 \begin{eqnarray*}
0146 RSD = \sqrt{RMS}
0147 \end{eqnarray*}
0148 \textbf{Coefficient of determination ($\mathbf{R^2}$):}
0149 \begin{eqnarray*}
0150 R^2 = 1 - \frac{SSE}{TSS},\; \text{with the total sum of squares}\; TTS = \sum_i (y_i - \hat y)^2\; \text{and}\; \hat y = \frac 1n \sum_{i=1}^n y_i.
0151 \end{eqnarray*}
0152 \textbf{Adjusted coefficient of determination (}$\mathbf{R^2_{Adj.}}$\textbf{):}
0153 \begin{eqnarray*}
0154 R^2_{\mathrm{Adj.}} = 1 - \frac{SSE/(n-1)}{TSS/(n-p-1)} =  1 - (1-R^2) \frac{n-1}{n-np-1}.
0155 \end{eqnarray*}
0156 
0157 
0158 The implementation of the fitting procedure with bounded parameters follows the implementation in MINUIT (http://seal.web.cern.ch/seal/documents/minuit/mnusersguide.pdf, Sec. 1.3.1). Using hard limits for the parameters directly during the calculation is hard to accomplish, especially while calculating the derivatives. Instead of this, a transformation to internal parameters that are free from any bounds is performed. This transformation is constructed in such a way as to limit the original (external) parameters to the specified bounds while allowing the internal parameters to take any values.
0159 
0160 For both, the lower ($\min$) and the upper ($\max$) parameter bounds specified, the mapping between the bounded parameters and the parameters used internally in the calculation is given by
0161 \begin{eqnarray*}
0162 P_{int} &=& \arcsin \left( 2\frac{P_{ext} - \min}{\max - \min} - 1 \right), \\
0163 P_{ext} &=& \min + \frac{\max - \min}{2} \left( \sin P_{int} + 1 \right).
0164 \end{eqnarray*}
0165 For single sided limits with only the lower limit available:
0166 \begin{eqnarray*}
0167 P_{int} &=& \pm \sqrt{ (P_{ext} - \min + 1)^2 - 1}, \\
0168 P_{ext} &=& \min - 1 + \sqrt{P_{int}^2 + 1}.
0169 \end{eqnarray*}
0170 And similarly for parameters with upper limits only:
0171 \begin{eqnarray*}
0172 P_{int} &=& \pm \sqrt{ (\max - P_{ext} + 1)^2 - 1},\\
0173 P_{ext} &=& \max + 1 - \sqrt{P_{int}^2 + 1}.
0174 \end{eqnarray*}
0175 The transformation is non-linear which introduces, even for linear problems, additional non-linearity and numerical instabilities. Therefore, it is recommended to impose limits on the parameters only if really required. Furthermore, in order to get more stable error analysis results the fit should be re-performed again without any limits once a reasonable minimum was found.
0176 
0177 \section{Fourier Filter}\label{sec:fourier_filter}
0178 
0179 \newpage
0180 \section{Fourier Fransform}
0181 Available window functions are
0182 \begin{eqnarray*}
0183 \text{rectangular(uniform):} \quad  w(n) &=& 1 \\
0184 \text{triangular:} \quad w(n) &=& 1 - \frac{2}{N} \left| n-\frac{N-1}{2} \right| \\
0185 \text{triangular (Bartlett):} \quad  w(n) &=&  1 - \frac{2}{N-1} \left|n-\frac{N-1}{2}\right| \\
0186 \text{triangular (Parzen):} \quad  w(n) &=& 1 - \frac{2}{N+1} \left| n-\frac{N-1}{2} \right| \\
0187 \text{Welch (parabolic):} \quad  w(n) &=& 1 - \left(2 \frac{n-(N-1)/2}{N+1} \right)^2 \\
0188 \text{Cosine:} \quad  w(n) &=& \sin\left( \frac{\pi n}{N-1} \right) \\
0189 \text{Bartlett-Hann:} \quad  w(n) &=& 0.62 - 0.48 \left| \frac{n}{N-1}-0.5 \right| - 0.38 \cos\left(\frac{2\pi n}{N-1}\right) \\
0190 \text{Lanczos:} \quad  w(n) &=& \mathrm{sinc} \left(\frac{2n}{N-1}-1\right) \\
0191 \end{eqnarray*}
0192 
0193 Higher-order generalized cosine window functions:
0194 \begin{eqnarray*}
0195 \text{Hann (raised cosine):} \;  w(n) &=& 0.5 - 0.5 \cos \left(\frac{2 \pi n}{N-1}\right) \\
0196 %
0197 \text{Hamming:} \;  w(n) &=& 0.54 - 0.46 \cos\left( \frac{2\pi n}{N-1} \right) \\
0198 %
0199 \text{Blackman:} \;  w(n) &=& 0.42 - 0.5 \cos\left(\frac{2\pi n}{N-1}\right) + 0.08 \cos\left(\frac{4\pi n}{N-1} \right) \\
0200 %
0201 \text{Nuttall:} \;  w(n) &=& a_0 + a_1 \cos\left(\frac{2\pi n}{N-1}\right) + a_2 \cos\left(\frac{4\pi n}{N-1}\right) + a_3 \cos\left(\frac{6\pi n}{N-1}\right) \\
0202 && a_0 = 0.355768,\; a_1 =  -0.487396,\; a_2 = 0.144232,\; a_3 = -0.012604 \\
0203 %
0204 \text{Blackman-Nuttall:} \;  w(n) &=& a_0 + a_1 \cos\left(\frac{2\pi n}{N-1}\right) + a_2 \cos\left(\frac{4\pi n}{N-1}\right) + a_3 \cos\left(\frac{6\pi n}{N-1}\right) \\
0205 && a_0 = 0.3635819,\; a_1 =  -0.4891775,\; a_2 = 0.1365995,\; a_3 = -0.0106411 \\
0206 %
0207 \text{Blackman-Harris:} \;  w(n) &=& a_0 + a_1 \cos\left(\frac{2\pi n}{N-1}\right) + a_2 \cos\left(\frac{4\pi n}{N-1}\right) + a_3 \cos\left(\frac{6\pi n}{N-1}\right) \\
0208 && a_0 = 0.35875,\; a_1 =  -0.48829,\; a_2 = 0.14128,\; a_3 = -0.01168 \\
0209 %
0210 \text{Flat top:} \;  w(n) &=& a_0 + a_1 \cos\left(\frac{2\pi n}{N-1}\right) + a_2 \cos\left(\frac{4\pi n}{N-1}\right) +a_3 \cos\left(\frac{6\pi n}{N-1}\right) + a_4 \cos\left(\frac{8\pi n}{N-1}\right); \\
0211 && a_0 = 1, \; a_1 =  -1.93,\; a_2 = 1.29,\; a_3 = -0.388,\; a_4 = 0.028 \\
0212 \end{eqnarray*}
0213 
0214 
0215 \chapter{CAS Computing}\label{ch:cas_computing}
0216 LabPlot can be used as a frontend to different open-source computer algebra systems (CAS) like Maxima, Octave, R, Scilab and Sage  or programming languages providing similar capabilities like Python and Julia. LabPlot recognizes different CAS variables holding array-like data and allows to select them as the source for curves. So, instead of providing columns of a spreadsheet as the source for x- and y-data, the user provides the names of the corresponding CAS-variables. Currently supported CAS data containers are
0217 \begin{itemize}
0218 \item \textbf{Maxima} lists
0219 \item \textbf{Python} lists, tuples and NumPy arrays
0220 \item \textbf{Julia} vectors and tuples
0221 \end{itemize}
0222 
0223 With this, powerfull calculations carried out inside of different CAS environments can be combined with the user-friendly visualisation and editing capabilities of LabPlot. This combination is demonstrated below with the help of two examples:
0224 \begin{figure}
0225 \includegraphics[width=\textwidth]{images/maxima_session.png}
0226 \caption{Maxima session showing the chaotic dynamics of the Duffing oscillator. The differential equation of the forced oscillator is solved with Maxima. Plots of the trajectory, the phase space of the oscillator and the corresponding Poincaré map are done with LabPlot.}
0227 \end{figure}
0228 
0229 \begin{figure}
0230 \includegraphics[width=\textwidth]{images/python_session.png}
0231 \caption{Python session illustrating the effect of Blackman windowing on the Fourier transform}
0232 \end{figure}
0233 
0234 
0235 
0236 \chapter{Import and Export}\label{ch:import_export}
0237 \section{Import}\label{sec:import}
0238 \section{Export}\label{sec:export}
0239 
0240 \chapter{\LaTeX\, Typesetting}\label{ch:latex_typesetting}
0241 Besides rich text formatting, LabPlot supports \LaTeX\, typesetting in different areas of the application like in text labels, plot title, axis title, etc. In case the \LaTeX\, environment is available on the system (more about the prerequisites below), the user can switch between the \LaTeX\, and rich-text typesettings in the text fields for objects that support this.
0242 
0243 In \LaTeX\, mode when entering text in the text field, LabPlot automatically adds a mathematical environment, if not available yet. The user can simply start typing the mathematical expression which will be rendered correctly or, e.g. when combining with text, explicitly specify at which position the mathematical environment has to be used. LabPlot will add the propper header and footer. Following examples are valid inputs
0244 \begin{itemize}
0245 \item {
0246 \begin{lstlisting}
0247 \sum
0248 \end{lstlisting}
0249 }
0250 %
0251 \item {
0252 \begin{lstlisting}
0253 $\sum$
0254 \end{lstlisting}
0255 }
0256 %
0257 \item {
0258 \begin{lstlisting}
0259 \begin{displaymath}
0260 \sum
0261 \end{displaymath}
0262 \end{lstlisting}
0263 }
0264 %
0265 \item {
0266 \begin{lstlisting}
0267 summation symbol $\sum$
0268 \end{lstlisting}
0269 }
0270 \end{itemize}
0271 Furthermore, it is possible to provide a complete \LaTeX\, document
0272 \begin{lstlisting}[language={[Latex]TeX}, backgroundcolor=\color{lightgray}, frame=single]
0273 \documentclass{...}
0274 \begin{document}
0275 ...
0276 \end{document}
0277 \end{lstlisting}
0278 
0279 With this it is possible to use user-specific header and footer and to include additional packages that are not included by LabPlot on default. This allows to use texts and graphics of arbitrary complexity supported by \LaTeX.
0280 
0281 Default rendering engine is, if available, \textit{pdflatex}. In application settings dialog (\menuchoice{Settings}{Configure\, LabPlot}) it is possible to choose between other available rendering engines like \textit{latex, pdflatex, xelatex} or \textit{lualatex}.
0282 
0283 To modify the apprearence of the rendered text, the user can specifiy the font size and color. For engines that support OpenType and TrueType fonts (\textit{xelatex} and \textit{lualatex}) it is also possible to provide the main font.
0284 
0285 
0286 \textbf{Prerequisites:}\\
0287 To render the text set using \LaTeX\, syntax, LabPlot relies on the existence of a \LaTeX\, environment. The rendered document is converted to a PNG image that is imported into and shown in LabPlot. The conversion process depends on the rendering engine used:
0288 \begin{itemize}
0289 \item When using \textit{latex}, the produced DVI file is converted first to a PostScript file with the help of \textit{dvips}. The intermediate PostScript file is converted after that to a PNG file using \textit{convert} from the \textit{ImageMagick} package.
0290 \item For rendering engines producing a PDF file (\textit{pdflate, xelatex} and \textit{lualatex}), the result PDF file is directly converted to a PNG file with \textit{convert}.
0291 \end{itemize}
0292 
0293 In case no \LaTeX\, installation is found on the system or one of the required tools for the conversion to PNG is missing, \LaTeX\, typesetting is disabled. On Unix/Linux the required packages are installed via the package manager. The Windows installer for LabPlot and the Mac OS X \textit{dmg}-bundle include already \textit{convert} - everything else has to be installed by the user on the system prior to using this typesetting mode in LabPlot.
0294 
0295 When openning a LabPlot project file already containing \LaTeX\, rendered text on systems with no \LaTeX\, typesetting enabled (because of missing prerequisites), the rendered image is  correctly shown but no editing is possible - the user still can switch to the rich-text format mode instead and modify the text.
0296 
0297 
0298 \textbf{Note about the technical implementation:}\\
0299 The text provided by the user is enriched with an appropriate header and footer to obtain a valid and complete \LaTeX\, document that is processed, as described above, by the rendering engine.
0300 The overall structure of the document generated by LabPlot is
0301 \begin{lstlisting}[language={[Latex]TeX}, backgroundcolor=\color{lightgray}, frame=single, morekeywords={definecolor,color,defaultfontfeatures,setmainfont}]
0302 \documentclass{minimal}
0303 \usepackage{color}
0304 \usepackage[active,displaymath,textmath,tightpage]{preview}
0305 \usepackage{mathtools}
0306 \definecolor{fontcolor}{rgb}{red, green, blue}
0307 
0308 %% for xelatex and lualatex engines only
0309 \usepackage{xltxtra}
0310 \defaultfontfeatures{Ligatures=TeX}
0311 \setmainfont[Mapping=tex-text]{font family}
0312 %%
0313 
0314 \begin{document}
0315 \begin{preview}
0316 \fontsize{font size}{font size}
0317 \selectfont
0318 \color{fontcolor}
0319 
0320 ...
0321 
0322 \end{preview}
0323 \end{document}
0324 \end{lstlisting}
0325 Here, "red", "green" and "blue" are the font colors provided by the user, "font family" is the OpenType or TrueType font family for the main document font (relevant for xelatex and lualatex only) and "font size" is the size of the font to be used. The text entered by the user, shown as "..." in the listing above, is wrapped into a preview-environment to render the document in a minimal possible size.
0326 
0327 In case a complete \LaTeX document is provided, LabPlot merges the definitions of user's header and footer with the definitions shown in the above listing.
0328 
0329 
0330 
0331 \chapter{Tools}\label{ch:tools}
0332 \section{Curve Tracing}\label{sec:curve_tracing}
0333 \textit{Datapicker} is a tool that allows to easily extract data from image files. The process of extraction consists mainly out of the following steps:
0334 \begin{itemize}
0335 \item Import an image containing plots and curves where you want to read the data points from
0336 \item Select the plot type (cartesian, polar, etc)
0337 \item Select tree reference points and provide values for them. With the help of these points the logical coordinate system is determined
0338 \item Create a new datapicker curve and set the type of the error bars.
0339 \item Switch to the mouse mode "Set Curve Points" and start selecting points on the imported image - the coordinates for the selected points are determined and added to the spreadsheet "Data".
0340 \end{itemize}
0341 
0342 It is possible to add more then one datapicker curve. This is useful in case the imported image contains several curves that need to be digitized.
0343 The datapicker curve that is currently being selected in the \nameref{sec:project_explorer} is the "active" one - points clicked on the datapicker image will be calculated and added to its data spreadsheet.
0344 \begin{figure}
0345 \includegraphics[width=\textwidth]{images/datapicker_active_curve_data_spreadsheet.png}
0346 \caption{Coordinates of the digitized data points stored in a spreadsheet}
0347 \end{figure}
0348 
0349 Calculated values are stored in different columns in data spreadsheets in the datapicker. These columns behave exactly the same like other columns
0350 in usual spreadsheets and can be directly used as source columns for curves in the plots.
0351 
0352 Datapicker supports the process of the data extraction with several helpers. To place the points more precisely, a magnification glass with different magnification levels is available.
0353 Also, the last selected point can be shifted with the help of the navigation keys.
0354 Furthermore, when reading data points having error bars, datapicker automatically creates bars indicating the end points of the error bars.
0355 Those bars can be pulled with the mouse until the required length (the distance to the data point) is reached.
0356 
0357 The procedure for the extraction of data from an imported plot as described above is feasible when dealing with a limited number of points.
0358 In case the curves in the imported image are given as solid lines, the datapicker tool in LabPlot allows to read them semi-automatically.
0359 For this, after a new datapicker curve was added as described above, switch to the mouse mode "Select Curve Segments". The curves on the plot are recognized and highlighted.
0360 By clicking on a highlighted curve (or one of its segments), points along this curve are created.
0361 The length of a segment and the density of created points (separation between two points) are adjustable parameters.
0362 On the screenshots below, after switching to the segment mode all black lines were highlighted (green colour).
0363 In this specific case, the curve was recognized as a single segment and a single mouse-click on this segment is sufficient to digitize this curve and to automatically place points along the curve.
0364 \begin{figure}
0365 \includegraphics[width=\textwidth]{images/datapicker_segments.png}
0366 \caption{Automatic creation of points along the recognized curve.}
0367 \end{figure}
0368 
0369 In many cases the plot is not as simple as above (single black curve on white background) and contains grid lines, many curves of different colour and thinness and a non-white background.
0370 In such a case the automatic detection fails (too many or no objects are highlighted). To help the datapicker to determine the curve(s) correctly, the user has to limit the allowed ranges in the HSV (or HSI) colour spaces.
0371 To subtract the non-white background it is possible to limit the range for the foreground colour, too.
0372 Internally, each pixel of the image is converted to black and white where only the points fitting into the user-defined ranges for hue, saturation, value, intensity and foreground are set to black.
0373 
0374 On the screenshots below, the blue curves in the original image were projected onto by having appropriately reduced the allowed ranges in the colour space (note the peak for blue in the histogram for the hue).
0375 The transformed black and white image contains only the curves the user is interested in and it is now an easy task for the datapicker to determine the curves and to place points on them.
0376 \begin{figure}
0377 \includegraphics[width=\textwidth]{images/datapicker_original_transformed_segments.png}
0378 \caption{Original image, image with the reduced color space and automatically created points for the recognized curve.}
0379 \end{figure}
0380 
0381 Similar to \nameref{sec:worksheet}, the currently visible area in the datapicker can be exported. The supported image formats are described in the section \nameref{sec:export}.
0382 
0383 
0384 \section{FITS Metadata Editor}
0385 FITS is an open standard file format widely used in the scientific community to store structured as well as unstructured multi-dimenstional data. One of the major features of the FITS format is the ability to store the metadata in human-readable \textit{headers}. Such headers are stored in the file, in addition to the actual data, as key-value pairs in the ASCII format and provide additional information about the origin of the data, its size, used measurement devices, etc. As described in more details in the section \nameref{sec:import}, LabPlot supports the import of data stored in the FITS format. In addition to that, LabPlot also provides the tool \textit{"FITS Metadata Editor"} that allows to inspect and to modify the metadata.
0386 
0387 In general, a FITS file consists of one or more \textit{Header + Data Unit}s (HDUs), where the first HDU is usually called the \textit{primary HDU}. A FITS file can have any number of additional HDUs, commonly called FITS \textit{extensions}. LabPlot's FITS Metadata Editor parses the metadata part of the selected FITS file only and shows all available headers (primary and extensional) in a tree view. Already existing key-value pairs can be modified or deleted, new pairs can be added. It is also possible to open and to edit more then one file at the same time.
0388 
0389 \begin{figure}
0390 \includegraphics[width=\textwidth]{images/fits_metadata_editor.png}
0391 \caption{FITS Metadata Editor with four opened files and a dialog for adding a new keyword.}
0392 \end{figure}