schrodinger.ui.qt.radial_plot module

Widgets to plot various kinds of radial plots

class schrodinger.ui.qt.radial_plot.Sector(ring: str, theta_0: float, theta_1: float, data: Any)

Bases: object

A Sector described a specific region within a one ring of a RadianRingHistogram and that region’s associated data, if any.

Variables
  • ring – the label associated with the ring the region is located in

  • theta_0 – the lower bound theta of the region in radians

  • theta_1 – the upper bound theta of the region in radians

  • data – any associated data with the region

ring: str
theta_0: float
theta_1: float
data: Any
__init__(ring: str, theta_0: float, theta_1: float, data: Any) None
class schrodinger.ui.qt.radial_plot.RadialRingHistogram(figure, *args, **kwargs)

Bases: PyQt6.QtCore.QObject

A RadialRingHistogram is a radial plot such that each ring, i.e each concentric circle, describes a separate histogram. Each histogram in the rings share the same x-axis namely the theta coordinates of the polar plot

Because the y-axis, i.e. the radius of the polar plot, is not used to display the frequency of the histogram data, another dimension is needed to display the frequency for example, color

Variables
  • sectorClicked – emitted when a sector is clicked on by the user

  • mouseRightButtonClicked – emitted when mouse right click button pressed on plot

sectorClicked

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

mouseRightButtonClicked

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

__init__(figure, *args, **kwargs)

Initialize the histogram

Parameters

figure (smatplotlib.SmatplotlibCanvas) – the canvas to plot the figure on

initFigure()

Clear and initialize the internal matplotlib figure

setRingData(ring_types, ring_data)

Set the data associated with each ring and the labels that are used for each ring in the plot.

NOTE: len(ring_types) must equal len(ring_data)

Parameters
  • ring_types (List[str]) – the labels to describe each ring

  • ring_data (List[List[Any]]) – the data associated with each ring to plot a histogram for

drawTicks()

Set the y-tick labels on the polar plot to the ring_types set from setRingData

setSectorData(sector_data, sector_width)

Set the relevant information regarding data for each sector

Parameters
  • sector_data (List[List[Any]]) – the histogram data associated with each sector

  • sector_width (float) – the implicit width used when calculating the histogram of sector_data

drawPlot(*args, **kwargs)

Plot the histograms with the data for each ring

shouldShowSectorAnnotation(sector)

Whether the given sector should show an annotation

Parameters

sector (Sector) – the sector in question

Returns

whether to display the annotation

Return type

bool

getSectorAnnotation(sector)

Get the text that should be displayed as the annotation for the given sector

Parameters

sector (Sector) – the sector in questions

Returns

the annotation

Return type

str

getSectorAnnotationLoc(sector)

Get the absolute location of the annotation to be displayed for the given sector in polar coordinates

Parameters

sector (Sector) – the sector in question

Returns

A tuple of (radius, theta) of where the annotation should be placed

Return type

Tuple[float, float]