# sas.qtgui.Plotting package

## Subpackages

- sas.qtgui.Plotting.Masks package
  - Submodules
  - sas.qtgui.Plotting.Masks.BoxMask module
    - `BoxMask`
      - `BoxMask.clear()`
      - `BoxMask.draw()`
      - `BoxMask.get_mask()`
      - `BoxMask.get_params()`
      - `BoxMask.move()`
      - `BoxMask.moveend()`
      - `BoxMask.restore()`
      - `BoxMask.save()`
      - `BoxMask.set_cursor()`
      - `BoxMask.set_params()`
      - `BoxMask.update()`
  - sas.qtgui.Plotting.Masks.CircularMask module
    - `CircularMask`
      - `CircularMask.clear()`
      - `CircularMask.draw()`
      - `CircularMask.getParams()`
      - `CircularMask.move()`
      - `CircularMask.moveend()`
      - `CircularMask.restore()`
      - `CircularMask.save()`
      - `CircularMask.setParams()`
      - `CircularMask.set_cursor()`
      - `CircularMask.set_layer()`
      - `CircularMask.update()`
  - sas.qtgui.Plotting.Masks.SectorMask module
    - `SectorMask`
      - `SectorMask.clear()`
      - `SectorMask.draw()`
      - `SectorMask.get_params()`
      - `SectorMask.move()`
      - `SectorMask.moveend()`
      - `SectorMask.restore()`
      - `SectorMask.save()`
      - `SectorMask.set_cursor()`
      - `SectorMask.set_params()`
      - `SectorMask.update()`
  - Module contents
- sas.qtgui.Plotting.Slicers package
  - Submodules
  - sas.qtgui.Plotting.Slicers.AnnulusSlicer module
    - `AnnulusInteractor`
      - `AnnulusInteractor.clear()`
      - `AnnulusInteractor.draw()`
      - `AnnulusInteractor.getParams()`
      - `AnnulusInteractor.move()`
      - `AnnulusInteractor.moveend()`
      - `AnnulusInteractor.restore()`
      - `AnnulusInteractor.save()`
      - `AnnulusInteractor.setParams()`
      - `AnnulusInteractor.set_cursor()`
      - `AnnulusInteractor.set_layer()`
      - `AnnulusInteractor.update()`
      - `AnnulusInteractor.validate()`
    - `RingInteractor`
      - `RingInteractor.clear()`
      - `RingInteractor.getParams()`
      - `RingInteractor.get_radius()`
      - `RingInteractor.move()`
      - `RingInteractor.moveend()`
      - `RingInteractor.restore()`
      - `RingInteractor.save()`
      - `RingInteractor.setParams()`
      - `RingInteractor.set_cursor()`
      - `RingInteractor.set_layer()`
      - `RingInteractor.update()`
  - sas.qtgui.Plotting.Slicers.ArcInteractor module
    - `ArcInteractor`
      - `ArcInteractor.clear()`
      - `ArcInteractor.move()`
      - `ArcInteractor.moveend()`
      - `ArcInteractor.restore()`
      - `ArcInteractor.save()`
      - `ArcInteractor.set_cursor()`
      - `ArcInteractor.set_layer()`
      - `ArcInteractor.update()`
  - sas.qtgui.Plotting.Slicers.BaseInteractor module
    - `BaseInteractor`
      - `BaseInteractor.clear_markers()`
      - `BaseInteractor.connect_markers()`
      - `BaseInteractor.dpixel()`
      - `BaseInteractor.move()`
      - `BaseInteractor.moveend()`
      - `BaseInteractor.onClick()`
      - `BaseInteractor.onDrag()`
      - `BaseInteractor.onHilite()`
      - `BaseInteractor.onKey()`
      - `BaseInteractor.onLeave()`
      - `BaseInteractor.onRelease()`
      - `BaseInteractor.restore()`
      - `BaseInteractor.save()`
  - sas.qtgui.Plotting.Slicers.BoxSlicer module
    - `BoxInteractor`
      - `BoxInteractor.clear()`
      - `BoxInteractor.draw()`
      - `BoxInteractor.getParams()`
      - `BoxInteractor.move()`
      - `BoxInteractor.moveend()`
      - `BoxInteractor.restore()`
      - `BoxInteractor.save()`
      - `BoxInteractor.setParams()`
      - `BoxInteractor.set_cursor()`
      - `BoxInteractor.set_layer()`
      - `BoxInteractor.update()`
      - `BoxInteractor.update_and_post()`
      - `BoxInteractor.validate()`
    - `BoxInteractorX`
    - `BoxInteractorY`
    - `HorizontalDoubleLine`
      - `HorizontalDoubleLine.clear()`
      - `HorizontalDoubleLine.move()`
      - `HorizontalDoubleLine.moveend()`
      - `HorizontalDoubleLine.restore()`
      - `HorizontalDoubleLine.save()`
      - `HorizontalDoubleLine.setCursor()`
      - `HorizontalDoubleLine.setLayer()`
      - `HorizontalDoubleLine.update()`
    - `PointInteractor`
      - `PointInteractor.clear()`
      - `PointInteractor.move()`
      - `PointInteractor.moveend()`
      - `PointInteractor.restore()`
      - `PointInteractor.save()`
      - `PointInteractor.setCursor()`
      - `PointInteractor.setLayer()`
      - `PointInteractor.update()`
    - `VerticalDoubleLine`
      - `VerticalDoubleLine.clear()`
      - `VerticalDoubleLine.move()`
      - `VerticalDoubleLine.moveend()`
      - `VerticalDoubleLine.restore()`
      - `VerticalDoubleLine.save()`
      - `VerticalDoubleLine.setCursor()`
      - `VerticalDoubleLine.setLayer()`
      - `VerticalDoubleLine.update()`
  - sas.qtgui.Plotting.Slicers.BoxSum module
    - `BoxSumCalculator`
      - `BoxSumCalculator.clear()`
      - `BoxSumCalculator.draw()`
      - `BoxSumCalculator.getParams()`
      - `BoxSumCalculator.getResult()`
      - `BoxSumCalculator.model()`
      - `BoxSumCalculator.moveend()`
      - `BoxSumCalculator.postData()`
      - `BoxSumCalculator.restore()`
      - `BoxSumCalculator.save()`
      - `BoxSumCalculator.setLayer()`
      - `BoxSumCalculator.setModelFromParams()`
      - `BoxSumCalculator.setPanelName()`
      - `BoxSumCalculator.setParams()`
      - `BoxSumCalculator.setParamsFromModel()`
      - `BoxSumCalculator.setReadOnlyParametersFromModel()`
      - `BoxSumCalculator.update()`
      - `BoxSumCalculator.validate()`
    - `HorizontalDoubleLine`
      - `HorizontalDoubleLine.clear()`
      - `HorizontalDoubleLine.move()`
      - `HorizontalDoubleLine.moveend()`
      - `HorizontalDoubleLine.restore()`
      - `HorizontalDoubleLine.save()`
      - `HorizontalDoubleLine.setCursor()`
      - `HorizontalDoubleLine.setLayer()`
      - `HorizontalDoubleLine.update()`
    - `PointInteractor`
      - `PointInteractor.clear()`
      - `PointInteractor.move()`
      - `PointInteractor.moveend()`
      - `PointInteractor.restore()`
      - `PointInteractor.save()`
      - `PointInteractor.setCursor()`
      - `PointInteractor.setLayer()`
      - `PointInteractor.update()`
    - `VerticalDoubleLine`
      - `VerticalDoubleLine.clear()`
      - `VerticalDoubleLine.move()`
      - `VerticalDoubleLine.moveend()`
      - `VerticalDoubleLine.restore()`
      - `VerticalDoubleLine.save()`
      - `VerticalDoubleLine.setCursor()`
      - `VerticalDoubleLine.setLayer()`
      - `VerticalDoubleLine.update()`
  - sas.qtgui.Plotting.Slicers.RadiusInteractor module
    - `RadiusInteractor`
      - `RadiusInteractor.clear()`
      - `RadiusInteractor.move()`
      - `RadiusInteractor.moveend()`
      - `RadiusInteractor.restore()`
      - `RadiusInteractor.save()`
      - `RadiusInteractor.set_cursor()`
      - `RadiusInteractor.set_layer()`
      - `RadiusInteractor.update()`
  - sas.qtgui.Plotting.Slicers.SectorSlicer module
    - `LineInteractor`
      - `LineInteractor.clear()`
      - `LineInteractor.getParams()`
      - `LineInteractor.move()`
      - `LineInteractor.moveend()`
      - `LineInteractor.restore()`
      - `LineInteractor.save()`
      - `LineInteractor.setParams()`
      - `LineInteractor.set_cursor()`
      - `LineInteractor.set_layer()`
      - `LineInteractor.update()`
    - `SectorInteractor`
      - `SectorInteractor.clear()`
      - `SectorInteractor.draw()`
      - `SectorInteractor.getParams()`
      - `SectorInteractor.move()`
      - `SectorInteractor.moveend()`
      - `SectorInteractor.restore()`
      - `SectorInteractor.save()`
      - `SectorInteractor.setParams()`
      - `SectorInteractor.set_cursor()`
      - `SectorInteractor.set_layer()`
      - `SectorInteractor.update()`
      - `SectorInteractor.validate()`
    - `SideInteractor`
      - `SideInteractor.clear()`
      - `SideInteractor.getParams()`
      - `SideInteractor.move()`
      - `SideInteractor.moveend()`
      - `SideInteractor.restore()`
      - `SideInteractor.save()`
      - `SideInteractor.setParams()`
      - `SideInteractor.set_cursor()`
      - `SideInteractor.set_layer()`
      - `SideInteractor.update()`
  - sas.qtgui.Plotting.Slicers.WedgeSlicer module
    - `WedgeInteractor`
      - `WedgeInteractor.clear()`
      - `WedgeInteractor.draw()`
      - `WedgeInteractor.getParams()`
      - `WedgeInteractor.move()`
      - `WedgeInteractor.moveend()`
      - `WedgeInteractor.restore()`
      - `WedgeInteractor.save()`
      - `WedgeInteractor.setParams()`
      - `WedgeInteractor.set_cursor()`
      - `WedgeInteractor.set_layer()`
      - `WedgeInteractor.update()`
      - `WedgeInteractor.validate()`
    - `WedgeInteractorPhi`
    - `WedgeInteractorQ`
  - Module contents
- sas.qtgui.Plotting.UI package
  - Submodules
  - sas.qtgui.Plotting.UI.AddTextUI module
    - `Ui_AddText`
      - `Ui_AddText.retranslateUi()`
      - `Ui_AddText.setupUi()`
  - sas.qtgui.Plotting.UI.BoxSumUI module
    - `Ui_BoxSumUI`
      - `Ui_BoxSumUI.retranslateUi()`
      - `Ui_BoxSumUI.setupUi()`
  - sas.qtgui.Plotting.UI.ColorMapUI module
    - `Ui_ColorMapUI`
      - `Ui_ColorMapUI.retranslateUi()`
      - `Ui_ColorMapUI.setupUi()`
  - sas.qtgui.Plotting.UI.LinearFitUI module
    - `Ui_LinearFitUI`
      - `Ui_LinearFitUI.retranslateUi()`
      - `Ui_LinearFitUI.setupUi()`
  - sas.qtgui.Plotting.UI.MaskEditorUI module
    - `Ui_MaskEditorUI`
      - `Ui_MaskEditorUI.retranslateUi()`
      - `Ui_MaskEditorUI.setupUi()`
  - sas.qtgui.Plotting.UI.PlotLabelPropertiesUI module
    - `Ui_PlotLabelPropertiesUI`
      - `Ui_PlotLabelPropertiesUI.retranslateUi()`
      - `Ui_PlotLabelPropertiesUI.setupUi()`
  - sas.qtgui.Plotting.UI.PlotPropertiesUI module
    - `Ui_PlotPropertiesUI`
      - `Ui_PlotPropertiesUI.retranslateUi()`
      - `Ui_PlotPropertiesUI.setupUi()`
  - sas.qtgui.Plotting.UI.ScalePropertiesUI module
    - `Ui_scalePropertiesUI`
      - `Ui_scalePropertiesUI.retranslateUi()`
      - `Ui_scalePropertiesUI.setupUi()`
  - sas.qtgui.Plotting.UI.SetGraphRangeUI module
    - `Ui_setGraphRangeUI`
      - `Ui_setGraphRangeUI.retranslateUi()`
      - `Ui_setGraphRangeUI.setupUi()`
  - sas.qtgui.Plotting.UI.SlicerParametersUI module
    - `Ui_SlicerParametersUI`
      - `Ui_SlicerParametersUI.retranslateUi()`
      - `Ui_SlicerParametersUI.setupUi()`
  - sas.qtgui.Plotting.UI.WindowTitleUI module
    - `Ui_WindowTitle`
      - `Ui_WindowTitle.retranslateUi()`
      - `Ui_WindowTitle.setupUi()`
  - Module contents

## Submodules

## sas.qtgui.Plotting.AddText module

class sas.qtgui.Plotting.AddText.AddText(parent=None)

  Bases: `QDialog`, `Ui_AddText`

  Simple GUI for a single line text query

  color()
  font()
  onColorChange(event)

    Pop up the standard Qt color change dialog

  onFontChange(event)

    Pop up the standard Qt Font change dialog

  staticMetaObject = PySide6.QtCore.QMetaObject("AddText" inherits "QDialog": )
  text()

## sas.qtgui.Plotting.Arrow3D module

Module that draws multiple arrows in 3D coordinates

class sas.qtgui.Plotting.Arrow3D.Arrow3D(base, xs, ys, zs, colors, *args, **kwargs)

  Bases: `FancyArrowPatch`

  Draw 3D arrow

  do_3d_projection()

    Drawing actually happens here

  on_left_down(event)

    Mouse left-down event

  on_left_up(event)

    Mouse left up event

  set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, arrowstyle=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, connectionstyle=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, hatch_linewidth=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, mutation_aspect=<UNSET>, mutation_scale=<UNSET>, patchA=<UNSET>, patchB=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, positions=<UNSET>, rasterized=<UNSET>, realtime=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, zorder=<UNSET>)

    Set multiple properties at once.

    Supported properties are

    Properties:

      agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image alpha: float or None animated: bool antialiased or aa: bool or None arrowstyle: [ ‘-’ | ‘<-’ | ‘->’ | ‘<->’ | ‘<|-' | '-|>’ | ‘<|-|>’ | ‘]-’ | ‘-[’ | ‘]-[’ | ‘|-|’ | ‘]->’ | ‘<-[’ | ‘simple’ | ‘fancy’ | ‘wedge’ ] capstyle: .CapStyle or {‘butt’, ‘projecting’, ‘round’} clip_box: ~matplotlib.transforms.BboxBase or None clip_on: bool clip_path: Patch or (Path, Transform) or None color: color connectionstyle: [ ‘arc3’ | ‘angle3’ | ‘angle’ | ‘arc’ | ‘bar’ ] edgecolor or ec: color or None facecolor or fc: color or None figure: ~matplotlib.figure.Figure or ~matplotlib.figure.SubFigure fill: bool gid: str hatch: {‘/’, ‘\’, ‘|’, ‘-’, ‘+’, ‘x’, ‘o’, ‘O’, ‘.’, ‘*’} hatch_linewidth: unknown in_layout: bool joinstyle: .JoinStyle or {‘miter’, ‘round’, ‘bevel’} label: object linestyle or ls: {‘-’, ‘–’, ‘-.’, ‘:’, ‘’, (offset, on-off-seq), …} linewidth or lw: float or None mouseover: bool mutation_aspect: float mutation_scale: float patchA: .patches.Patch patchB: .patches.Patch path_effects: list of .AbstractPathEffect picker: None or bool or float or callable positions: unknown rasterized: bool realtime: unknown sketch_params: (scale: float, length: float, randomness: float) snap: bool or None transform: ~matplotlib.transforms.Transform url: str visible: bool zorder: float

  set_realtime(realtime)

    Bool specifying whether arrows should be shown rotating while dragging is in progress May be slow for large numbers of arrows

  update_data(xs, ys, zs)

## sas.qtgui.Plotting.Binder module

Extension to MPL to support the binding of artists to key/mouse events.

class sas.qtgui.Plotting.Binder.BindArtist(figure)

  Bases: `object`

  alt = False
  clear(h1, h2, ...)

    Remove connections for artists h1, h2, …

    Use clearall() to reset all connections.

  clearall()

    Clear connections to all artists.

    Use clear(h1,h2,…) to reset specific artists.

  control = False
  dclick_threshhold = 0.25
  disconnect()

    In case we need to disconnect from the canvas…

  events = ['enter', 'leave', 'motion', 'click', 'dclick', 'drag', 'release', 'scroll', 'key', 'keyup']
  meta = False
  shift = False
  trigger(actor, action, ev)

    Trigger a particular event for the artist. Fallback to axes, to figure, and to ‘all’ if the event is not processed.

class sas.qtgui.Plotting.Binder.Selection(artist=None, prop={})

  Bases: `object`

  Store and compare selections.

  artist = None
  prop = {}

## sas.qtgui.Plotting.BoxSum module

Allows users to modify the box slicer parameters.

class sas.qtgui.Plotting.BoxSum.BoxSum(parent=None, model=None)

  Bases: `QDialog`, `Ui_BoxSumUI`

  closeWidgetSignal
  staticMetaObject = PySide6.QtCore.QMetaObject("BoxSum" inherits "QDialog": Methods: #41 type=Signal, signature=closeWidgetSignal() )

## sas.qtgui.Plotting.ColorMap module

Allows users to change the range of the current graph

class sas.qtgui.Plotting.ColorMap.ColorMap(parent=None, cmap=None, vmin=0.0, vmax=100.0, data=None)

  Bases: `QDialog`, `Ui_ColorMapUI`

  apply_signal
  cmap()

    Getter for the color map

  initColorMap()

    Prepare and display the color map

  initDetectorData()

    Fill out the Detector labels

  initMapCombobox()

    Fill out the combo box with all available color maps

  initRangeSlider()

    Create and display the double slider for data range mapping.

  norm()

    Getter for the color map norm

  onAmplitudeChange()

    Respond to editing the amplitude fields

  onApply()

    Respond to the Apply button click. Send a signal to the plotter with vmin/vmax/cmap for chart update

  onColorMapReversed(isChecked)

    Respond to ticking/unticking the color map reverse checkbox

  onMapIndexChange(index)

    Respond to the color map change event

  onReset()

    Respond to the Reset button click

  redrawColorBar()

    Call ColorbarBase with current values, effectively redrawing the widget

  staticMetaObject = PySide6.QtCore.QMetaObject("ColorMap" inherits "QDialog": Methods: #41 type=Signal, signature=apply_signal(PyObject,QString), parameters=PyObject, QString )
  updateMap()

## sas.qtgui.Plotting.ConvertUnits module

Convert units to strings that can be displayed This is a cleaned up version of unitConverter.py

sas.qtgui.Plotting.ConvertUnits.convertUnit(power, unit)

  Convert units to strings that can be displayed

## sas.qtgui.Plotting.DataTransform module

sas.qtgui.Plotting.DataTransform.errFromX2(x, y=None, dx=None, dy=None)

  calculate error of sqrt(x)

  Parameters:

    - x – float value

    - dx – float value

sas.qtgui.Plotting.DataTransform.errFromX4(x, y=None, dx=None, dy=None)

  calculate error of x^1/4

  Parameters:

    - x – float value

    - dx – float value

sas.qtgui.Plotting.DataTransform.errOneOverSqrtX(x, y=None, dx=None, dy=None)

  Calculate error on 1/sqrt(x)

sas.qtgui.Plotting.DataTransform.errOneOverX(x, y=None, dx=None, dy=None)

  calculate error on 1/x

sas.qtgui.Plotting.DataTransform.errToLog10X(x, y=None, dx=None, dy=None)

  calculate error of Log(x)

  Parameters:

    - x – float value

    - dx – float value

sas.qtgui.Plotting.DataTransform.errToLogX(x, y=None, dx=None, dy=None)

  calculate error of Log(x)

  Parameters:

    - x – float value

    - dx – float value

sas.qtgui.Plotting.DataTransform.errToLogXY(x, y, dx=None, dy=None)

  calculate error of Log(xy)

sas.qtgui.Plotting.DataTransform.errToLogYX2(y, x, dy=None, dx=None)

  calculate error of Log(yx**2)

sas.qtgui.Plotting.DataTransform.errToLogYX4(y, x, dy=None, dx=None)

  error for ln(y*x^(4))

  Parameters:

    x – float value

sas.qtgui.Plotting.DataTransform.errToX(x, y=None, dx=None, dy=None)

  calculate error of x**2

  Parameters:

    - x – float value

    - dx – float value

sas.qtgui.Plotting.DataTransform.errToX2(x, y=None, dx=None, dy=None)

  calculate error of x**2

  Parameters:

    - x – float value

    - dx – float value

sas.qtgui.Plotting.DataTransform.errToX4(x, y=None, dx=None, dy=None)

  calculate error of x**4

  Parameters:

    - x – float value

    - dx – float value

sas.qtgui.Plotting.DataTransform.errToX_pos(x, y=None, dx=None, dy=None)

  calculate error of x**2

  Parameters:

    - x – float value

    - dx – float value

sas.qtgui.Plotting.DataTransform.errToYX2(y, x, dy=None, dx=None)

sas.qtgui.Plotting.DataTransform.errToYX4(y, x, dy=None, dx=None)

  error for (y*x^(4))

  Parameters:

    x – float value

sas.qtgui.Plotting.DataTransform.fromX2(x, y=None)

  This function is used to load value on Plottable.View Calculate square root of x

  Parameters:

    x – float value

sas.qtgui.Plotting.DataTransform.fromX4(x, y=None)

  This function is used to load value on Plottable.View Calculate square root of x

  Parameters:

    x – float value

sas.qtgui.Plotting.DataTransform.toLogX(x, y=None)

  This function is used to load value on Plottable.View calculate log x

  Parameters:

    x – float value

sas.qtgui.Plotting.DataTransform.toLogXY(y, x)

  This function is used to load value on Plottable.View calculate log x

  Parameters:

    x – float value

sas.qtgui.Plotting.DataTransform.toLogYX2(y, x)

sas.qtgui.Plotting.DataTransform.toLogYX4(y, x)

sas.qtgui.Plotting.DataTransform.toOneOverSqrtX(y, x=None)

sas.qtgui.Plotting.DataTransform.toOneOverX(x, y=None)

sas.qtgui.Plotting.DataTransform.toX(x, y=None)

  This function is used to load value on Plottable.View

  Parameters:

    x – Float value

  Returns:

    x

sas.qtgui.Plotting.DataTransform.toX2(x, y=None)

  This function is used to load value on Plottable.View

  Calculate x^(2)

  Parameters:

    x – float value

sas.qtgui.Plotting.DataTransform.toX4(x, y=None)

  This function is used to load value on Plottable.View

  Calculate x^(4)

  Parameters:

    x – float value

sas.qtgui.Plotting.DataTransform.toX_pos(x, y=None)

  This function is used to load value on Plottable.View

  Parameters:

    x – Float value

  Returns:

    x

sas.qtgui.Plotting.DataTransform.toYX2(y, x)

sas.qtgui.Plotting.DataTransform.toYX4(y, x)

## sas.qtgui.Plotting.Fittings module

This module is used to fit a set of x,y data to a model passed to it. It is used to calculate the slope and intercepts for the linearized fits. Two things should be noted:

First, this fitting module uses the NLLSQ module of SciPy rather than a linear fit. This along with a few other modules could probably be removed if we move to a linear regression approach.

Second, this infrastructure does not allow for resolution smearing of the the models. Hence the results are not that accurate even for pinhole collimation of SANS but may be good for SAXS. It is completely wrong for slit smeared data.

class sas.qtgui.Plotting.Fittings.Parameter(model, name, value=None)

  Bases: `object`

  Class to handle model parameters - sets the parameters and their initial value from the model based to it.

  set(value)

    Set the value of the parameter

sas.qtgui.Plotting.Fittings.calcCommandline(event)

sas.qtgui.Plotting.Fittings.sasfit(model, pars, x, y, err_y, qmin=None, qmax=None)

  Fit function

  Parameters:

    - model – sas model object

    - pars – list of parameters

    - x – vector of x data

    - y – vector of y data

    - err_y – vector of y errors

## sas.qtgui.Plotting.LineModel module

Provide Line function (y= Ax + B). Until July 10, 2016 this function provided (y= A + Bx). This however was contrary to all the other code using it which assumed (y= mx+b) or in this nomenclature (y=Ax + B). This lead to some contortions in the code and worse incorrect calculations until now for at least some of the functions. This seemed the easiest to fix particularly since this function should disappear in a future iteration (see notes in fitDialog)

> `-PDB`

>   July 10, 2016

class sas.qtgui.Plotting.LineModel.LineModel

  Bases: `object`

  Class that evaluates a linear model.

  \(f(x) = Ax + B\)

  List of default parameters: A = 1.0 B = 1.0

  getParam(name)

    Return parameter value

  run(x=0.0)

    Evaluate the model

    Parameters:

      x – simple value

    Returns:

      (Line value)

    Note

    This is the function called by fitDialog to calculate the the y(xmin) and y(xmax), but the only difference between this and runXY is when the if statement is true. I however cannot see what that function is for. It needs to be documented here or removed. -PDB 7/10/16

  runXY(x=0.0)

    Evaluate the model.

    Parameters:

      x – simple value

    Returns:

      Line value

    ..note::

      This is to be what is called by fitDialog for the actual fit but the only difference between this and run is when the if statement is true. I however cannot see what that function is for. It needs to be documented here or removed. -PDB 7/10/16

  setParam(name, value)

    Set parameter value

## sas.qtgui.Plotting.LinearFit module

Adds a linear fit plot to the chart

class sas.qtgui.Plotting.LinearFit.LinearFit(parent: PlotterBase | None = None, data: Data1D | None = None, max_range: tuple = (0.0, 0.0), fit_range: tuple = (0.0, 0.0), xlabel: str = '', ylabel: str = '')

  Bases: `QDialog`, `Ui_LinearFitUI`

  accept()
  checkFitValues(item: QLineEdit) → bool

    Check the validity of input values

  clearSliders()

    Clear existing sliders

  closeEvent(ev: QEvent)
  drawSliders()

    Show new Q-range sliders

  eventFilter(watched: PlotterBase, event: QEvent) → bool
  fit(event: QEvent)

    Performs the fit. Receive an event when clicking on the button Fit.Computes chisqr , A and B parameters of the best linear fit y=Ax +B Push a plottable to the caller

  floatInvTransform(x: float) → float

    transform a float.It is used to determine the x.View min and x.View max for values not in x. Also used to properly calculate RgQmin, RgQmax and to update qmin and qmax in the linear range boxes on the panel.

  origData() -> (<class 'numpy.ndarray'>, <class 'numpy.ndarray'>, <class 'numpy.ndarray'>)
  range() → tuple
  reject()
  setRangeLabel(label: str = '')

    Overwrite default fit range label to correspond to actual unit

  staticMetaObject = PySide6.QtCore.QMetaObject("LinearFit" inherits "QDialog": Methods: #41 type=Signal, signature=updatePlot(PyObject,PyObject), parameters=PyObject, PyObject )
  updatePlot

## sas.qtgui.Plotting.MaskEditor module

class sas.qtgui.Plotting.MaskEditor.MaskEditor(parent=None, data=None)

  Bases: `QDialog`, `Ui_MaskEditorUI`

  clearSlicer()

    Clear the slicer on the plot

  emptyRadioButtons()

    Uncheck all buttons without them firing signals causing unnecessary slicer updates

  initializeSignals()

    Attach slots to signals from radio boxes

  onAdd()

    Generate required mask and modify underlying DATA

  onClear()

    Remove the current mask(s)

  onMask(slicer=None, inside=True)

    Clear the previous mask and create a new one.

  onReset()

    Removes all the masks from data

  setSlicer(slicer)

    Clear the previous slicer and create a new one. slicer: slicer class to create

  staticMetaObject = PySide6.QtCore.QMetaObject("MaskEditor" inherits "QDialog": )
  update()

    Redraw the canvas

  updateMask(mask)

    Respond to changes in masking

## sas.qtgui.Plotting.PlotHelper module

Singleton plot helper module All its variables are bound to the module, which can not be instantiated repeatedly so IDs are session-specific.

sas.qtgui.Plotting.PlotHelper.addPlot(plot)

  Adds a new plot to the current dictionary of plots

sas.qtgui.Plotting.PlotHelper.clear()

  Reset the plot dictionary

sas.qtgui.Plotting.PlotHelper.currentPlotIds()

  Returns a list of IDs for all currently active plots

sas.qtgui.Plotting.PlotHelper.deletePlot(plot_id)

  Deletes an existing plot from the dictionary

sas.qtgui.Plotting.PlotHelper.idOfPlot(plot)

  Returns the ID of the plot

sas.qtgui.Plotting.PlotHelper.plotById(plot_id)

  Returns the plot referenced by the ID

## sas.qtgui.Plotting.PlotLabelProperties module

class sas.qtgui.Plotting.PlotLabelProperties.PlotLabelProperties(parent=None, x_props={}, y_props={})

  Bases: `QDialog`, `Ui_PlotLabelPropertiesUI`

  Dialog for modification of plot label properties

  apply_to_ticks_x()

    return status of the “Apply to ticks” checkbox for x-axis

  apply_to_ticks_y()

    return status of the “Apply to ticks” checkbox for y-axis

  fx()

    return font parameters for x-axis

  fy()

    return font parameters for y-axis

  onColorChange()

    Pop up the standard Qt color change dialog

  onColorChange_y()

    Pop up the standard Qt color change dialog

  onColorIndexChange()

    Dynamically add/remove “Custom” color index

  onColorIndexChange_y()

    Dynamically add/remove “Custom” color index

  staticMetaObject = PySide6.QtCore.QMetaObject("PlotLabelProperties" inherits "QDialog": )
  text_x()

    return current legend text for x-axis

  text_y()

    return current legend text for y-axis

class sas.qtgui.Plotting.PlotLabelProperties.PlotLabelPropertyHolder(font=None, color=None, weight=None, size=None, text='')

  Bases: `object`

  property color
  property font
  property size
  property text
  property weight

## sas.qtgui.Plotting.PlotProperties module

class sas.qtgui.Plotting.PlotProperties.PlotProperties(parent=None, color=0, marker=0, marker_size=5, legend='')

  Bases: `QDialog`, `Ui_PlotPropertiesUI`

  Dialog for modification of single plot properties

  color()

    return current color: index in COLORS or a hex string

  legend()

    return current legend

  marker()

    return the current shape index in SHAPE

  markersize()

    return marker size (int)

  onColorChange()

    Pop up the standard Qt color change dialog

  onColorIndexChange()

    Dynamically add/remove “Custom” color index

  staticMetaObject = PySide6.QtCore.QMetaObject("PlotProperties" inherits "QDialog": )

## sas.qtgui.Plotting.PlotUtilities module

sas.qtgui.Plotting.PlotUtilities.build_matrix(data, qx_data, qy_data)

  Build a matrix for 2d plot from a vector Returns a matrix (image) with ~ square binning Requirement: need 1d array formats of data, qx_data, and qy_data where each one corresponds to z, x, or y axis values

sas.qtgui.Plotting.PlotUtilities.fillupPixels(image=None, weights=None)

  Fill z values of the empty cells of 2d image matrix with the average over up-to next nearest neighbor points

  Parameters:

    image – (2d matrix with some zi = None)

  Returns:

    image (2d array )

  TODO:

    Find better way to do for-loop below

sas.qtgui.Plotting.PlotUtilities.getValidColor(color)

  Returns a valid matplotlib color

sas.qtgui.Plotting.PlotUtilities.get_bins(qx_data, qy_data)

  get bins return x_bins and y_bins: 1d arrays of the index with ~ square binning Requirement: need 1d array formats of qx_data, and qy_data where each one corresponds to x, or y axis values

sas.qtgui.Plotting.PlotUtilities.rescale(lo, hi, step, pt=None, bal=None, scale='linear')

  Rescale (lo,hi) by step, returning the new (lo,hi) The scaling is centered on pt, with positive values of step driving lo/hi away from pt and negative values pulling them in. If bal is given instead of point, it is already in [0,1] coordinates.

  This is a helper function for step-based zooming.

## sas.qtgui.Plotting.Plottables module

Prototype plottable object support.

The main point of this prototype is to provide a clean separation between the style (plotter details: color, grids, widgets, etc.) and substance (application details: which information to plot). Programmers should not be dictating line colours and plotting symbols.

Unlike the problem of style in CSS or Word, where most paragraphs look the same, each line on a graph has to be distinguishable from its neighbours. Our solution is to provide parametric styles, in which a number of different classes of object (e.g., reflectometry data, reflectometry theory) representing multiple graph primitives cycle through a colour palette provided by the underlying plotter.

A full treatment would provide perceptual dimensions of prominence and distinctiveness rather than a simple colour number.

class sas.qtgui.Plotting.Plottables.Chisq(chisq=None)

  Bases: `Plottable`

  Chisq plottable plots the chisq

  render(plot, **kw)
  setChisq(chisq)

    Set the chisq value.

class sas.qtgui.Plotting.Plottables.Graph(**kw)

  Bases: `object`

  Generic plottables graph structure.

  Plot styles are based on color/symbol lists. The user gets to select the list of colors/symbols/sizes to choose from, not the application developer. The programmer only gets to add/remove lines from the plot and move to the next symbol/color.

  Another dimension is prominence, which refers to line sizes/point sizes.

  Axis transformations allow the user to select the coordinate view which provides clarity to the data. There is no way we can provide every possible transformation for every application generically, so the plottable objects themselves will need to provide the transformations. Here are some examples from reflectometry:

      independent: x -> f(x)
         monitor scaling: y -> M*y
         log:  y -> log(y if y > min else min)
         cos:  y -> cos(y*pi/180)
      dependent:   x -> f(x,y)
         Q4:      y -> y*x^4
         fresnel: y -> y*fresnel(x)
      coordinated: x,y = f(x,y)
         Q:    x -> 2*pi/L (cos(x*pi/180) - cos(y*pi/180))
               y -> 2*pi/L (sin(x*pi/180) + sin(y*pi/180))
      reducing: x,y = f(x1,x2,y1,y2)
         spin asymmetry: x -> x1, y -> (y1 - y2)/(y1 + y2)
         vector net: x -> x1, y -> y1*cos(y2*pi/180)

  Multiple transformations are possible, such as Q4 spin asymmetry

  Axes have further complications in that the units of what are being plotted should correspond to the units on the axes. Plotting multiple types on the same graph should be handled gracefully, e.g., by creating a separate tab for each available axis type, breaking into subplots, showing multiple axes on the same plot, or generating inset plots. Ultimately the decision should be left to the user.

  Graph properties such as grids/crosshairs should be under user control, as should the sizes of items such as axis fonts, etc. No direct access will be provided to the application.

  Axis limits are mostly under user control. If the user has zoomed or panned then those limits are preserved even if new data is plotted. The exception is when, e.g., scanning through a set of related lines in which the user may want to fix the limits so that user can compare the values directly. Another exception is when creating multiple graphs sharing the same limits, though this case may be important enough that it is handled by the graph widget itself. Axis limits will of course have to understand the effects of axis transformations.

  High level plottable objects may be composed of low level primitives. Operations such as legend/hide/show copy/paste, etc. need to operate on these primitives as a group. E.g., allowing the user to have a working canvas where they can drag lines they want to save and annotate them.

  Graphs need to be printable. A page layout program for entire plots would be nice.

  add(plottable, color=None)

    Add a new plottable to the graph

  changed()

    Detect if any graphed plottables have changed

  delete(plottable)

    Remove an existing plottable from the graph

  get(key)

    Get the graph properties

  get_plottable(name)

    Return the plottable with the given name if it exists. Otherwise return None

  get_range()

    Return the range of all displayed plottables

  isPlotted(plottable)

    Return True is the plottable is already on the graph

  render(plot)

    Redraw the graph

  replace(plottable)

    Replace an existing plottable from the graph

  reset()

    Reset the graph.

  reset_scale()

    Resets the scale transformation data to the underlying data

  returnPlottable()

    This method returns a dictionary of plottables contained in graph It is just by Plotpanel to interact with the complete list of plottables inside the graph.

  set(**kw)

    Set the graph properties

  title(name)

    Graph title

  xaxis(name, units)

    Properties of the x axis.

  yaxis(name, units)

    Properties of the y axis.

class sas.qtgui.Plotting.Plottables.Plottable

  Bases: `object`

  check_data_PlottableX()

    Since no transformation is made for log10(x), check that no negative values is plot in log scale

  check_data_PlottableY()

    Since no transformation is made for log10(y), check that no negative values is plot in log scale

  colors()

    Return the number of colors need to render the object

  custom_color = None
  dx = None
  dy = None
  get_xaxis()

    Return the units and name of x-axis

  get_yaxis()

    Return the units and name of y- axis

  hidden = False
  interactive = True
  is_empty()

    Returns True if there is no data stored in the plottable

  classmethod labels(collection)

    Construct a set of unique labels for a collection of plottables of the same type.

    Returns a map from plottable to name.

  markersize = 3
  name = None
  onFitRange(xmin=None, xmax=None)

    It limits View data range to plot from min to max

    Parameters:

      - xmin – the minimum value of x to plot.

      - xmax – the maximum value of x to plot

  onReset()

    Reset x, y, dx, dy view with its parameters

  render(plot)

    The base class makes sure the correct units are being used for subsequent plottable.

    For now it is assumed that the graphs are commensurate, and if you put a Qx object on a Temperature graph then you had better hope that it makes sense.

  reset_view()

    Reload view with new value to plot

  returnValuesOfView()

    Return View parameters and it is used by Fit Dialog

  setLabel(labelx, labely)

    It takes a label of the x and y transformation and set View parameters

    Parameters:

      - transx – The label of x transformation is sent by Properties Dialog

      - transy – The label of y transformation is sent Properties Dialog

  set_View(x, y)

    Load View

  set_data(x, y, dx=None, dy=None)
  short_name = None
  show_yzero = False
  transformView()

    It transforms x, y before displaying

  transformX(transx, transdx)

    Receive pointers to function that transform x and dx and set corresponding View pointers

    Parameters:

      - transx – pointer to function that transforms x

      - transdx – pointer to function that transforms dx

  transformY(transy, transdy)

    Receive pointers to function that transform y and dy and set corresponding View pointers

    Parameters:

      - transy – pointer to function that transforms y

      - transdy – pointer to function that transforms dy

  x = None
  xaxis(name, units)

    Set the name and unit of x_axis

    Parameters:

      - name – the name of x-axis

      - units – the units of x_axis

  y = None
  yaxis(name, units)

    Set the name and unit of y_axis

    Parameters:

      - name – the name of y-axis

      - units – the units of y_axis

class sas.qtgui.Plotting.Plottables.PlottableData1D(x, y, dx=None, dy=None)

  Bases: `Plottable`

  Data plottable: scatter plot of x,y with errors in x and y.

  changed()
  classmethod labels(collection)

    Build a label mostly unique within a collection

  render(plot, **kw)

    Renders the plottable on the graph

class sas.qtgui.Plotting.Plottables.PlottableData2D(image=None, qx_data=None, qy_data=None, err_image=None, xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None)

  Bases: `Plottable`

  2D data class for image plotting

  changed()
  classmethod labels(collection)

    Build a label mostly unique within a collection

  render(plot, **kw)

    Renders the plottable on the graph

  setValues(datainfo=None)

    Use datainfo object to initialize data2D

    Parameters:

      datainfo – object

  set_zrange(zmin=None, zmax=None)
  xaxis(label, unit)

    set x-axis

    Parameters:

      - label – x-axis label

      - unit – x-axis unit

  yaxis(label, unit)

    set y-axis

    Parameters:

      - label – y-axis label

      - unit – y-axis unit

  zaxis(label, unit)

    set z-axis

    Parameters:

      - label – z-axis label

      - unit – z-axis unit

class sas.qtgui.Plotting.Plottables.PlottableFit1D(data=None, theory=None)

  Bases: `Plottable`

  Fit plottable: composed of a data line plus a theory line. This is treated like a single object from the perspective of the graph, except that it will have two legend entries, one for the data and one for the theory.

  The color of the data and theory will be shared.

  changed()
  render(plot, **kw)

class sas.qtgui.Plotting.Plottables.PlottableTheory1D(x, y, dy=None)

  Bases: `Plottable`

  Theory plottable: line plot of x,y with confidence interval y.

class sas.qtgui.Plotting.Plottables.Text(text=None, xpos=0.5, ypos=0.9, name='text')

  Bases: `Plottable`

  getText(text)

    Get the text string.

  render(plot, **kw)
  setText(text)

    Set the text string.

  set_x(x)

    Set the x position of the text ACCEPTS: float

  set_y(y)

    Set the y position of the text ACCEPTS: float

class sas.qtgui.Plotting.Plottables.Transform

  Bases: `object`

  Define a transform plugin to the plottable architecture.

  Transforms operate on axes. The plottable defines the set of transforms available for it, and the axes on which they operate. These transforms can operate on the x axis only, the y axis only or on the x and y axes together.

  This infrastructure is not able to support transformations such as log and polar plots as these require full control over the drawing of axes and grids.

  A transform has a number of attributes.

  name

    user visible name for the transform. This will appear in the context menu for the axis and the transform menu for the graph.

  type

    operational axis. This determines whether the transform should appear on x,y or z axis context menus, or if it should appear in the context menu for the graph.

  inventory

    (not implemented) a dictionary of user settable parameter names and their associated types. These should appear as keyword arguments to the transform call. For example, Fresnel reflectivity requires the substrate density: `{ 'rho': type.Value(10e-6/units.angstrom**2) }` Supply reasonable defaults in the callback so that limited plotting clients work even though they cannot set the inventory.

class sas.qtgui.Plotting.Plottables.View(x=None, y=None, dx=None, dy=None)

  Bases: `object`

  Representation of the data that might include a transformation

  check_data_logX()

    Remove negative value in x vector to avoid plotting negative value of Log10

  check_data_logY()

    Remove negative value in y vector to avoid plotting negative value of Log10

  dx = None
  dy = None
  onFitRangeView(xmin=None, xmax=None)

    It limits View data range to plot from min to max

    Parameters:

      - xmin – the minimum value of x to plot.

      - xmax – the maximum value of x to plot

  onResetView()

    Reset x,y,dx and y in their full range and in the initial scale in case their previous range has changed

  returnXview()

    Return View x,y,dx,dy

  setTransformX(funcx, funcdx)

    Receive pointers to function that transform x and dx and set corresponding View pointers

    Parameters:

      - transx – pointer to function that transforms x

      - transdx – pointer to function that transforms dx

  setTransformY(funcy, funcdy)

    Receive pointers to function that transform y and dy and set corresponding View pointers

    Parameters:

      - transx – pointer to function that transforms y

      - transdx – pointer to function that transforms dy

  transform(x=None, y=None, dx=None, dy=None)
    Transforms the x,y,dx and dy vectors and stores

      the output in View parameters

    Parameters:

      - x – array of x values

      - y – array of y values

      - dx – array of errors values on x

      - dy – array of error values on y

  x = None
  y = None

sas.qtgui.Plotting.Plottables.all(L)

sas.qtgui.Plotting.Plottables.any(L)

## sas.qtgui.Plotting.Plotter module

class sas.qtgui.Plotting.Plotter.Plotter(parent=None, quickplot=False)

  Bases: `QDialog`, `PlotterWidget`

  staticMetaObject = PySide6.QtCore.QMetaObject("Plotter" inherits "QDialog": )

class sas.qtgui.Plotting.Plotter.PlotterWidget(parent=None, manager=None, quickplot=False)

  Bases: `PlotterBase`

  1D Plot widget for use with a QDialog

  addPlotsToContextMenu()

    Adds operations on all plotted sets of data to the context menu

  createContextMenu()

    Define common context menu and associated actions for the MPL widget

  createContextMenuQuick()

    Define context menu and associated actions for the quickplot MPL widget

  property data

    data getter

  has_nonempty_plots() → bool
  onAddText()

    Show a dialog allowing adding custom text to the chart

  onCusotmizeLabel()

    Show label customization widget

  onFitDisplay(temp_x, temp_y)

    Add a linear fitting line to the chart

  onFreeze(id)

    Freezes the selected plot to a separate chart

  onLegendMotion(event)

    On legend in motion

  onLinearFit(id)

    Creates and displays a simple linear fit for the selected plot

  onModifyPlot(id)

    Allows for MPL modifications to the selected plot

  onMplMouseDown(event)

    Left button down and ready to drag

  onMplMouseMotion(event)

    Check if the left button is press and the mouse in moving. Compute delta for x and y coordinates and then perform the drag

  onMplMouseUp(event)

    Set the data coordinates of the click

  onMplPick(event)

    On pick legend

  onMplWheel(event)

    Process mouse wheel as zoom events

  onRemovePlot(id)

    Responds to the plot delete action

  onRemoveText()

    Remove the most recently added text

  onResetGraphRange()

    Resets the chart X and Y ranges to their original values

  onScaleChange()

    Show a dialog allowing axes rescaling

  onSetGraphRange()

    Show a dialog allowing setting the chart ranges

  onToggleHideError(id)

    Toggles hide error/show error menu item

  onToggleLegend()

    Toggle legend visibility in the chart

  plot(data=None, color=None, marker=None, hide_error=False, transform=True)

    Add a new plot of self._data to the chart.

  removePlot(id)

    Deletes the selected plot from the chart

  replacePlot(id, new_plot, retain_dimensions=True)

    Remove plot ‘id’ and add ‘new_plot’ to the chart. This effectively refreshes the chart with changes to one of its plots

  staticMetaObject = PySide6.QtCore.QMetaObject("PlotterWidget" inherits "PlotterBase": )
  toggleSlider(id)
  xyTransform(xLabel='', yLabel='')

    Transforms x and y in View and set the scale

## sas.qtgui.Plotting.Plotter2D module

class sas.qtgui.Plotting.Plotter2D.Plotter2D(parent=None, quickplot=False, dimension=2)

  Bases: `QDialog`, `Plotter2DWidget`

  Plotter widget implementation

  staticMetaObject = PySide6.QtCore.QMetaObject("Plotter2D" inherits "QDialog": )

class sas.qtgui.Plotting.Plotter2D.Plotter2DWidget(parent=None, manager=None, quickplot=False, dimension=2)

  Bases: `PlotterBase`

  2D Plot widget for use with a QDialog

  calculateDepth()

    Re-calculate the plot depth parameters depending on the scale

  circularAverage()

    Calculate the circular average and create the Data object for it

  createContextMenu()

    Define common context menu and associated actions for the MPL widget

  createContextMenuQuick()

    Define context menu and associated actions for the quickplot MPL widget

  property data

    data getter

  property data0
  getActivePlots()

    utility method for manager query of active plots

  imageShow(img, origin=None)

    Show background image :Param img: [imread(path) from matplotlib.pyplot]

  onAnnulusView()

    Perform sector averaging on Phi and draw annulus slicer

  onApplyMap(v_values, cmap)

    Update the chart color map based on data passed from the widget

  onBoxAveragingX()

    Perform 2D data averaging on Qx Create a new slicer.

  onBoxAveragingY()

    Perform 2D data averaging on Qy Create a new slicer .

  onBoxSum()

    Perform 2D Data averaging Qx and Qy. Display box slicer details.

  onCircularAverage()

    Perform circular averaging on Data2D

  onClearSlicer()

    Remove all sclicers from the chart

  onColorMap()

    Display the color map dialog and modify the plot’s map accordingly

  onEditSlicer()

    Present a dialog for manipulating the current slicer

  onMplMouseDown(event)

    Display x/y/intensity on click

  onSectorView()

    Perform sector averaging on Q and draw sector slicer

  onToggleMaskedData(event)

    Toggle the visibility of masked data points.

  onToggleScale(event)

    Toggle axis and replot image

  onWedgeAveragingPhi()

    Perform 2D data averaging on Phi Create a new slicer .

  onWedgeAveragingQ()

    Perform 2D data averaging on Q Create a new slicer .

  plot(data=None, marker=None, show_colorbar=True, update=False)

    Plot 2D self._data marker - unused

  replacePlot(id, new_plot)

    Replace data in current chart. This effectively refreshes the chart with changes to one of its plots

  setSlicer(slicer, reset=True)

    Clear the previous slicer and create a new one. slicer: slicer class to create

  showPlot(data, qx_data, qy_data, xmin, xmax, ymin, ymax, zmin, zmax, label='data2D', cmap=<matplotlib.colors.LinearSegmentedColormap object>, show_colorbar=True, update=False)

    Render and show the current data

  staticMetaObject = PySide6.QtCore.QMetaObject("Plotter2DWidget" inherits "PlotterBase": )
  updateCircularAverage()

    Update circular averaging plot on Data2D change

  updateSlicer()

    Update slicer plot on Data2D change

## sas.qtgui.Plotting.PlotterBase module

class sas.qtgui.Plotting.PlotterBase.PlotterBase(parent=None, manager=None, quickplot=False)

  Bases: `QWidget`

  clean()

    Redraw the graph

  clearQRangeSliders()
  closeEvent(event)

    Overwrite the close event adding helper notification

  createContextMenu()

    Define common context menu and associated actions for the MPL widget

  createContextMenuQuick()

    Define context menu and associated actions for the quickplot MPL widget

  property data

    data getter

  defaultContextMenu()

    Content of the dialog-universal context menu: Save, Print and Copy

  draw()
  property item

    getter for this plot’s QStandardItem

  offset_graph()

    Zoom and offset the graph to the last known settings

  onClipboardCopy()

    Copy MPL widget area to buffer

  onDataInfo(plot_data)

    Displays data info text window for the selected plot

  onGridToggle()

    Add/remove grid lines from MPL plot

  onImagePrint()

    Display printer dialog and print the MPL widget area

  onImageSave()

    Use the internal MPL method for saving to file

  onMplMouseDown(event)

    Mouse button down callback

  onMplMouseMotion(event)

    Mouse motion callback

  onMplMouseUp(event)

    Mouse button up callback

  onMplPick(event)

    Mouse pick callback

  onMplWheel(event)

    Mouse wheel scroll callback

  onResize(event)

    Redefine default resize event

  onSavePoints(plot_data)

    Saves plot data to a file

  onToggleMenu()

    Toggle navigation menu visibility in the chart

  onWindowsTitle()

    Show a dialog allowing chart title customisation

  plot(marker=None, linestyle=None)

    PURE VIRTUAL Plot the content of self._data

  showContextMenu(point)
  property showLegend

    Legend visibility getter

  staticMetaObject = PySide6.QtCore.QMetaObject("PlotterBase" inherits "QWidget": )
  title(title='')

    title setter

  update()
  updatePlotHelper()

    Notify the plot helper about the new plot

  property xLabel

    x-label getter

  property xscale

    X-axis scale getter

  property yLabel

    y-label getter

  property yscale

    Y-axis scale getter

## sas.qtgui.Plotting.PlotterData module

Adapters for fitting module

class sas.qtgui.Plotting.PlotterData.Data1D(x=None, y=None, dx=None, dy=None)

  Bases: `PlottableData1D`, `Data1D`

  copy_from_datainfo(data1d)

    copy values of Data1D of type DataLaoder.Data_info

class sas.qtgui.Plotting.PlotterData.Data2D(image=None, err_image=None, qx_data=None, qy_data=None, q_data=None, mask=None, dqx_data=None, dqy_data=None, xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None)

  Bases: `PlottableData2D`, `Data2D`

  copy_from_datainfo(data2d)

    copy value of Data2D of type DataLoader.data_info

class sas.qtgui.Plotting.PlotterData.DataRole(*values)

  Bases: `Enum`

  Labels to apply to different plot types.

  ROLE_ANGULAR_SLICE = 9
  ROLE_DATA = 1
  ROLE_DEFAULT = 2
  ROLE_DELETABLE = 3
  ROLE_LIN_LIN = 7
  ROLE_POLYDISPERSITY = 8
  ROLE_RESIDUAL = 4
  ROLE_RESIDUAL_SESANS = 5
  ROLE_SIZE_DISTRIBUTION = 10
  ROLE_STAND_ALONE = 6

sas.qtgui.Plotting.PlotterData.check_data_validity(data)

  Return True is data is valid enough to compute chisqr, else False

## sas.qtgui.Plotting.QRangeSlider module

Double slider interactor for setting the Q range for a fit or function

class sas.qtgui.Plotting.QRangeSlider.LineInteractor(base: Plotter, axes: Plotter.ax, color: str = 'black', zorder: int = 5, x: float = 0.5, y: float = 0.5, input: list[str] = None, setter: list[str] = None, getter: list[str] = None, perspective: str = None, tab: str = None)

  Bases: `BaseInteractor`

  Draw a single vertical line that can be dragged on a plot

  clear() → None

    Disconnect any inputs and callbacks and the clear the line and marker

  clear_markers() → None

    Disconnect the input and clear the callbacks

  draw(zorder: int = 5) → None

    Draw the line and marker on the linked plot using the latest x and y values

  property getter: Callable | None

    Get the x-value getter method associated with this slider

  property input: QLineEdit | QTextEdit | None

    Get the text input that should be linked to the position of this slider

  inputChanged() → None

    Track the input linked to the x value for this slider and update as needed

  move(x: float, y: float, ev: QEvent) → None

    Process move to a new position, making sure that the move is allowed.

  onRelease(ev: QEvent) → bool

    Update the line position when the mouse button is released

  remove() → None

    Clear this slicer and its markers

  restore(ev: QEvent) → None

    Restore the position for this line

  save(ev: QEvent) → None

    Remember the position for this line so that we can restore on Esc.

  property setter: Callable | None

    Get the x-value setter method associated with this slider

  update(x: float = None, y: float = None, draw: bool = False) → None

    Update the line position on the graph.

class sas.qtgui.Plotting.QRangeSlider.QRangeSlider(base: Plotter, axes: Plotter.ax, color: str = 'black', zorder: int = 5, data: Data1D = None)

  Bases: `BaseInteractor`

  Draw a pair of draggable vertical lines. Each line can be linked to a GUI input. The GUI input should update the lines and vice-versa.

  clear() → None

    Clear this slicer and its markers

  clear_markers() → None

    Clear each of the lines individually

  draw() → None

    Update the plot

  move(x: float, y: float, ev: QEvent) → None

    Process move to a new position, making sure that the move is allowed.

  remove() → None

    Remove this slicer and its markers

  restore(ev: QEvent) → None

    Restore the lines.

  save(ev: QEvent) → None

    Remember the position of the lines so that we can restore on Esc.

  show() → None

    Show this slicer and its markers

  toggle() → None

    Toggle the slider visibility.

  update(x: float = None, y: float = None) → None

    Draw the new lines on the graph.

## sas.qtgui.Plotting.ScaleProperties module

class sas.qtgui.Plotting.ScaleProperties.ScaleProperties(parent=None, init_scale_x='x', init_scale_y='y')

  Bases: `QDialog`, `Ui_scalePropertiesUI`

  getValues()

    Return current values from comboboxes

  staticMetaObject = PySide6.QtCore.QMetaObject("ScaleProperties" inherits "QDialog": )
  viewIndexChanged(index)

    Update X and Y labels based on the “View” index

  xyIndexChanged(index)

    Update View label based on the “X” and “Y” index

## sas.qtgui.Plotting.SetGraphRange module

Allows users to change the range of the current graph

class sas.qtgui.Plotting.SetGraphRange.SetGraphRange(parent=None, x_range: tuple[float, float] = (0.0, 0.0), y_range: tuple[float, float] = (0.0, 0.0))

  Bases: `QDialog`, `Ui_setGraphRangeUI`

  staticMetaObject = PySide6.QtCore.QMetaObject("SetGraphRange" inherits "QDialog": )
  xrange()

    Return a tuple with line edit content of (xmin, xmax)

  yrange()

    Return a tuple with line edit content of (ymin, ymax)

## sas.qtgui.Plotting.SlicerModel module

class sas.qtgui.Plotting.SlicerModel.SlicerModel

  Bases: `object`

  getParams()

    pure virtual

  model()

    getter for the model

  setModelFromParams()

    Set up the Qt model for data handling between controls

  setParams()

    pure virtual

  setParamsFromModel()

    Set up the params dictionary based on the current model content.

  setParamsFromModelItem(item)

    Set up the params dictionary for the parameter in item.

  validate()

    pure virtual

## sas.qtgui.Plotting.SlicerParameters module

Allows users to modify the box slicer parameters.

class sas.qtgui.Plotting.SlicerParameters.EditDelegate(parent=None, validate_method=None)

  Bases: `QStyledItemDelegate`

  createEditor(parent, option, index)
  refocus_signal
  setModelData(editor, model, index)

    Custom version of the model update, rejecting bad values

  staticMetaObject = PySide6.QtCore.QMetaObject("EditDelegate" inherits "QStyledItemDelegate": Methods: #9 type=Signal, signature=refocus_signal(int,int), parameters=int, int )

class sas.qtgui.Plotting.SlicerParameters.FittingType(*values)

  Bases: `Enum`

  FITTING_BATCH: int = 2
  FITTING_SINGLE: int = 1
  INVERSION_BATCH: int = 4
  INVERSION_SINGLE: int = 3
  NO_FITTING: int = 0

class sas.qtgui.Plotting.SlicerParameters.PositiveDoubleEditor(parent=None)

  Bases: `QLineEdit`

  editingFinished
  focusOutEvent(event)
  staticMetaObject = PySide6.QtCore.QMetaObject("PositiveDoubleEditor" inherits "QLineEdit": )

class sas.qtgui.Plotting.SlicerParameters.ProxyModel(parent=None)

  Bases: `QIdentityProxyModel`

  Trivial proxy model with custom column edit flag

  columnReadOnly(column)

    Returns True if column is read only, false otherwise

  flags(index)

    Sets column flags

  setColumnReadOnly(column, readonly=True)

    Add/removes a column from the readonly list

  staticMetaObject = PySide6.QtCore.QMetaObject("ProxyModel" inherits "QIdentityProxyModel": )

class sas.qtgui.Plotting.SlicerParameters.SlicerParameters(parent=None, model=None, active_plots=None, validate_method=None, communicator=None)

  Bases: `QDialog`, `Ui_SlicerParametersUI`

  Interaction between the QTableView and the underlying model, passed from a slicer instance.

  applyPlotter(plot)

    Apply the current slicer to a plot

  check_perspective_and_set_data(fitting_requested, perspective_name, items_for_fit)
  closeEvent(event)

    Overwritten close widget method in order to send the close signal to the parent.

  closeWidgetSignal
  enableFileControls(enabled)

    Sets enablement of file related UI elements

  getCurrentPlotDict()

    Returns a dictionary of currently shown plots {plot_name:checkbox_status}

  keyPressEvent(event)

    Added Esc key shortcut

  onApply()

    Apply current slicer to selected plots

  onChooseFilesLocation()

    Open save file location dialog

  onFocus(row, column)

    Set the focus on the cell (row, column)

  onGeneratePlots(isChecked)

    Respond to choice of auto saving plots

  onHelp()

    Display generic data averaging help

  onParamChange()

    Respond to param change by updating plots

  onSlicerChanged(index)

    change the parameters based on the slicer chosen

  prepareFilePathFromData(data)

    Prepares full, unique path for a 1D plot

  save1DPlotsForPlot(plots)

    Save currently shown 1D sliced data plots for a given 2D plot

  sendToFit(items_for_fit, fitting_requested)

    Send items_for_fit to the Fit perspective, in either single fit or batch mode

  serializeData(data, filepath)

    Write out 1D plot in a requested format

  setModel(model)

    Model setter

  setParamsList()

    Create and initially populate the list of parameters

  setPlotsList()

    Create and initially populate the list of plots

  setSlots()

    define slots for signals from various sources

  staticMetaObject = PySide6.QtCore.QMetaObject("SlicerParameters" inherits "QDialog": Methods: #41 type=Signal, signature=closeWidgetSignal() )
  updatePlotList()

## sas.qtgui.Plotting.WindowTitle module

Allows users to change the title of the current graph from “Graph_n” to any ASCII text.

class sas.qtgui.Plotting.WindowTitle.WindowTitle(parent=None, new_title='')

  Bases: `QDialog`, `Ui_WindowTitle`

  Simple GUI for a single line text query

  staticMetaObject = PySide6.QtCore.QMetaObject("WindowTitle" inherits "QDialog": )
  title()

    Return the new title

## Module contents