forked from Fellypao/scidavis-handbook
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathusing.html
305 lines (305 loc) · 40.2 KB
/
using.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 2. Drawing plots with SciDAVis</title>
<link rel="stylesheet" type="text/css" href="scidavis.css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<meta name="keywords" content="Qt, SciDAVis, Data, Analysis, Plotting">
<link rel="home" href="index.html" title="The SciDAVis Handbook">
<link rel="up" href="index.html" title="The SciDAVis Handbook">
<link rel="prev" href="general-concepts.html" title="General Concepts and Terms">
<link rel="next" href="sec-special-plots.html" title="Other special 2D plots">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">Chapter 2. Drawing plots with SciDAVis</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="general-concepts.html">Prev</a> </td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="sec-special-plots.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="using"></a>Chapter 2. Drawing plots with SciDAVis</h1></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="sect1"><a href="using.html#sec-2d-plots">2D X-Y plots</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="using.html#sec-2d-plot-from-data">2D plot from data.</a></span></dt>
<dt><span class="sect2"><a href="using.html#sec-2d-plot-from-function">2D plot from function.</a></span></dt>
<dt><span class="sect2"><a href="using.html#sec-other-2d-xy-plot">The different types of 2D X-Y plots</a></span></dt>
<dt><span class="sect2"><a href="using.html#sec-customize-2d-plot">Customization of a 2D plot</a></span></dt>
<dt><span class="sect2"><a href="using.html#sec-default-2d-plot">Changing default 2D plot options</a></span></dt>
<dt><span class="sect2"><a href="using.html#sec-template-2d-plot">Working with templates</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="sec-special-plots.html">Other special 2D plots</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="sec-special-plots.html#sec-pie-plots">Pie plots</a></span></dt>
<dt><span class="sect2"><a href="sec-special-plots.html#sec-vectors-plots">Vectors plots</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="sec-statistical-plots.html">Statistical plots</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="sec-statistical-plots.html#sec-box-plots">Box plots</a></span></dt>
<dt><span class="sect2"><a href="sec-statistical-plots.html#sec-histograms">Histograms</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="sec-3d-plots.html">3D plots</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="sec-3d-plots.html#sec-3d-plot-function">Direct 3D plot from a function</a></span></dt>
<dt><span class="sect2"><a href="sec-3d-plots.html#sec-3d-plot-matrix">3D plot from a matrix</a></span></dt>
<dt><span class="sect2"><a href="sec-3d-plots.html#sec-customize-3d-plot">Customization of a 3D plot</a></span></dt>
<dt><span class="sect2"><a href="sec-3d-plots.html#sec-default-3d-plot">Changing default 3D plot options</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="sec-multilayer-plots.html">Multilayer Plots</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="sec-multilayer-plots.html#sec-building-multilayer-plots-1">Building a multilayer plot panel</a></span></dt>
<dt><span class="sect2"><a href="sec-multilayer-plots.html#sec-building-multilayer-plots-2">Building a multilayer plot step by step</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="sec-adding-objects.html">Adding objects to a plot</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="sec-adding-objects.html#sec-adding-text">Adding a text label</a></span></dt></dl></dd>
</dl>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="sec-2d-plots"></a>2D X-Y plots</h2></div></div></div>
<a class="indexterm" name="idp1395204988"></a><p>A 2D plot is based on curves which are defined by Y values as functions of X values. There are different ways to obtain a 2D plot depending on the way the (X,Y) values are defined:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>You can have your (X,Y) values in a <a class="link" href="general-concepts.html#sec-intro-table" title="Tables">table</a>. You need to select at least one column as X values and one column as Y values. This is specified with the <a class="link" href="sec-table-menu.html#set-column-as-cmd"><span class="command"><strong>Set Column as</strong></span> command</a>. Then you can select the columns and use one command of the <a class="link" href="sec-plot-menu.html" title="The Plot Menu">Plot menu</a> to plot the data.</p></li>
<li class="listitem"><p>If you want to plot a function, you don't need a table. You can use directly the <a class="link" href="reference.html#new-function-plot-cmd"><span class="command"><strong>New→New Function Plot</strong></span> command</a>. This will open the corresponding dialog box and you will be able to define the mathematical expression of your function. In this case, plot can be obtained from functions in cartesian coordinates Y(X), but also in parametered coordinates (X(t),Y(t)), or in angular coordinates r(theta);.</p></li>
<li class="listitem"><p>The combined way is to define a <a class="link" href="general-concepts.html#sec-intro-table" title="Tables">table</a>, and then to fill in the table with the results of functions. This can be done with the <a class="link" href="sec-table-menu.html#assign-formula-cmd"><span class="command"><strong>Assign Formula</strong></span> command</a>. Then you can select the columns and use one command of the <a class="link" href="sec-plot-menu.html" title="The Plot Menu">Plot menu</a> to plot the data.</p></li>
</ul></div>
<p>SciDAVis will create a new graph window, and the plot will be inserted in a new layer.</p>
<p>Once the plot is created, you can customize all the graphic items of the plot with the commands of the <a class="link" href="sec-format-menu.html" title="The Format Menu">Format Menu</a>. You can add new items (text labels, lines or arrows, new legend, images) on the plot with the commands of the <a class="link" href="sec-graph-menu.html" title="The Graph Menu">Graph Menu</a>.</p>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="sec-2d-plot-from-data"></a>2D plot from data.</h3></div></div></div>
<a class="indexterm" name="idp1395256156"></a><p>The data must be stored in a <a class="link" href="general-concepts.html#sec-intro-table" title="Tables">table</a>. There are several possibilities to insert your (X,Y) values in the table: you can write them directly from the keyboard, or read them from a file. Here we will use the first solution, refer to the <a class="link" href="reference.html#import-ascii-cmd"><span class="command"><strong>Import Ascii</strong></span> command</a> to use the second one.</p>
<p>The first step is to create an empty project with the <a class="link" href="reference.html#new-project-cmd"><span class="command"><strong>New→New Project</strong></span> command</a> from the <a class="link" href="reference.html#sec-file-menu" title="The File Menu">File menu</a>, you can also use the key <span class="keycode">CTRL+N</span> or the <span class="inlinemediaobject"><img src="icons/new.png"></span> icon from the <a class="link" href="toolbars.html#sec-file-toolbar" title="The File Toolbar">File toolbar</a>. Then create a new table with the <a class="link" href="reference.html#new-table-cmd"><span class="command"><strong>New→New Table</strong></span> command</a> from the <a class="link" href="reference.html#sec-file-menu" title="The File Menu">File menu</a> or with the <span class="keycode">CTRL+T</span> or with the <span class="inlinemediaobject"><img src="icons/table.png"></span> icon from the <a class="link" href="toolbars.html#sec-file-toolbar" title="The File Toolbar">File toolbar</a>.</p>
<p>At its creation, the table has two column (one for X and one for Y) and 32 rows. You can add rows and columns by selecting a row or a column and using the right button of the mouse, you can also modify the number of rows and columns with the <a class="link" href="sec-table-menu.html#table-dimensions-cmd"><span class="command"><strong>Dimensions</strong></span> command</a> from the <a class="link" href="sec-table-menu.html" title="The Table Menu">Table menu</a>. Then, enter your values, and you obtain the table shown in figure <a class="xref" href="using.html#fig-simple-2dplot-1" title="Figure 2.1. A simple 2D plot: the table.">2.1</a></p>
<div class="figure">
<a name="fig-simple-2dplot-1"></a><p class="title"><b>Figure 2.1. A simple 2D plot: the table.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="tutorial/simple-2dplot-1.png" alt="A simple 2D plot: the table."></div></div>
</div>
<br class="figure-break"><p>Then, you have to select the two columns, and build your plot (here a simple 2D scatter) with the <a class="link" href="sec-plot-menu.html#scatter-cmd"><span class="command"><strong>Scatter</strong></span> command</a> from the context menu, or by clicking on the corresponding <span class="inlinemediaobject"><img src="icons/pPlot.png"></span> icon from the <a class="link" href="sec-plot-toolbar.html" title="The Plot Toolbar.">Plot toolbar</a> or with the <a class="link" href="sec-plot-menu.html#scatter-cmd"><span class="command"><strong>Scatter</strong></span> command</a> from the <a class="link" href="sec-plot-menu.html" title="The Plot Menu">Plot menu</a>. A plot is created which uses the default options for all elements. You can customize these default options with the <a class="link" href="using.html#sec-preferences-2d-plot" title="Modification of default options">2D plot preferences dialog</a>. With the default options, you obtain the plot shown in figure <a class="xref" href="using.html#fig-simple-2dplot-2" title="Figure 2.2. A simple 2D plot: the default plot.">2.2</a>.</p>
<div class="figure">
<a name="fig-simple-2dplot-2"></a><p class="title"><b>Figure 2.2. A simple 2D plot: the default plot.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="tutorial/simple-2dplot-2.png" alt="A simple 2D plot: the default plot."></div></div>
</div>
<br class="figure-break"><p>You can now customize your plot with the commands of the <a class="link" href="sec-format-menu.html" title="The Format Menu">Format menu</a>. By double clicking on the data points, you open the <a class="link" href="sec-format-menu.html#format-plot-cmd"><span class="command"><strong>Plot</strong></span> command</a> dialog which is used to modify the symbols. Then a double-click on the axes opens the <a class="link" href="sec-format-menu.html#format-axes-cmd"><span class="command"><strong>Axes</strong></span> command</a> dialog, and you can change the scales, the fonts for the axes labels, etc. You can also add grid lines on X or Y axes (<a class="link" href="sec-format-menu.html#format-grid-cmd"><span class="command"><strong>Grid</strong></span> command</a>), etc. Finally, a double click on each text item (X title, Y title, plot title) allows to change the text and the presentation of these elements. See the <a class="link" href="using.html#sec-customize-2d-plot" title="Customization of a 2D plot">customize section</a> for more details. An example of the final plot is shown in figure <a class="xref" href="using.html#fig-simple-2dplot-3" title="Figure 2.3. A simple 2D plot: the plot finished.">2.3</a>.</p>
<div class="figure">
<a name="fig-simple-2dplot-3"></a><p class="title"><b>Figure 2.3. A simple 2D plot: the plot finished.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="tutorial/simple-2dplot-3.png" alt="A simple 2D plot: the plot finished."></div></div>
</div>
<br class="figure-break"><p>Finally, you have to save your project in a '.sciprj' file with the <a class="link" href="reference.html#save-project-cmd"><span class="command"><strong>Save Project</strong></span> command</a> from the <a class="link" href="reference.html#sec-file-menu" title="The File Menu">File menu</a> or with the <span class="keycode">CTRL+S</span> or with the <span class="inlinemediaobject"><img src="icons/filesave.png"></span> icon from the <a class="link" href="toolbars.html#sec-file-toolbar" title="The File Toolbar">File toolbar</a>. Depending on your application, you can export your plot to a standard image file with the command <a class="link" href="reference.html#export-graph-current-cmd"><span class="command"><strong>Export Graph→Current</strong></span> command</a> from the <a class="link" href="reference.html#sec-file-menu" title="The File Menu">File menu</a> (or with the <span class="keycode">ALT+G</span> keycode).
</p>
<a class="indexterm" name="idp1395286548"></a><p>There are several types of plots which can be built from a table. They are presented in the <a class="link" href="sec-plot-menu.html" title="The Plot Menu">Plot menu</a>. One important feature is that it is possible to use up to four axis for the data. For example, create a new table, modify its dimension to 4 columns and 7 rows. Then select the third column and set it as X with the <a class="link" href="sec-table-menu.html#set-column-as-cmd"><span class="command"><strong>Set Column as</strong></span> command</a> from the <a class="link" href="sec-table-menu.html" title="The Table Menu">Table menu</a>; you can then enter the values of two series (X1,Y1) and (X2,Y2) as show in the figure <a class="xref" href="using.html#fig-two-axes-plot" title="Figure 2.4. A table with two series of values (X1,Y1) and (X2,Y2).">2.4</a>.</p>
<div class="figure">
<a name="fig-two-axes-plot"></a><p class="title"><b>Figure 2.4. A table with two series of values (X1,Y1) and (X2,Y2).</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="tutorial/2axes-2dplot-1.png" alt="A table with two series of values (X1,Y1) and (X2,Y2)."></div></div>
</div>
<br class="figure-break"><p>To build the plot, select the two Y column (select Y1, and the select Y2 with CTRL key), use the <a class="link" href="sec-plot-menu.html" title="The Plot Menu">Plot menu</a>. You obtain a simple plot with two axes, then use the <a class="link" href="sec-format-menu.html#format-plot-cmd"><span class="command"><strong>Plot</strong></span> command</a>. In the left window, select the data serie for which you want to change the axes, click on the <span class="emphasis"><em>axis</em></span> tag and define the axes you want to use. After this, the plot is modified but the new axes are not shown. Use the <a class="link" href="sec-format-menu.html#format-axes-cmd"><span class="command"><strong>Axes</strong></span> command</a>, select the new axes and click on the <span class="emphasis"><em>show</em></span> checkbox. You can then customize your plot in order to obtain the result presented in figure <a class="xref" href="using.html#fig-two-axes-plot-1" title="Figure 2.5. A 2D plot with two Y and two X axis.">2.5</a>.</p>
<div class="figure">
<a name="fig-two-axes-plot-1"></a><p class="title"><b>Figure 2.5. A 2D plot with two Y and two X axis.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="tutorial/2axes-2dplot-2.png" alt="A 2D plot with two Y and two X axis."></div></div>
</div>
<br class="figure-break"><p>In addition to the customization which has been already described, four arrows were added with the <a class="link" href="sec-graph-menu.html#draw-arrow-cmd"><span class="command"><strong>Draw Arrow</strong></span> command</a>.</p>
</div>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="sec-2d-plot-from-function"></a>2D plot from function.</h3></div></div></div>
<a class="indexterm" name="idp1395298428"></a><p>There are two ways to obtain such a plot: you can plot directly a function or fill a table with the values calculated from this function before doing a plot in the classical way.</p>
<div class="sect3">
<div class="titlepage"><div><div><h4 class="title">
<a name="idp1395299468"></a>Direct plot of a function.</h4></div></div></div>
<p>If you just want to plot a function, you can use the <a class="link" href="reference.html#new-function-plot-cmd"><span class="command"><strong>New→New Function Plot</strong></span> command</a> from the <a class="link" href="reference.html#sec-file-menu" title="The File Menu">File menu</a> or with the <span class="keycode">CTRL+F</span> or with the <span class="inlinemediaobject"><img src="icons/newF.png"></span> icon from the <a class="link" href="toolbars.html#sec-file-toolbar" title="The File Toolbar">File toolbar</a>.</p>
<p>You can then enter the expression of your mathematical function, the X range used for the plot, and the number of points used in this X range. See the <a class="link" href="sec-graph-menu.html#add-function-cmd"><span class="command"><strong>Add Function</strong></span> command</a> for details.</p>
<div class="figure">
<a name="fig-direct-function-plot-1"></a><p class="title"><b>Figure 2.6. Direct plot of a function.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="tutorial/direct-function-plot.png" alt="Direct plot of a function."></div></div>
</div>
<br class="figure-break"><p>The generic plot which is created by this command can then be customized as explained in the previous section. Beside classical Y=f(X) functions, parametric functions and polar functions can be defined. In parametric coordinates, <span class="emphasis"><em>X</em></span> and <span class="emphasis"><em>Y</em></span> are defined as functions of an independant parameter <span class="emphasis"><em>m</em></span>. You can define these functions, the range for <span class="emphasis"><em>m</em></span> and the number of points computed in this range.</p>
<div class="figure">
<a name="fig-direct-function-plot-2"></a><p class="title"><b>Figure 2.7. Direct plot of a parametric function.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="tutorial/direct-function-plot-parametric.png" alt="Direct plot of a parametric function."></div></div>
</div>
<br class="figure-break"><p>Polar coordinate are defined as a radius <span class="emphasis"><em>R</em></span> and an angle <span class="emphasis"><em>theta</em></span> (in radian). The coordinates are then obtained by <span class="emphasis"><em>X=R.cos(theta)</em></span> and <span class="emphasis"><em>Y=R.sin(theta)</em></span>. You can use a parametric definition: <span class="emphasis"><em>R=f(t)</em></span> and <span class="emphasis"><em>theta=f(t)</em></span>, the range for <span class="emphasis"><em>t</em></span> and the number of points computed in this range.</p>
<div class="figure">
<a name="fig-direct-function-plot-3"></a><p class="title"><b>Figure 2.8. Direct plot of a function in polar coordinates.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="tutorial/direct-function-plot-polar.png" alt="Direct plot of a function in polar coordinates."></div></div>
</div>
<br class="figure-break">
</div>
<div class="sect3">
<div class="titlepage"><div><div><h4 class="title">
<a name="sec-table-function-plot"></a>Filling of a table with the values of a function.</h4></div></div></div>
<a class="indexterm" name="idp1395312884"></a><p>If you just want to work not only with the plot but also with the data, you can create a new table as explained in the <a class="link" href="using.html#sec-2d-plot-from-data" title="2D plot from data.">previous section</a>. Then you can fill this table with the values of a function with the <a class="link" href="sec-table-menu.html#assign-formula-cmd"><span class="command"><strong>Assign Formula</strong></span> command</a>. The main advantage of this method is that you can do further analysis of the calculated data as the are kept in a table.</p>
<p>To obtain the same plot as in the previous example, you need to create a new table (key <span class="keycode">CTRL+T</span>) and use the <a class="link" href="sec-table-menu.html#table-dimensions-cmd"><span class="command"><strong>Dimensions</strong></span> command</a> to define 300 rows, then select the first column and use the command <a class="link" href="sec-table-menu.html#assign-formula-cmd"><span class="command"><strong>Assign Formula</strong></span> command</a> from the context menu, or from the <a class="link" href="sec-table-menu.html" title="The Table Menu">Table menu</a>. The row number symbol is <span class="emphasis"><em>i</em></span>, so you can enter the function expression <span class="emphasis"><em>i/10</em></span> (figure <a class="xref" href="using.html#fig-table-function-plot-1" title="Figure 2.9. Function plot: filling of the X column.">2.9</a>).</p>
<div class="figure">
<a name="fig-table-function-plot-1"></a><p class="title"><b>Figure 2.9. Function plot: filling of the X column.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="tutorial/table-function-plot1.png" alt="Function plot: filling of the X column."></div></div>
</div>
<br class="figure-break"><p>The second step is to select the second column and use the same command. The expression is a function of the X values, that is the first column named <span class="emphasis"><em>col(1)</em></span> (figure <a class="xref" href="using.html#fig-table-function-plot-2" title="Figure 2.10. Function plot: filling of the Y column.">2.10</a>).</p>
<div class="figure">
<a name="fig-table-function-plot-2"></a><p class="title"><b>Figure 2.10. Function plot: filling of the Y column.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="tutorial/table-function-plot2.png" alt="Function plot: filling of the Y column."></div></div>
</div>
<br class="figure-break"><p>Once the table is ready, you just have to build the plot as explained in the previous section.</p>
</div>
</div>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="sec-other-2d-xy-plot"></a>The different types of 2D X-Y plots</h3></div></div></div>
<p>Beside the conventional X-Y plots with lines and points, other kinds of plots are available in SciDAVis. Although the presentation of the data can be very different, they are all based on the use of one column for X values and one column for Y values. Follow the links to the corresponding commands to see a description of these plots.</p>
<p>The first set is available in the subset <span class="emphasis"><em>Special Lines/Symbol</em></span> of the <a class="link" href="sec-plot-menu.html" title="The Plot Menu">Plot menu</a>:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Drop lines plot (<a class="link" href="sec-plot-menu.html#vertical-drop-lines-cmd"><span class="command"><strong>Special Line/Symbol→Vertical Drop Lines</strong></span> command</a>)</p></li>
<li class="listitem"><p>Scatter plot with a smoothed line connection between the points (<a class="link" href="sec-plot-menu.html#spline-cmd"><span class="command"><strong>Special Line/Symbol→Splines</strong></span> command</a>)</p></li>
<li class="listitem"><p>Vertical steps plot (<a class="link" href="sec-plot-menu.html#vertical-steps-cmd"><span class="command"><strong>Special Line/Symbol→Vertical Steps</strong></span> command</a>)</p></li>
<li class="listitem"><p>Horizontal steps plot (<a class="link" href="sec-plot-menu.html#horizontal-steps-cmd"><span class="command"><strong>Special Line/Symbol→Horizontal Steps</strong></span> command</a>)</p></li>
</ul></div>
<p>The other ones are more special plots which can be accessed directly in the <a class="link" href="sec-plot-menu.html" title="The Plot Menu">Plot menu</a>:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Vertical bars plot (<a class="link" href="sec-plot-menu.html#columns-cmd"><span class="command"><strong>Vertical Bars</strong></span> command</a>)</p></li>
<li class="listitem"><p>Horizontal bars plot (<a class="link" href="sec-plot-menu.html#rows-cmd"><span class="command"><strong>Horizontal Bars</strong></span> command</a>)</p></li>
<li class="listitem"><p>Area plot (<a class="link" href="sec-plot-menu.html#area-cmd"><span class="command"><strong>Area</strong></span> command</a>)</p></li>
</ul></div>
</div>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="sec-customize-2d-plot"></a>Customization of a 2D plot</h3></div></div></div>
<p>There are many way to improve and modify the plots:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>The first part of the commands are used to modify the main elements of the plot, that is axis, labels, etc. They can be accessed through the <a class="link" href="sec-format-menu.html" title="The Format Menu">Format menu</a>.</p></li>
<li class="listitem"><p>The second part of commands can be used to insert additional objects likes arrows, images, text labels, etc. They can be accessed in the <a class="link" href="sec-graph-menu.html" title="The Graph Menu">Graph menu</a>.</p></li>
</ul></div>
<p>This section will show an overview of the first set of commands. See the <a class="link" href="sec-graph-menu.html" title="The Graph Menu">Graph menu</a> section for the other commands. There are three main windows which allows to modify the plot:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>The <a class="link" href="sec-format-menu.html#format-plot-cmd"><span class="command"><strong>Plot</strong></span> command</a>, it is entitled "Plot details" and is used to customize the global properties of the plot (background color, etc) and the data series (points shape, line width, etc).</p></li>
<li class="listitem"><p>The second one is entitled "General plot options" and contain the commands to format axes (scales, labels, grids, etc), it can be accessed through the <a class="link" href="sec-format-menu.html#format-scales-cmd"><span class="command"><strong>Scales</strong></span> command</a>, <a class="link" href="sec-format-menu.html#format-axes-cmd"><span class="command"><strong>Axes</strong></span> command</a> and <a class="link" href="sec-format-menu.html#format-grid-cmd"><span class="command"><strong>Grid</strong></span> command</a>.</p></li>
<li class="listitem"><p>The last one is the <a class="link" href="sec-format-menu.html#format-title-cmd"><span class="command"><strong>Title</strong></span> command</a> which is used to control the properties of the title of the plot.</p></li>
</ul></div>
<p>All these commands are accessed through the <a class="link" href="sec-format-menu.html" title="The Format Menu">Format menu</a>.</p>
<div class="sect3">
<div class="titlepage"><div><div><h4 class="title">
<a name="sec-plot-details"></a>"Plot details" window</h4></div></div></div>
<p>This window has two parts, the left one shows a tree view of the main elements of the plot: the layers and the data series which are plotted in each layer. The main dialog is activated by selecting the <a class="link" href="sec-format-menu.html#format-plot-cmd"><span class="command"><strong>Plot</strong></span> command</a> from the <a class="link" href="sec-format-menu.html" title="The Format Menu">Format menu</a>. If it is activated by a double click on a curve in the plot, the same dialog will be opened with the corresponding curve selected (see <a class="link" href="using.html#sec-plot-details-series" title="Custom curves for data series">next section</a> for details). The right section of the window shows the options which are available for the selected entity. If you do some changes, don't forget to click on the <span class="emphasis"><em>Apply</em></span> button before switching to another entity.</p>
<div class="sect4">
<div class="titlepage"><div><div><h5 class="title">
<a name="sec-plot-details-layer"></a>Options for the layer</h5></div></div></div>
<a class="indexterm" name="idp1395350132"></a><p>This dialog can be used to modify the background color of the global plot area (i.e. the layer), the color of the canvas (that is the area in which curves are plotted), and the border of the plot. This border is for the global plot, if you want to add a border to the canvas, you can use the <span class="emphasis"><em>general</em></span> tag of the <a class="link" href="sec-format-menu.html#format-axes-cmd"><span class="command"><strong>Axes</strong></span> command</a>. If the image format use to save the plots support it, you can also control the transparency of these objects through the opacity parameter. The default value is 255 which means no transparency. See the <a class="link" href="reference.html#export-graph-cmd"><span class="command"><strong>Export Graph</strong></span> command</a> for details on image formats.</p>
<div class="figure">
<a name="fig-plot-details-layer"></a><p class="title"><b>Figure 2.11. The <span class="emphasis"><em>Plot details</em></span> Dialog: general properties of the layers.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="pics/plot-details-layer.png" alt="The Plot details Dialog: general properties of the layers."></div></div>
</div>
<br class="figure-break">
</div>
<div class="sect4">
<div class="titlepage"><div><div><h5 class="title">
<a name="sec-plot-details-series"></a>Custom curves for data series</h5></div></div></div>
<a class="indexterm" name="idp1395355812"></a><p>The commands can be accessed by a double click on a curve, or by using the <a class="link" href="sec-format-menu.html#format-plot-cmd"><span class="command"><strong>Plot</strong></span> command</a> and selecting a curve in the window on the left. The right part of the dialog box contains several tabs which depend on the kind of plot that you are using. The left part of the dialog window shows the curves which are plotted in the active layer. All the modifications will be done on the selected curve.</p>
<a class="indexterm" name="idp1395357716"></a><p>In this dialog box, beside the customization of data curves, you can change the columns which are used by clicking on the <span class="emphasis"><em>Plot Associations...</em></span> button. This will open a dialog which can be used to select the columns of the table which are used as X and Y values.</p>
<div class="figure">
<a name="fig-plot-associations"></a><p class="title"><b>Figure 2.12. The <span class="emphasis"><em>Plot details</em></span> Dialog: Plot Associations.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="pics/plot-associations.png" alt="The Plot details Dialog: Plot Associations."></div></div>
</div>
<br class="figure-break"><p>The button <span class="emphasis"><em>Worksheet</em></span> can be used to access to the table which contains the columns selected.</p>
<p>The dialog presented in figure <a class="xref" href="using.html#fig-format-lines" title="Figure 2.14. The Plot details Dialog: Line formatting.">2.14</a> is activated for plots drawn with <span class="emphasis"><em>symbols</em></span>, <span class="emphasis"><em>line+symbols</em></span>, <span class="emphasis"><em>lines</em></span>, <span class="emphasis"><em>vertical drop lines</em></span>, <span class="emphasis"><em>steps</em></span> and <span class="emphasis"><em>splines</em></span>. The first tab labelled <span class="emphasis"><em>axis</em></span> can be used to select the axis which are used for each curve of the plot: bottom (default) or top for abscissae, and left (default) or right for Y values. Beware that whatever your choice the right and top axis will not be drawn, you need to use the <a class="link" href="sec-format-menu.html#format-axes-cmd"><span class="command"><strong>Axes</strong></span> command</a> to obtain a plot in which these axis are shown.</p>
<div class="figure">
<a name="fig-details-axes"></a><p class="title"><b>Figure 2.13. The <span class="emphasis"><em>Plot details</em></span> Dialog: Choice of axes.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="pics/plot-details-axes.png" alt="The Plot details Dialog: Choice of axes."></div></div>
</div>
<br class="figure-break"><p>The second tab allows to modify the style of the line (color, line style, thickness). The connect button allows to change the style which is used to draw the selected curve (steps, droplines, etc). See the <a class="link" href="sec-plot-menu.html" title="The Plot Menu">Plot menu</a> to see examples of the different types of plot available.</p>
<div class="figure">
<a name="fig-format-lines"></a><p class="title"><b>Figure 2.14. The Plot details Dialog: Line formatting.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="pics/plot-details-lines.png" alt="The Plot details Dialog: Line formatting."></div></div>
</div>
<br class="figure-break"><p>If you select a style with symbols (scatter or symbol+lines), a last tab can be activated to select the symbol, and to modify the size, the color and the filling color of the symbols.</p>
<div class="figure">
<a name="fig-format-symbols"></a><p class="title"><b>Figure 2.15. The Plot details Dialog: Symbol formatting.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="pics/plot-details-symbols.png" alt="The Plot details Dialog: Symbol formatting."></div></div>
</div>
<br class="figure-break"><p>When the data are plotted using bars, the <span class="emphasis"><em>Plot details</em></span> window shows different options. The first tab named <span class="emphasis"><em>Pattern</em></span> can be used to customize the background and the border lines of the bars.</p>
<div class="figure">
<a name="fig-format-pattern"></a><p class="title"><b>Figure 2.16. The Plot details Dialog: Pattern formatting for bars.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="pics/plot-details-pattern.png" alt="The Plot details Dialog: Pattern formatting for bars."></div></div>
</div>
<br class="figure-break"><p>The second tab named <span class="emphasis"><em>Spacing</em></span> can be used to modify the geometry of the bars:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>The default width W of the bar is computed from the smallest difference between two successive abscissae, this correspond to a <span class="emphasis"><em>Gap between bars</em></span> equal to 0 (which is the default value). All bar are drawn with the same width. The Gap is a percentage of this default width: that is, a value of 50 will decrease the width of all the bars by a factor 2.</p></li>
<li class="listitem"><p>The bars are placed in order to be centered around each X value, i.e. between x-W/2 and x+W/2; this correspond to an <span class="emphasis"><em>Offset</em></span> of 0 (default value). The offset is again a percentage of the default width of the bar. For example, a value of 50 will shift the position of the bar by a half of the default width (W/2) and therefore each bar will placed between x and x+W. Negatives values can be used to shift the bars to the left. If inverted axes are used, the direction of the shift remains the same (i.e. positive offset lead to a shift to the right).</p></li>
</ul></div>
<div class="figure">
<a name="fig-format-spacing"></a><p class="title"><b>Figure 2.17. The Plot details Dialog: Spacing formatting for bars.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="pics/plot-details-spacing.png" alt="The Plot details Dialog: Spacing formatting for bars."></div></div>
</div>
<br class="figure-break">
</div>
</div>
</div>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="sec-default-2d-plot"></a>Changing default 2D plot options</h3></div></div></div>
<a class="indexterm" name="idp1395376740"></a><p>There are two ways to modify the default style which is used for plots. The first one applies to all plot and is reached by the <a class="link" href="sec-edit-menu.html#preferences-cmd"><span class="command"><strong>Preferences</strong></span> command</a> (in the <a class="link" href="sec-edit-menu.html" title="The Edit Menu">Edit menu</a>). And the second one is to define templates for a specific family of plots with the <a class="link" href="reference.html#save-as-template-cmd"><span class="command"><strong>Save as Template</strong></span> command</a>.</p>
<div class="sect3">
<div class="titlepage"><div><div><h4 class="title">
<a name="sec-preferences-2d-plot"></a>Modification of default options</h4></div></div></div>
<a class="indexterm" name="idp1395380260"></a><p>In the dialog box which is opened by the <span class="command"><strong>Preferences</strong></span>, the third set of options is used to customize the default aspect of <span class="emphasis"><em>2D plots</em></span>. The first tab is used to set some general options. Most of them are obvious to understand. If <span class="emphasis"><em>autoscaling</em></span> is set, the scales of the axes will be reset to their default values each time a modification is done on the data series. The <span class="emphasis"><em>scale font</em></span> option is set by default, in this case the size of the font are modified each time the window size is modified.</p>
<div class="figure">
<a name="fig-preferences-dialog-3a"></a><p class="title"><b>Figure 2.18. The preferences dialog: 2D plot options.</b></p>
<div class="figure-contents"><div class="mediaobject"><img src="pics/preferences-dialog3a.png" alt="The preferences dialog: 2D plot options."></div></div>
</div>
<br class="figure-break"><p>The second tab named <span class="emphasis"><em>Curves</em></span> defines the default style used when you create a new plot.</p>
<div class="informalfigure">
<a name="fig-preferences-dialog-3b"></a><div class="mediaobject"><img src="pics/preferences-dialog3b.png"></div>
</div>
<p>The third tab named <span class="emphasis"><em>Ticks</em></span> defines the default style for the ticks of the axes used when you create a new plot.</p>
<div class="informalfigure">
<a name="fig-preferences-dialog-3c"></a><div class="mediaobject"><img src="pics/preferences-dialog3c.png"></div>
</div>
<p>The fourth tab named <span class="emphasis"><em>Fonts</em></span> defines the default style for the fonts used for the axes, used when you create a new plot.</p>
<div class="informalfigure">
<a name="fig-preferences-dialog-3d"></a><div class="mediaobject"><img src="pics/preferences-dialog3d.png"></div>
</div>
<p>The last tab allows to modify two parameters for the printing of plots. The first one is used to re-scale the plot in order to fit the chosen paper size, the other one to print crops marks around the plot (for cutting).</p>
<div class="informalfigure">
<a name="fig-preferences-dialog-3e"></a><div class="mediaobject"><img src="pics/preferences-dialog3e.png"></div>
</div>
</div>
</div>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="sec-template-2d-plot"></a>Working with templates</h3></div></div></div>
<p>If you want to build several plots based on the same model, you can use template files. This allows to save geometry of plots, the values, fonts and colors of labels, etc (see <a class="link" href="reference.html#open-template-cmd"><span class="command"><strong>Open Template</strong></span> command</a> for details on the items which are saved).</p>
<p>In the following example, the pristine figure is the <a class="link" href="using.html#fig-simple-2dplot-3" title="Figure 2.3. A simple 2D plot: the plot finished.">simple 2D plot</a> presented above, it was saved as a template and an empty plot was created by the <span class="command"><strong>Open Template</strong></span>.</p>
<div class="informalfigure">
<a name="fig-open-template"></a><div class="mediaobject"><img src="pics/template1.png"></div>
</div>
<p>You just have to add curves with the <a class="link" href="sec-graph-menu.html#add-remove-curve-cmd"><span class="command"><strong>Add/Remove Curve</strong></span> command</a>, but the style used to draw the curves is not kept in the template.</p>
</div>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="general-concepts.html">Prev</a> </td>
<td width="20%" align="center"> </td>
<td width="40%" align="right"> <a accesskey="n" href="sec-special-plots.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">General Concepts and Terms </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> Other special 2D plots</td>
</tr>
</table>
</div>
</body>
</html>