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

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.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since e4c897b was 318427a9, checked in by smk78, 8 years ago

Edits to the 'Saving a plot image' section in respect of the RAW/RGBA
and PGF formats.

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