source: sasview/src/sas/qtgui/MainWindow/media/graph_help.rst @ de1c5ed

ESS_GUIESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since de1c5ed was de1c5ed, checked in by Piotr Rozyczko <rozyczko@…>, 6 years ago

Updated linear fit in plotting docs (screenshot)

  • Property mode set to 100755
File size: 12.3 KB
RevLine 
[23a9beb]1.. graph_help.rst
[0d66541]2
[78f02c3]3.. This is a port of the original SasView html help file to ReSTructured text
4.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015.
5
[3fd3d5a4]6
[37bbd5f]7Plotting Data/Models
8====================
9
[96423f8]10SasView generates three different types of graph window: one that displays *1D data*
[5ed76f8]11(i.e., $I(Q)$ vs $Q$), one that displays *1D residuals* (ie, the difference between the
12experimental data and the theory at the same $Q$ values), and *2D color maps*.
[96423f8]13
[0cdf1af]14Graph window options
[3fd3d5a4]15--------------------
[78f02c3]16
[0cdf1af]17.. _Invoking_the_graph_menu:
[78f02c3]18
[0cdf1af]19Invoking the graph menu
20^^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]21
[e68c9bf]22To invoke the *Graph Menu* simply right-click on a data/theory plot, or click
23the *Graph Menu* (bullet list) icon in the toolbar at the bottom of the plot.
[3fd3d5a4]24Then select a menu item.
[78f02c3]25
[0cdf1af]26How to Hide-Show-Delete a graph
27^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[78f02c3]28
[e68c9bf]29To expand a plot window, click the *Maximise* (square) icon in the top-right
[3fd3d5a4]30corner.
[78f02c3]31
[e68c9bf]32To shrink a plot window, click the *Restore down* (square-on-square) icon in
[3fd3d5a4]33the top-right corner.
[78f02c3]34
[e68c9bf]35To hide a plot, click the *Minimise* (-) icon in the top-right corner of the
[3fd3d5a4]36plot window.
[23a9beb]37
[e68c9bf]38To show a hidden plot, select the *Restore up* (square-on-square) icon on the
[3fd3d5a4]39minimised window.
40
[e68c9bf]41To delete a plot, click the *Close* (x) icon in the top-right corner of the
[3fd3d5a4]42plot window.
43
[5ed76f8]44.. note::
[f9b0c81]45    *If a residuals graph (when fitting data) is hidden, it will not show up
46    after computation.*
[3fd3d5a4]47
[0cdf1af]48Dragging a plot
49^^^^^^^^^^^^^^^
[23a9beb]50
[e68c9bf]51Select the *Pan* (crossed arrows) icon in the toolbar at the bottom of the plot
52to activate this option. Move the mouse pointer to the plot. It will change to
53a hand. Then left-click and drag the plot around. The axis values will adjust
[3fd3d5a4]54accordingly.
[e68c9bf]55
[3fd3d5a4]56To disable dragging mode, unselect the *crossed arrows* icon on the toolbar.
[23a9beb]57
[0cdf1af]58Zooming In-Out on a plot
59^^^^^^^^^^^^^^^^^^^^^^^^
[78f02c3]60
[e68c9bf]61Select the *Zoom* (magnifying glass) button in the toolbar at the bottom of
62the plot to activate this option. Move the mouse pointer to the plot. It will
63change to a cross-hair. Then left-click and drag the pointer around to generate
[3fd3d5a4]64a region of interest. Release the mouse button to generate the new view.
[78f02c3]65
[3fd3d5a4]66To disable zoom mode, unselect the *Zoom* button on the toolbar.
[78f02c3]67
[e68c9bf]68After zooming in on a a region, the *left arrow* or *right arrow* buttons on
[3fd3d5a4]69the toolbar will switch between recent views.
[78f02c3]70
[f9b0c81]71The axis range can also be specified manually.  To do so go to the *Graph Menu*
72(see Invoking_the_graph_menu_ for further details), choose the *Set Graph Range*
73option and enter the limits in the pop box.
74
[e68c9bf]75*NOTE! If a wheel mouse is available scrolling the wheel will zoom in/out
76on the current plot (changing both axes). Alternatively, point at the numbers
[3fd3d5a4]77on one axis and scroll the wheel to zoom in/out on just that axis.*
[78f02c3]78
[e68c9bf]79To return to the original view of the data, click the the *Reset* (home) icon
[0cdf1af]80in the toolbar at the bottom of the plot (see Resetting_the_graph_ for further details).
[23a9beb]81
[0cdf1af]82Saving a plot image
83^^^^^^^^^^^^^^^^^^^
[78f02c3]84
[e68c9bf]85To save the current plot as an image file, right click on the plot to bring up
[0cdf1af]86the *Graph Menu* (see Invoking_the_graph_menu_) and select *Save Image*.
[e68c9bf]87Alternatively, click on the *Save* (floppy disk) icon in the toolbar at the
[3fd3d5a4]88bottom of the plot.
[e68c9bf]89
90A dialog window will open. Select a folder, enter a filename, choose an output
[3fd3d5a4]91image type, and click *Save*.
92
93The currently supported image types are:
94
95*  EPS (encapsulated postscript)
96*  EMF (enhanced metafile)
97*  JPG/JPEG (joint photographics experts group)
98*  PDF (portable documant format)
99*  PNG (portable network graphics)
100*  PS (postscript)
[318427a9]101*  RAW/RGBA (bitmap, stored as 935x635 pixels of depth 8)
[3fd3d5a4]102*  SVG/SVGA (scalable vector graphics)
103*  TIF/TIFF (tagged iamge file)
104
[0cdf1af]105Printing a plot
106^^^^^^^^^^^^^^^
[78f02c3]107
[e68c9bf]108To send the current plot to a printer, click on the *Print* (printer) icon in
[3fd3d5a4]109the toolbar at the bottom of the plot.
[78f02c3]110
[0cdf1af]111.. _Resetting_the_graph:
[3fd3d5a4]112
[0cdf1af]113Resetting the graph
114^^^^^^^^^^^^^^^^^^^
[78f02c3]115
[e68c9bf]116To reset the axis range of a graph to its initial values select *Reset Graph
[0cdf1af]117Range* on the *Graph Menu* (see Invoking_the_graph_menu_). Alternatively, use
[3fd3d5a4]118the *Reset* (home) icon in the toolbar at the bottom of the plot.
[78f02c3]119
[0cdf1af]120Modifying the graph
121^^^^^^^^^^^^^^^^^^^
[23a9beb]122
[f9b0c81]123It is possible to make custom modifications to plots including:
[23a9beb]124
[3fd3d5a4]125*  changing the plot window title
[f9b0c81]126*  changing the default legend location and toggling it on/off
127*  changing the axis label text
128*  changing the axis label units
129*  changing the axis label font & font colour
[3fd3d5a4]130*  adding/removing a text string
131*  adding a grid overlay
[23a9beb]132
[f9b0c81]133The legend and text strings can be drag and dropped around the plot
134
135These options are accessed through the *Graph Menu* (see Invoking_the_graph_menu_)
136and selecting *Modify Graph Appearance* (for axis labels, grid overlay and
137legend position) or *Add Text* to add textual annotations, selecting font, color,
138style and size. *Remove Text* will remove the last annotation added. To change
139the legend. *Window Title* allows a custom title to be entered instead of Graph
[5ed76f8]140x.
[f9b0c81]141
[0cdf1af]142Changing scales
143^^^^^^^^^^^^^^^
[78f02c3]144
[3fd3d5a4]145This menu option is only available with 1D data.
146
[0cdf1af]147From the *Graph Menu* (see Invoking_the_graph_menu_) select *Change Scale*. A
[e68c9bf]148dialog window will appear in which it is possible to choose different
[3fd3d5a4]149transformations of the x (usually Q) or y (usually I(Q)) axes, including:
150
151*  x, x^2, x^4, ln(x), log10(x), log10(x^4)
152*  y, 1/y, ln(y), y^2, y.(x^4), 1/sqrt(y),
153*  log10(y), ln(y.x), ln(y.x^2), ln(y.x^4), log10(y.x^4)
[e68c9bf]154
[3fd3d5a4]155A *View* option includes short-cuts to common SAS transformations, such as:
156
157*  linear
158*  Guinier
159*  X-sectional Guinier
160*  Porod
161*  Kratky
162
[e68c9bf]163For properly corrected and scaled data, these SAS transformations can be used
164to estimate, for example, Rg, rod diameter, or SANS incoherent background
[0cdf1af]165levels, via a linear fit (see Making_a_linear_fit_).
[3fd3d5a4]166
[0cdf1af]167Toggling scales
168^^^^^^^^^^^^^^^
[3fd3d5a4]169
170This menu option is only available with 2D data.
171
[0cdf1af]172From the *Graph Menu* (see Invoking_the_graph_menu_) select *Toggle Linear/Log
[e68c9bf]173Scale* to switch between a linear to log intensity scale. The type of scale
[3fd3d5a4]174selected is written alongside the colour scale.
175
[0cdf1af]1762D color maps
177^^^^^^^^^^^^^
[3fd3d5a4]178
179This menu option is only available with 2D data.
180
[a9dc4eb]181From the *Graph Menu* (see Invoking_the_graph_menu_) select *2D Color Map* to
[e68c9bf]182choose a different color scale for the image and/or change the maximum or
[3fd3d5a4]183minimum limits of the scale.
184
[0cdf1af]185Getting data coordinates
186^^^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]187
[e68c9bf]188Clicking anywhere in the plot window will cause the current coordinates to be
[3fd3d5a4]189displayed in the status bar at the very bottom-left of the SasView window.
[e68c9bf]190
[3fd3d5a4]191.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[23a9beb]192
[0cdf1af]193Dataset menu options
194--------------------
195
196.. _Invoking_the_dataset_menu:
197
198Invoking the dataset menu
199^^^^^^^^^^^^^^^^^^^^^^^^^
200
201From the *Graph Menu* (see Invoking_the_graph_menu_) highlight a plotted
[3fd3d5a4]202dataset.
203
[0cdf1af]204Getting data info
205^^^^^^^^^^^^^^^^^
[3fd3d5a4]206
[0cdf1af]207In the *Dataset Menu* (see Invoking_the_dataset_menu_), highlight a data set
[e68c9bf]208and select *DataInfo* to bring up a data information dialog panel for that
[3fd3d5a4]209data set.
210
[0cdf1af]211Saving data
212^^^^^^^^^^^
[3fd3d5a4]213
[0cdf1af]214In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Save Points as
[e68c9bf]215a File* (if 1D data) or *Save as a file(DAT)* (if 2D data). A save dialog will
[3fd3d5a4]216appear.
217
[e68c9bf]2181D data can be saved in either ASCII text (.TXT) or CanSAS/SASXML (.XML)
[a9dc4eb]219formats (see :ref:`Formats`).
[1394952]220
[a9dc4eb]2212D data can only be saved in the NIST 2D format (.DAT) (see :ref:`Formats`).
[78f02c3]222
[0cdf1af]223.. _Making_a_linear_fit:
[78f02c3]224
[0cdf1af]225Making a linear fit
226^^^^^^^^^^^^^^^^^^^
[78f02c3]227
[5ed76f8]228Linear fit performs a simple $y(x)=ax+b$ linear fit within the plot window.
[3fd3d5a4]229
[0cdf1af]230In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Linear Fit*. A
[e68c9bf]231fitting dialog will appear. Set some initial parameters and data limits and
232click *Fit*. The fitted parameter values are displayed and the resulting line
233calculated from them is added to the plot.
[3fd3d5a4]234
[de1c5ed]235..
236    This option is most useful for performing simple Guinier, XS Guinier, and
237    Porod type analyses, for example, to estimate $R_g$, a rod diameter, or incoherent
238    background level, respectively.
[3fd3d5a4]239
[de1c5ed]240    The following figure shows an example of a Guinier analysis using this option
[78f02c3]241
242.. image:: guinier_fit.png
243
[0cdf1af]244Removing data from the plot
245^^^^^^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]246
[0cdf1af]247In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Remove*. The
[3fd3d5a4]248selected data will be removed from the plot.
249
[f9b0c81]250.. note::
251    The Remove data set action cannot be undone.
[78f02c3]252
[0cdf1af]253Show-Hide error bars
254^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]255
[0cdf1af]256In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Show Error Bar*
[e68c9bf]257or *Hide Error Bar* to switch between showing/hiding the errors associated
258with the chosen dataset.
[3fd3d5a4]259
[0cdf1af]260Modify plot properties
261^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]262
[0cdf1af]263In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Modify Plot
[e68c9bf]264Property* to change the size, color, or shape of the displayed marker for the
[f9b0c81]265chosen dataset, or to change the dataset label that appears in the plot legend
266box.
[78f02c3]267
268.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
269
[0cdf1af]2702D data averaging
[78f02c3]271-----------------
272
[3fd3d5a4]273Purpose
[0cdf1af]274^^^^^^^
[3fd3d5a4]275
276This feature is only available with 2D data.
[23a9beb]277
[e68c9bf]2782D data averaging allows you to perform different types of averages on your
279data. The region to be averaged is displayed in the plot window and its limits
[3fd3d5a4]280can be modified by dragging the boundaries around.
[78f02c3]281
[0cdf1af]282How to average
283^^^^^^^^^^^^^^
[78f02c3]284
[0cdf1af]285In the *Dataset Menu* (see Invoking_the_dataset_menu_), select one of the
[3fd3d5a4]286following averages
[78f02c3]287
[3fd3d5a4]288*  Perform Circular Average
289*  Sector [Q view]
290*  Annulus [Phi view]
291*  Box sum
292*  Box averaging in Qx
293*  Box averaging on Qy
[78f02c3]294
[e68c9bf]295A 'slicer' will appear (except for *Perform Circular Average*) in the plot that
296you can drag by clicking on a slicer's handle. When the handle is highlighted
[3fd3d5a4]297in red, it means that the slicer can move/change size.
[78f02c3]298
[e68c9bf]299*NOTE! The slicer size will reset if you try to select a region greater than
[3fd3d5a4]300the size of the data.*
301
[e68c9bf]302Alternatively, once a 'slicer' is active you can also select the region to
303average by bringing back the *Dataset Menu* and selecting *Edit Slicer
304Parameters*. A dialog window will appear in which you can enter values to
[3fd3d5a4]305define a region or select the number of points to plot (*nbins*).
306
[e68c9bf]307A separate plot window will also have appeared, displaying the requested
[3fd3d5a4]308average.
309
[f9b0c81]310.. note::
311    The displayed average only updates when input focus is moved back to
312    that window; ie, when the mouse pointer is moved onto that plot.
[3fd3d5a4]313
[e68c9bf]314Selecting *Box Sum* automatically brings up the 'Slicer Parameters' dialog in
[3fd3d5a4]315order to display the average numerically, rather than graphically.
316
317To remove a 'slicer', bring back the *Dataset menu* and select *Clear Slicer*.
[78f02c3]318
[0cdf1af]319Unmasked circular average
320^^^^^^^^^^^^^^^^^^^^^^^^^
[23a9beb]321
[5ed76f8]322This operation will perform an average in constant $Q$ rings around the (x,y)
[3fd3d5a4]323pixel location of the beam center.
[78f02c3]324
[0cdf1af]325Masked circular average
326^^^^^^^^^^^^^^^^^^^^^^^
[78f02c3]327
[e68c9bf]328This operation is the same as 'Unmasked Circular Average' except that any
[3fd3d5a4]329masked region is excluded.
[78f02c3]330
[0cdf1af]331Sector average [Q View]
332^^^^^^^^^^^^^^^^^^^^^^^
[23a9beb]333
[5ed76f8]334This operation averages in constant $Q$ arcs.
[3fd3d5a4]335
[5ed76f8]336The width of the sector is specified in degrees ($\pm\delta|\phi|$) each side
337of the central angle $\phi$.
[78f02c3]338
[5ed76f8]339Annular average [:math:`\phi`]
340^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]341
[5ed76f8]342This operation performs an average between two $Q$ values centered on (0,0),
[3fd3d5a4]343and averaged over a specified number of pixels.
[78f02c3]344
[5ed76f8]345The data is returned as a function of angle $\phi$ in degrees with zero
[3fd3d5a4]346degrees at the 3 O'clock position.
[78f02c3]347
[0cdf1af]348Box sum
349^^^^^^^
[78f02c3]350
[3fd3d5a4]351This operation performs a sum of counts in a 2D region of interest.
352
[e68c9bf]353When editing the slicer parameters, the user can enter the length and the width
[3fd3d5a4]354the rectangular slicer and the coordinates of the center of the rectangle.
[78f02c3]355
[23a9beb]356Box Averaging in Qx
[0cdf1af]357^^^^^^^^^^^^^^^^^^^
[78f02c3]358
[5ed76f8]359This operation computes an average $I(Q_x)$ for the region of interest.
[3fd3d5a4]360
[e68c9bf]361When editing the slicer parameters, the user can control the length and the
362width the rectangular slicer. The averaged output is calculated from constant
[5ed76f8]363bins with rectangular shape. The resultant $Q$ values are nominal values, that
[3fd3d5a4]364is, the central value of each bin on the x-axis.
[78f02c3]365
[23a9beb]366Box Averaging in Qy
[0cdf1af]367^^^^^^^^^^^^^^^^^^^
[78f02c3]368
[5ed76f8]369This operation computes an average $I(Q_y)$ for the region of interest.
[23a9beb]370
[e68c9bf]371When editing the slicer parameters, the user can control the length and the
372width the rectangular slicer. The averaged output is calculated from constant
[5ed76f8]373bins with rectangular shape. The resultant $Q$ values are nominal values, that
[3fd3d5a4]374is, the central value of each bin on the x-axis.
[78f02c3]375
[3fd3d5a4]376.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[78f02c3]377
[f9b0c81]378.. note::  This help document was last modified by Paul Butler, 05 September, 2016
Note: See TracBrowser for help on using the repository browser.