source: sasview/src/sas/sasgui/guiframe/media/graph_help.rst @ fd62331

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since fd62331 was f9b0c81, checked in by butler, 8 years ago

update the graph/plotting documentation with new set axis range option,
fixed information on modifying plots and added new image for linearized
fits that includes new look. Fixes #621

  • Property mode set to 100644
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*
11(ie, 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*.
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
[f9b0c81]44.. note:: 
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
140x.
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
[3fd3d5a4]228Linear fit performs a simple ( y(x)=ax+b ) linear fit within the plot window.
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
235This option is most useful for performing simple Guinier, XS Guinier, and
[e68c9bf]236Porod type analyses, for example, to estimate Rg, a rod diameter, or incoherent
[3fd3d5a4]237background level, respectively.
238
239The following figure shows an example of a Guinier analysis using this option
[78f02c3]240
241.. image:: guinier_fit.png
242
[0cdf1af]243Removing data from the plot
244^^^^^^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]245
[0cdf1af]246In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Remove*. The
[3fd3d5a4]247selected data will be removed from the plot.
248
[f9b0c81]249.. note::
250    The Remove data set action cannot be undone.
[78f02c3]251
[0cdf1af]252Show-Hide error bars
253^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]254
[0cdf1af]255In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Show Error Bar*
[e68c9bf]256or *Hide Error Bar* to switch between showing/hiding the errors associated
257with the chosen dataset.
[3fd3d5a4]258
[0cdf1af]259Modify plot properties
260^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]261
[0cdf1af]262In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Modify Plot
[e68c9bf]263Property* to change the size, color, or shape of the displayed marker for the
[f9b0c81]264chosen dataset, or to change the dataset label that appears in the plot legend
265box.
[78f02c3]266
267.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
268
[0cdf1af]2692D data averaging
[78f02c3]270-----------------
271
[3fd3d5a4]272Purpose
[0cdf1af]273^^^^^^^
[3fd3d5a4]274
275This feature is only available with 2D data.
[23a9beb]276
[e68c9bf]2772D data averaging allows you to perform different types of averages on your
278data. The region to be averaged is displayed in the plot window and its limits
[3fd3d5a4]279can be modified by dragging the boundaries around.
[78f02c3]280
[0cdf1af]281How to average
282^^^^^^^^^^^^^^
[78f02c3]283
[0cdf1af]284In the *Dataset Menu* (see Invoking_the_dataset_menu_), select one of the
[3fd3d5a4]285following averages
[78f02c3]286
[3fd3d5a4]287*  Perform Circular Average
288*  Sector [Q view]
289*  Annulus [Phi view]
290*  Box sum
291*  Box averaging in Qx
292*  Box averaging on Qy
[78f02c3]293
[e68c9bf]294A 'slicer' will appear (except for *Perform Circular Average*) in the plot that
295you can drag by clicking on a slicer's handle. When the handle is highlighted
[3fd3d5a4]296in red, it means that the slicer can move/change size.
[78f02c3]297
[e68c9bf]298*NOTE! The slicer size will reset if you try to select a region greater than
[3fd3d5a4]299the size of the data.*
300
[e68c9bf]301Alternatively, once a 'slicer' is active you can also select the region to
302average by bringing back the *Dataset Menu* and selecting *Edit Slicer
303Parameters*. A dialog window will appear in which you can enter values to
[3fd3d5a4]304define a region or select the number of points to plot (*nbins*).
305
[e68c9bf]306A separate plot window will also have appeared, displaying the requested
[3fd3d5a4]307average.
308
[f9b0c81]309.. note::
310    The displayed average only updates when input focus is moved back to
311    that window; ie, when the mouse pointer is moved onto that plot.
[3fd3d5a4]312
[e68c9bf]313Selecting *Box Sum* automatically brings up the 'Slicer Parameters' dialog in
[3fd3d5a4]314order to display the average numerically, rather than graphically.
315
316To remove a 'slicer', bring back the *Dataset menu* and select *Clear Slicer*.
[78f02c3]317
[0cdf1af]318Unmasked circular average
319^^^^^^^^^^^^^^^^^^^^^^^^^
[23a9beb]320
[e68c9bf]321This operation will perform an average in constant Q-rings around the (x,y)
[3fd3d5a4]322pixel location of the beam center.
[78f02c3]323
[0cdf1af]324Masked circular average
325^^^^^^^^^^^^^^^^^^^^^^^
[78f02c3]326
[e68c9bf]327This operation is the same as 'Unmasked Circular Average' except that any
[3fd3d5a4]328masked region is excluded.
[78f02c3]329
[0cdf1af]330Sector average [Q View]
331^^^^^^^^^^^^^^^^^^^^^^^
[23a9beb]332
[3fd3d5a4]333This operation averages in constant Q-arcs.
334
[e68c9bf]335The width of the sector is specified in degrees (+/- |delta|\|phi|\) each side
[3fd3d5a4]336of the central angle (|phi|\).
[78f02c3]337
[0cdf1af]338Annular average [|phi| View]
339^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[3fd3d5a4]340
[e68c9bf]341This operation performs an average between two Q-values centered on (0,0),
[3fd3d5a4]342and averaged over a specified number of pixels.
[78f02c3]343
[e68c9bf]344The data is returned as a function of angle (|phi|\) in degrees with zero
[3fd3d5a4]345degrees at the 3 O'clock position.
[78f02c3]346
[0cdf1af]347Box sum
348^^^^^^^
[78f02c3]349
[3fd3d5a4]350This operation performs a sum of counts in a 2D region of interest.
351
[e68c9bf]352When editing the slicer parameters, the user can enter the length and the width
[3fd3d5a4]353the rectangular slicer and the coordinates of the center of the rectangle.
[78f02c3]354
[23a9beb]355Box Averaging in Qx
[0cdf1af]356^^^^^^^^^^^^^^^^^^^
[78f02c3]357
[3fd3d5a4]358This operation computes an average I(Qx) for the region of interest.
359
[e68c9bf]360When editing the slicer parameters, the user can control the length and the
361width the rectangular slicer. The averaged output is calculated from constant
362bins with rectangular shape. The resultant Q values are nominal values, that
[3fd3d5a4]363is, the central value of each bin on the x-axis.
[78f02c3]364
[23a9beb]365Box Averaging in Qy
[0cdf1af]366^^^^^^^^^^^^^^^^^^^
[78f02c3]367
[3fd3d5a4]368This operation computes an average I(Qy) for the region of interest.
[23a9beb]369
[e68c9bf]370When editing the slicer parameters, the user can control the length and the
371width the rectangular slicer. The averaged output is calculated from constant
372bins with rectangular shape. The resultant Q values are nominal values, that
[3fd3d5a4]373is, the central value of each bin on the x-axis.
[78f02c3]374
[3fd3d5a4]375.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[78f02c3]376
[f9b0c81]377.. note::  This help document was last modified by Paul Butler, 05 September, 2016
Note: See TracBrowser for help on using the repository browser.