schrodinger.ui.qt.smatplotlib module

Contains Schrodinger helper widgets for matplotlib display in PyQt

class schrodinger.ui.qt.smatplotlib.SmatplotlibToolbar(canvas, parent, coordinates=True, allow_log=True, allow_linear=True, clipboard=True, toolitems=(('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous view', 'back', 'back'), ('Forward', 'Forward to next view', 'forward', 'forward'), (None, None, None, None), ('Pan', 'Left button pans, Right button zooms\nx/y fixes axis, CTRL fixes aspect', 'move', 'pan'), ('Zoom', 'Zoom to rectangle\nx/y fixes axis', 'zoom_to_rect', 'zoom'), ('Subplots', 'Configure subplots', 'subplots', 'configure_subplots'), ('Customize', 'Edit axis, curve and image parameters', 'qt4_editor_options', 'edit_parameters'), (None, None, None, None), ('Save', 'Save the figure', 'filesave', 'save_figure')))

Bases: schrodinger.ui.qt.navtoolbar.NavToolbar

Kept for backward compatibility - use navtoolbar.NavToolbar instead

Deprecated

use schrodinger.ui.qt.navtoolbar.NavToolbar instead

DrawChildren = 2
DrawWindowBackground = 1
IgnoreMask = 4
class PaintDeviceMetric(value)

Bases: enum.Enum

An enumeration.

PdmWidth = 1
PdmHeight = 2
PdmWidthMM = 3
PdmHeightMM = 4
PdmNumColors = 5
PdmDepth = 6
PdmDpiX = 7
PdmDpiY = 8
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
PdmDepth = 6
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
PdmDpiX = 7
PdmDpiY = 8
PdmHeight = 2
PdmHeightMM = 4
PdmNumColors = 5
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmWidth = 1
PdmWidthMM = 3
class RenderFlag(value)

Bases: enum.Flag

An enumeration.

DrawWindowBackground = 1
DrawChildren = 2
IgnoreMask = 4
TOOL_ITEMS = (('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous view', 'back', 'back'), ('Forward', 'Forward to next view', 'forward', 'forward'), (None, None, None, None), ('Pan', 'Left button pans, Right button zooms\nx/y fixes axis, CTRL fixes aspect', 'move', 'pan'), ('Zoom', 'Zoom to rectangle\nx/y fixes axis', 'zoom_to_rect', 'zoom'), ('Subplots', 'Configure subplots', 'subplots', 'configure_subplots'), ('Customize', 'Edit axis, curve and image parameters', 'qt4_editor_options', 'edit_parameters'), (None, None, None, None), ('Save', 'Save the figure', 'filesave', 'save_figure'))
__init__(canvas, parent, coordinates=True, allow_log=True, allow_linear=True, clipboard=True, toolitems=(('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous view', 'back', 'back'), ('Forward', 'Forward to next view', 'forward', 'forward'), (None, None, None, None), ('Pan', 'Left button pans, Right button zooms\nx/y fixes axis, CTRL fixes aspect', 'move', 'pan'), ('Zoom', 'Zoom to rectangle\nx/y fixes axis', 'zoom_to_rect', 'zoom'), ('Subplots', 'Configure subplots', 'subplots', 'configure_subplots'), ('Customize', 'Edit axis, curve and image parameters', 'qt4_editor_options', 'edit_parameters'), (None, None, None, None), ('Save', 'Save the figure', 'filesave', 'save_figure')))

Create the toolbar

Parameters
  • canvas (schrodinger.mpl_backend_agg.FigureCanvasQTAgg) – The matplotlib canvas

  • parent (QtWidgets.QWidget) – The Qt parent widget

  • coordinates (bool) – Whether the cursor coordinates should be shown on the right side of the toolbar

  • allow_log (bool) – Whether log axes should be selectable in the Figure Option dialog

  • allow_linear (bool) – Whether linear axes should be selectable in the Figure Option dialog

  • clipboard (bool) – Whether a copy to clipboard button should be included

  • toolitems (list(tuple)) – Custom tool items to be loaded

acceptDrops(self) bool
accessibleDescription(self) str
accessibleName(self) str
actionAt(self, p: QPoint) QAction
actionAt(self, ax: int, ay: int) QAction
actionEvent(self, event: QActionEvent)
actionGeometry(self, action: QAction) QRect
actionTriggered

actionTriggered(self, action: QAction) [signal]

actions(self) List[QAction]
activateWindow(self)
addAction(self, a0: QAction)
addAction(self, text: str) QAction
addAction(self, icon: QIcon, text: str) QAction
addAction(self, text: str, slot: PYQT_SLOT) QAction
addAction(self, icon: QIcon, text: str, slot: PYQT_SLOT) QAction
addActions(self, actions: Iterable[QAction])
addSeparator(self) QAction
addWidget(self, widget: QWidget) QAction
adjustSize(self)
adjustWindowClosing()
allowedAreas(self) Qt.ToolBarArea
allowedAreasChanged

allowedAreasChanged(self, allowedAreas: Qt.ToolBarArea) [signal]

autoFillBackground(self) bool
back(*args)

Move back up the view lim stack.

For convenience of being directly connected as a GUI callback, which often get passed additional parameters, this method accepts arbitrary parameters, but does not use them.

backgroundRole(self) QPalette.ColorRole
baseSize(self) QSize
blockSignals(self, b: bool) bool
changeEvent(self, event: QEvent)
childAt(self, p: QPoint) QWidget
childAt(self, ax: int, ay: int) QWidget
childEvent(self, a0: QChildEvent)
children(self) List[QObject]
childrenRect(self) QRect
childrenRegion(self) QRegion
clear(self)
clearFocus(self)
clearMask(self)
close(self) bool
closeEvent(self, a0: QCloseEvent)
colorCount(self) int
configure_subplots()

Fixes a bug in the NavigationToolbar2QTAgg that causes the Reset button to reset to the wrong “original” plot if it is first modified by the configure subplots button. EV 98504.

connectNotify(self, signal: QMetaMethod)
contentsMargins(self) QMargins
contentsRect(self) QRect
contextMenuEvent(self, a0: QContextMenuEvent)
contextMenuPolicy(self) Qt.ContextMenuPolicy
copyImageToClipboard()

Copy an image of the plot to the clipboard

create(self, window: PyQt6.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
createWindowContainer(window: QWindow, parent: typing.Optional[QWidget] = None, flags: Qt.WindowType = Qt.WindowFlags()) QWidget
cursor(self) QCursor
customContextMenuRequested

customContextMenuRequested(self, pos: QPoint) [signal]

customEvent(self, a0: QEvent)
deleteLater(self)
depth(self) int
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
destroyed

destroyed(self, object: typing.Optional[QObject] = None) [signal]

devType(self) int
devicePixelRatio(self) float
devicePixelRatioF(self) float
devicePixelRatioFScale() float
disconnect(a0: QMetaObject.Connection) bool
disconnect(self) None
disconnectNotify(self, signal: QMetaMethod)
dragEnterEvent(self, a0: QDragEnterEvent)
dragLeaveEvent(self, a0: QDragLeaveEvent)
dragMoveEvent(self, a0: QDragMoveEvent)
drag_pan(event)

Callback for dragging in pan/zoom mode.

drag_zoom(event)

Callback for dragging in zoom mode.

draw_rubberband(event, x0, y0, x1, y1)

Draw a rectangle rubberband to indicate zoom limits.

Note that it is not guaranteed that x0 <= x1 and y0 <= y1.

dropEvent(self, a0: QDropEvent)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) List[QByteArray]
edit_parameters()

Open up the Customize plot dialog.

Fixes a bug in the matplotlib implementation (EV: 120930) for figures with multiple subplots without titles.

effectiveWinId(self) PyQt6.sip.voidptr
ensurePolished(self)
enterEvent(self, event: QEnterEvent)
event(self, event: QEvent) bool
eventFilter(self, a0: QObject, a1: QEvent) bool
find(a0: PyQt6.sip.voidptr) QWidget
findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
focusInEvent(self, a0: QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, next: bool) bool
focusOutEvent(self, a0: QFocusEvent)
focusPolicy(self) Qt.FocusPolicy
focusPreviousChild(self) bool
focusProxy(self) QWidget
focusWidget(self) QWidget
font(self) QFont
fontInfo(self) QFontInfo
fontMetrics(self) QFontMetrics
foregroundRole(self) QPalette.ColorRole
forward(*args)

Move forward in the view lim stack.

For convenience of being directly connected as a GUI callback, which often get passed additional parameters, this method accepts arbitrary parameters, but does not use them.

frameGeometry(self) QRect
frameSize(self) QSize
geometry(self) QRect
getSubplotDialog()

Return an instance of the widget to use inside the “Subplot Configuration Tool” dialog.

grab(self, rectangle: QRect = QRect(QPoint(0, 0), QSize(- 1, - 1))) QPixmap
grabGesture(self, type: Qt.GestureType, flags: Qt.GestureFlag = Qt.GestureFlags())
grabKeyboard(self)
grabMouse(self)
grabMouse(self, a0: Union[QCursor, Qt.CursorShape]) None
grabShortcut(self, key: Union[QKeySequence, QKeySequence.StandardKey, str, int], context: Qt.ShortcutContext = Qt.WindowShortcut) int
graphicsEffect(self) QGraphicsEffect
graphicsProxyWidget(self) QGraphicsProxyWidget
hasFocus(self) bool
hasHeightForWidth(self) bool
hasMouseTracking(self) bool
hasTabletTracking(self) bool
height(self) int
heightForWidth(self, a0: int) int
heightMM(self) int
hide(self)
hideEvent(self, a0: QHideEvent)
home(*args)

Restore the original view.

For convenience of being directly connected as a GUI callback, which often get passed additional parameters, this method accepts arbitrary parameters, but does not use them.

iconSize(self) QSize
iconSizeChanged

iconSizeChanged(self, iconSize: QSize) [signal]

inherits(self, classname: str) bool
initPainter(self, painter: QPainter)
initStyleOption(self, option: QStyleOptionToolBar)
inputMethodEvent(self, a0: QInputMethodEvent)
inputMethodHints(self) Qt.InputMethodHint
inputMethodQuery(self, a0: Qt.InputMethodQuery) Any
insertAction(self, before: QAction, action: QAction)
insertActions(self, before: QAction, actions: Iterable[QAction])
insertSeparator(self, before: QAction) QAction
insertWidget(self, before: QAction, widget: QWidget) QAction
installEventFilter(self, a0: QObject)
isActiveWindow(self) bool
isAncestorOf(self, child: QWidget) bool
isAreaAllowed(self, area: Qt.ToolBarArea) bool
isEnabled(self) bool
isEnabledTo(self, a0: QWidget) bool
isFloatable(self) bool
isFloating(self) bool
isFullScreen(self) bool
isHidden(self) bool
isLeftToRight(self) bool
isMaximized(self) bool
isMinimized(self) bool
isModal(self) bool
isMovable(self) bool
isRightToLeft(self) bool
isSignalConnected(self, signal: QMetaMethod) bool
isVisible(self) bool
isVisibleTo(self, a0: QWidget) bool
isWidgetType(self) bool
isWindow(self) bool
isWindowModified(self) bool
isWindowType(self) bool
keyPressEvent(self, a0: QKeyEvent)
keyReleaseEvent(self, a0: QKeyEvent)
keyboardGrabber() QWidget
killTimer(self, id: int)
layout(self) QLayout
layoutDirection(self) Qt.LayoutDirection
leaveEvent(self, a0: QEvent)
locale(self) QLocale
logicalDpiX(self) int
logicalDpiY(self) int
lower(self)
mapFrom(self, a0: QWidget, a1: QPoint) QPoint
mapFrom(self, a0: QWidget, a1: QPointF) QPointF
mapFromGlobal(self, a0: QPoint) QPoint
mapFromGlobal(self, a0: QPointF) QPointF
mapFromParent(self, a0: QPoint) QPoint
mapFromParent(self, a0: QPointF) QPointF
mapTo(self, a0: QWidget, a1: QPoint) QPoint
mapTo(self, a0: QWidget, a1: QPointF) QPointF
mapToGlobal(self, a0: QPoint) QPoint
mapToGlobal(self, a0: QPointF) QPointF
mapToParent(self, a0: QPoint) QPoint
mapToParent(self, a0: QPointF) QPointF
mask(self) QRegion
maximumHeight(self) int
maximumSize(self) QSize
maximumWidth(self) int
message
metaObject(self) QMetaObject
metric(self, a0: QPaintDevice.PaintDeviceMetric) int
minimumHeight(self) int
minimumSize(self) QSize
minimumSizeHint(self) QSize
minimumWidth(self) int
mouseDoubleClickEvent(self, a0: QMouseEvent)
mouseGrabber() QWidget
mouseMoveEvent(self, a0: QMouseEvent)
mousePressEvent(self, a0: QMouseEvent)
mouseReleaseEvent(self, a0: QMouseEvent)
mouse_move(event)
movableChanged

movableChanged(self, movable: bool) [signal]

move(self, a0: QPoint)
move(self, ax: int, ay: int) None
moveEvent(self, a0: QMoveEvent)
moveToThread(self, thread: QThread)
nativeEvent(self, eventType: QByteArray, message: PyQt6.sip.voidptr) Tuple[bool, PyQt6.sip.voidptr]
nativeParentWidget(self) QWidget
nextInFocusChain(self) QWidget
normalGeometry(self) QRect
objectName(self) str
objectNameChanged

objectNameChanged(self, objectName: str) [signal]

orientation(self) Qt.Orientation
orientationChanged

orientationChanged(self, orientation: Qt.Orientation) [signal]

overrideWindowFlags(self, type: Qt.WindowType)
overrideWindowState(self, state: Qt.WindowState)
paintEngine(self) QPaintEngine
paintEvent(self, event: QPaintEvent)
paintingActive(self) bool
palette(self) QPalette
pan(*args)

Toggle the pan/zoom tool.

Pan with left button, zoom with right.

parent(self) QObject
parentWidget(self) QWidget
physicalDpiX(self) int
physicalDpiY(self) int
pos(self) QPoint
press_pan(event)

Callback for mouse button press in pan/zoom mode.

press_zoom(event)

Callback for mouse button press in zoom to rect mode.

previousInFocusChain(self) QWidget
property(self, name: str) Any
push_current()

Push the current view limits and position onto the stack.

pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

raise_(self)
receivers(self, signal: PYQT_SIGNAL) int
rect(self) QRect
releaseKeyboard(self)
releaseMouse(self)
releaseShortcut(self, id: int)
release_pan(event)

Callback for mouse button release in pan/zoom mode.

release_zoom(event)

Callback for mouse button release in zoom to rect mode.

removeAction(self, action: QAction)
removeEventFilter(self, a0: QObject)
remove_rubberband()

Remove the rubberband.

render(self, target: QPaintDevice, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlag = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren))
render(self, painter: QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlag = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren)) None
repaint(self)
repaint(self, x: int, y: int, w: int, h: int) None
repaint(self, a0: QRect) None
repaint(self, a0: QRegion) None
resetPanZoom()

Reset any sticky buttons like pan or zoom

resize(self, a0: QSize)
resize(self, w: int, h: int) None
resizeEvent(self, a0: QResizeEvent)
restoreGeometry(self, geometry: QByteArray) bool
saveGeometry(self) QByteArray
save_figure(*args)

Save the current figure.

screen(self) QScreen
scroll(self, dx: int, dy: int)
scroll(self, dx: int, dy: int, a2: QRect) None
sender(self) QObject
senderSignalIndex(self) int
setAcceptDrops(self, on: bool)
setAccessibleDescription(self, description: str)
setAccessibleName(self, name: str)
setAllowedAreas(self, areas: Qt.ToolBarArea)
setAttribute(self, attribute: Qt.WidgetAttribute, on: bool = True)
setAutoFillBackground(self, enabled: bool)
setBackgroundRole(self, a0: QPalette.ColorRole)
setBaseSize(self, basew: int, baseh: int)
setBaseSize(self, s: QSize) None
setContentsMargins(self, left: int, top: int, right: int, bottom: int)
setContentsMargins(self, margins: QMargins) None
setContextMenuPolicy(self, policy: Qt.ContextMenuPolicy)
setCursor(self, a0: Union[QCursor, Qt.CursorShape])
setDisabled(self, a0: bool)
setEnabled(self, a0: bool)
setFixedHeight(self, h: int)
setFixedSize(self, a0: QSize)
setFixedSize(self, w: int, h: int) None
setFixedWidth(self, w: int)
setFloatable(self, floatable: bool)
setFocus(self)
setFocus(self, reason: Qt.FocusReason) None
setFocusPolicy(self, policy: Qt.FocusPolicy)
setFocusProxy(self, a0: QWidget)
setFont(self, a0: QFont)
setForegroundRole(self, a0: QPalette.ColorRole)
setGeometry(self, a0: QRect)
setGeometry(self, ax: int, ay: int, aw: int, ah: int) None
setGraphicsEffect(self, effect: QGraphicsEffect)
setHidden(self, hidden: bool)
setIconSize(self, iconSize: QSize)
setInputMethodHints(self, hints: Qt.InputMethodHint)
setLayout(self, a0: QLayout)
setLayoutDirection(self, direction: Qt.LayoutDirection)
setLocale(self, locale: QLocale)
setMask(self, a0: QBitmap)
setMask(self, a0: QRegion) None
setMaximumHeight(self, maxh: int)
setMaximumSize(self, maxw: int, maxh: int)
setMaximumSize(self, s: QSize) None
setMaximumWidth(self, maxw: int)
setMinimumHeight(self, minh: int)
setMinimumSize(self, minw: int, minh: int)
setMinimumSize(self, s: QSize) None
setMinimumWidth(self, minw: int)
setMouseTracking(self, enable: bool)
setMovable(self, movable: bool)
setObjectName(self, name: str)
setOrientation(self, orientation: Qt.Orientation)
setPalette(self, a0: QPalette)
setParent(self, parent: QWidget)
setParent(self, parent: QWidget, f: Qt.WindowType) None
setProperty(self, name: str, value: Any) bool
setScreen(self, a0: QScreen)
setShortcutAutoRepeat(self, id: int, enabled: bool = True)
setShortcutEnabled(self, id: int, enabled: bool = True)
setSizeIncrement(self, w: int, h: int)
setSizeIncrement(self, s: QSize) None
setSizePolicy(self, a0: QSizePolicy)
setSizePolicy(self, hor: QSizePolicy.Policy, ver: QSizePolicy.Policy) None
setStatusTip(self, a0: str)
setStyle(self, a0: QStyle)
setStyleSheet(self, styleSheet: str)
setTabOrder(a0: QWidget, a1: QWidget)
setTabletTracking(self, enable: bool)
setToolButtonStyle(self, toolButtonStyle: Qt.ToolButtonStyle)
setToolTip(self, a0: str)
setToolTipDuration(self, msec: int)
setUpdatesEnabled(self, enable: bool)
setVisible(self, visible: bool)
setWhatsThis(self, a0: str)
setWindowFilePath(self, filePath: str)
setWindowFlag(self, a0: Qt.WindowType, on: bool = True)
setWindowFlags(self, type: Qt.WindowType)
setWindowIcon(self, icon: QIcon)
setWindowIconText(self, a0: str)
setWindowModality(self, windowModality: Qt.WindowModality)
setWindowModified(self, a0: bool)
setWindowOpacity(self, level: float)
setWindowRole(self, a0: str)
setWindowState(self, state: Qt.WindowState)
setWindowTitle(self, a0: str)
set_cursor(cursor)

[Deprecated] Set the current cursor to one of the Cursors enums values.

If required by the backend, this method should trigger an update in the backend event loop after the cursor is set, as this method may be called e.g. before a long-running task during which the GUI is not updated.

Deprecated since version 3.5: Use FigureCanvasBase.set_cursor instead.

set_history_buttons()

Enable or disable the back/forward button.

set_message(message)

Sets the message in the toolbar, only puts a return in it if it would require the toolbar to expand horizontally to contain it.

sharedPainter(self) QPainter
show(self)
showAdjustWindow()

Open the subplot configuration dialog, in a non-modal way; so that the user can interact with the main plot window while it is open. Only one instance of the dialog is allowed by this code.

showEvent(self, a0: QShowEvent)
showFullScreen(self)
showMaximized(self)
showMinimized(self)
showNormal(self)
signalsBlocked(self) bool
size(self) QSize
sizeHint()

Make sure that the message label is included in the sizehint calculation for height

sizeIncrement(self) QSize
sizePolicy(self) QSizePolicy
stackUnder(self, a0: QWidget)
startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int
staticMetaObject = <PyQt6.QtCore.QMetaObject object>
statusTip(self) str
style(self) QStyle
styleSheet(self) str
tabletEvent(self, a0: QTabletEvent)
testAttribute(self, attribute: Qt.WidgetAttribute) bool
thread(self) QThread
timerEvent(self, a0: QTimerEvent)
toggleViewAction(self) QAction
toolButtonStyle(self) Qt.ToolButtonStyle
toolButtonStyleChanged

toolButtonStyleChanged(self, toolButtonStyle: Qt.ToolButtonStyle) [signal]

toolTip(self) str
toolTipDuration(self) int
toolitems = [('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous view', 'back', 'back'), ('Forward', 'Forward to next view', 'forward', 'forward'), (None, None, None, None), ('Pan', 'Left button pans, Right button zooms\nx/y fixes axis, CTRL fixes aspect', 'move', 'pan'), ('Zoom', 'Zoom to rectangle\nx/y fixes axis', 'zoom_to_rect', 'zoom'), ('Subplots', 'Configure subplots', 'subplots', 'configure_subplots'), ('Customize', 'Edit axis, curve and image parameters', 'qt4_editor_options', 'edit_parameters'), (None, None, None, None), ('Save', 'Save the figure', 'filesave', 'save_figure')]
topLevelChanged

topLevelChanged(self, topLevel: bool) [signal]

tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str
underMouse(self) bool
ungrabGesture(self, type: Qt.GestureType)
unsetCursor(self)
unsetLayoutDirection(self)
unsetLocale(self)
update()

Reset the axes stack.

updateGeometry(self)
updateMicroFocus(self, query: Qt.InputMethodQuery = Qt.ImQueryAll)
updatesEnabled(self) bool
visibilityChanged

visibilityChanged(self, visible: bool) [signal]

visibleRegion(self) QRegion
whatsThis(self) str
wheelEvent(self, a0: QWheelEvent)
widgetForAction(self, action: QAction) QWidget
width(self) int
widthMM(self) int
winId(self) PyQt6.sip.voidptr
window(self) QWidget
windowFilePath(self) str
windowFlags(self) Qt.WindowType
windowHandle(self) QWindow
windowIcon(self) QIcon
windowIconChanged

windowIconChanged(self, icon: QIcon) [signal]

windowIconText(self) str
windowIconTextChanged

windowIconTextChanged(self, iconText: str) [signal]

windowModality(self) Qt.WindowModality
windowOpacity(self) float
windowRole(self) str
windowState(self) Qt.WindowState
windowTitle(self) str
windowTitleChanged

windowTitleChanged(self, title: str) [signal]

windowType(self) Qt.WindowType
x(self) int
y(self) int
zoom(*args)

Toggle zoom to rect mode.

class schrodinger.ui.qt.smatplotlib.SmatplotlibCanvas(width=5, height=4, dpi=100, toolbar=True, layout=None, expanding=True, toolbar_class=None, **kwargs)

Bases: matplotlib.backends.backend_qtagg.FigureCanvasQTAgg

Custom subclass of FigureCanvasQTAgg that does the following:
  • Allows for simultaneous definition of the Canvas, Figure and toolbar

    objects, and placing them in a layout

  • Fixes known bugs with the mouse events detecting modifier keys

TOOLBAR_CLASS

alias of schrodinger.ui.qt.navtoolbar.NavToolbar

__init__(width=5, height=4, dpi=100, toolbar=True, layout=None, expanding=True, toolbar_class=None, **kwargs)
Parameters
  • width (number) – width of the plot Figure in inches

  • height (number) – height of the plot Figure in inches

  • dpi (int) – resolution of the plot

  • toolbar (boolean) – True if the toolbar should be created, but the parent parameter must be supplied in this case

  • layout (QLayout object) – If layout is supplied, the toolbar and canvas will be placed in it.

  • toolbar_class (class) – If provided, the class to use for the toolbar

Extra keyword arguments are passed to the toolbar function

eventFilter(obj, event)

The canvas needs to grab keyboard input in order to reliably tell when a modifier key (shift or control) is down when a mouse button is pressed/released.

Some environments have trouble with passing the control key in events - a control-left-click is often mapped to a right-click. Therefore we do our best to capture on our own when the control key is down. Note that even this breaks for multiple control-clicks on Linux running under VMWare Fusion on Macs, because VMWare by default “lifts” the control key after the first click.

Parameters
  • obj (not used) – not used

  • event (QEvent) – the event object

mousePressEvent(event)

Add in the control modifier key to the button_press_event

Parameters

event (QMouseEvent) – the QMouseEvent that triggered this handler

self._key is matplotlib’s way of storing the modifier keys

mouseReleaseEvent(event)

Add in the control modifier key to the button_release_event

Parameters

event (QMouseEvent) – the QMouseEvent that triggered this handler

self._key is matplotlib’s way of storing the modifier keys

drawAndUpdate(tight_layout=True)

Update canvas and toolbar after plotting.

Parameters

tight_layout (bool) – Whether to apply tight layout after plotting

DrawChildren = 2
DrawWindowBackground = 1
IgnoreMask = 4
class PaintDeviceMetric(value)

Bases: enum.Enum

An enumeration.

PdmWidth = 1
PdmHeight = 2
PdmWidthMM = 3
PdmHeightMM = 4
PdmNumColors = 5
PdmDepth = 6
PdmDpiX = 7
PdmDpiY = 8
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
PdmDepth = 6
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
PdmDpiX = 7
PdmDpiY = 8
PdmHeight = 2
PdmHeightMM = 4
PdmNumColors = 5
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmWidth = 1
PdmWidthMM = 3
class RenderFlag(value)

Bases: enum.Flag

An enumeration.

DrawWindowBackground = 1
DrawChildren = 2
IgnoreMask = 4
acceptDrops(self) bool
accessibleDescription(self) str
accessibleName(self) str
actionEvent(self, a0: QActionEvent)
actions(self) List[QAction]
activateWindow(self)
addAction(self, action: QAction)
addActions(self, actions: Iterable[QAction])
adjustSize(self)
autoFillBackground(self) bool
backgroundRole(self) QPalette.ColorRole
baseSize(self) QSize
blit(bbox=None)

Blit the canvas in bbox (default entire canvas).

blockSignals(self, b: bool) bool
buffer_rgba()

Get the image as a memoryview to the renderer’s buffer.

draw must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.

property button_pick_id
button_press_event(x, y, button, dblclick=False, guiEvent=None)

Callback processing for mouse button press events.

Backend derived classes should call this function on any mouse button press. (x, y) are the canvas coords ((0, 0) is lower left). button and key are as defined in MouseEvent.

This method will call all functions connected to the ‘button_press_event’ with a MouseEvent instance.

button_release_event(x, y, button, guiEvent=None)

Callback processing for mouse button release events.

Backend derived classes should call this function on any mouse button release.

This method will call all functions connected to the ‘button_release_event’ with a MouseEvent instance.

xfloat

The canvas coordinates where 0=left.

yfloat

The canvas coordinates where 0=bottom.

guiEvent

The native UI event that generated the Matplotlib event.

buttond = {<MouseButton.LeftButton: 1>: <MouseButton.LEFT: 1>, <MouseButton.RightButton: 2>: <MouseButton.RIGHT: 3>, <MouseButton.MiddleButton: 4>: <MouseButton.MIDDLE: 2>, <MouseButton.XButton1: 8>: <MouseButton.BACK: 8>, <MouseButton.XButton2: 16>: <MouseButton.FORWARD: 9>}
property callbacks
changeEvent(self, a0: QEvent)
childAt(self, p: QPoint) QWidget
childAt(self, ax: int, ay: int) QWidget
childEvent(self, a0: QChildEvent)
children(self) List[QObject]
childrenRect(self) QRect
childrenRegion(self) QRegion
clearFocus(self)
clearMask(self)
close(self) bool
closeEvent(self, a0: QCloseEvent)
close_event(guiEvent=None)

Pass a CloseEvent to all functions connected to close_event.

colorCount(self) int
connectNotify(self, signal: QMetaMethod)
contentsMargins(self) QMargins
contentsRect(self) QRect
contextMenuEvent(self, a0: QContextMenuEvent)
contextMenuPolicy(self) Qt.ContextMenuPolicy
copy_from_bbox(bbox)
create(self, window: PyQt6.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
createWindowContainer(window: QWindow, parent: typing.Optional[QWidget] = None, flags: Qt.WindowType = Qt.WindowFlags()) QWidget
cursor(self) QCursor
customContextMenuRequested

customContextMenuRequested(self, pos: QPoint) [signal]

customEvent(self, a0: QEvent)
deleteLater(self)
depth(self) int
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
destroyed

destroyed(self, object: typing.Optional[QObject] = None) [signal]

devType(self) int
devicePixelRatio(self) float
devicePixelRatioF(self) float
devicePixelRatioFScale() float
property device_pixel_ratio

The ratio of physical to logical pixels used for the canvas on screen.

By default, this is 1, meaning physical and logical pixels are the same size. Subclasses that support High DPI screens may set this property to indicate that said ratio is different. All Matplotlib interaction, unless working directly with the canvas, remains in logical pixels.

disconnect(a0: QMetaObject.Connection) bool
disconnect(self) None
disconnectNotify(self, signal: QMetaMethod)
dragEnterEvent(self, a0: QDragEnterEvent)
dragLeaveEvent(self, a0: QDragLeaveEvent)
dragMoveEvent(self, a0: QDragMoveEvent)
draw()

Render the figure, and queue a request for a Qt draw.

drawRectangle(rect)
draw_event(renderer)

Pass a DrawEvent to all functions connected to draw_event.

draw_idle()

Queue redraw of the Agg buffer and request Qt paintEvent.

dropEvent(self, a0: QDropEvent)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) List[QByteArray]
effectiveWinId(self) PyQt6.sip.voidptr
ensurePolished(self)
enterEvent(self, event: QEnterEvent)
enter_notify_event(guiEvent=None, xy=None)

Callback processing for the mouse cursor entering the canvas.

Backend derived classes should call this function when entering canvas.

guiEvent

The native UI event that generated the Matplotlib event.

xy(float, float)

The coordinate location of the pointer when the canvas is entered.

event(self, a0: QEvent) bool
events = ['resize_event', 'draw_event', 'key_press_event', 'key_release_event', 'button_press_event', 'button_release_event', 'scroll_event', 'motion_notify_event', 'pick_event', 'figure_enter_event', 'figure_leave_event', 'axes_enter_event', 'axes_leave_event', 'close_event']
filetypes = {'eps': 'Encapsulated Postscript', 'jpeg': 'Joint Photographic Experts Group', 'jpg': 'Joint Photographic Experts Group', 'pdf': 'Portable Document Format', 'png': 'Portable Network Graphics', 'ps': 'Postscript', 'raw': 'Raw RGBA bitmap', 'rgba': 'Raw RGBA bitmap', 'svg': 'Scalable Vector Graphics', 'svgz': 'Scalable Vector Graphics', 'tif': 'Tagged Image File Format', 'tiff': 'Tagged Image File Format'}
find(a0: PyQt6.sip.voidptr) QWidget
findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
fixed_dpi = None
flush_events()

Flush the GUI events for the figure.

Interactive backends need to reimplement this method.

focusInEvent(self, a0: QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, next: bool) bool
focusOutEvent(self, a0: QFocusEvent)
focusPolicy(self) Qt.FocusPolicy
focusPreviousChild(self) bool
focusProxy(self) QWidget
focusWidget(self) QWidget
font(self) QFont
fontInfo(self) QFontInfo
fontMetrics(self) QFontMetrics
foregroundRole(self) QPalette.ColorRole
frameGeometry(self) QRect
frameSize(self) QSize
geometry(self) QRect
get_default_filename()

Return a string, which includes extension, suitable for use as a default filename.

classmethod get_default_filetype()

Return the default savefig file format as specified in :rc:`savefig.format`.

The returned string does not include a period. This method is overridden in backends that only support a single file type.

get_renderer(cleared=False)
classmethod get_supported_filetypes()

Return dict of savefig file formats supported by this backend.

classmethod get_supported_filetypes_grouped()

Return a dict of savefig file formats supported by this backend, where the keys are a file type name, such as ‘Joint Photographic Experts Group’, and the values are a list of filename extensions used for that filetype, such as [‘jpg’, ‘jpeg’].

get_width_height(*, physical=False)

Return the figure width and height in integral points or pixels.

When the figure is used on High DPI screens (and the backend supports it), the truncation to integers occurs after scaling by the device pixel ratio.

physicalbool, default: False

Whether to return true physical pixels or logical pixels. Physical pixels may be used by backends that support HiDPI, but still configure the canvas using its actual size.

width, heightint

The size of the figure, in points or pixels, depending on the backend.

get_window_title()

[Deprecated] Return the title text of the window containing the figure, or None if there is no window (e.g., a PS backend).

Deprecated since version 3.4: Use FigureManagerBase.get_window_title or GUI-specific methods instead.

grab(self, rectangle: QRect = QRect(QPoint(0, 0), QSize(- 1, - 1))) QPixmap
grabGesture(self, type: Qt.GestureType, flags: Qt.GestureFlag = Qt.GestureFlags())
grabKeyboard(self)
grabMouse(self)
grabMouse(self, a0: Union[QCursor, Qt.CursorShape]) None
grabShortcut(self, key: Union[QKeySequence, QKeySequence.StandardKey, str, int], context: Qt.ShortcutContext = Qt.WindowShortcut) int
grab_mouse(ax)

Set the child Axes which is grabbing the mouse events.

Usually called by the widgets themselves. It is an error to call this if the mouse is already grabbed by another axes.

graphicsEffect(self) QGraphicsEffect
graphicsProxyWidget(self) QGraphicsProxyWidget
hasFocus(self) bool
hasHeightForWidth(self) bool
hasMouseTracking(self) bool
hasTabletTracking(self) bool
height(self) int
heightForWidth(self, a0: int) int
heightMM(self) int
hide(self)
hideEvent(self, a0: QHideEvent)
inaxes(xy)

Return the topmost visible Axes containing the point xy.

xy(float, float)

(x, y) pixel positions from left/bottom of the canvas.

Axes or None

The topmost visible axes containing the point, or None if no axes.

inherits(self, classname: str) bool
initPainter(self, painter: QPainter)
inputMethodEvent(self, a0: QInputMethodEvent)
inputMethodHints(self) Qt.InputMethodHint
inputMethodQuery(self, a0: Qt.InputMethodQuery) Any
insertAction(self, before: QAction, action: QAction)
insertActions(self, before: QAction, actions: Iterable[QAction])
installEventFilter(self, a0: QObject)
isActiveWindow(self) bool
isAncestorOf(self, child: QWidget) bool
isEnabled(self) bool
isEnabledTo(self, a0: QWidget) bool
isFullScreen(self) bool
isHidden(self) bool
isLeftToRight(self) bool
isMaximized(self) bool
isMinimized(self) bool
isModal(self) bool
isRightToLeft(self) bool
isSignalConnected(self, signal: QMetaMethod) bool
isVisible(self) bool
isVisibleTo(self, a0: QWidget) bool
isWidgetType(self) bool
isWindow(self) bool
isWindowModified(self) bool
isWindowType(self) bool
is_saving()

Return whether the renderer is in the process of saving to a file, rather than rendering for an on-screen buffer.

keyPressEvent(self, a0: QKeyEvent)
keyReleaseEvent(self, a0: QKeyEvent)
key_press_event(key, guiEvent=None)

Pass a KeyEvent to all functions connected to key_press_event.

key_release_event(key, guiEvent=None)

Pass a KeyEvent to all functions connected to key_release_event.

keyboardGrabber() QWidget
killTimer(self, id: int)
layout(self) QLayout
layoutDirection(self) Qt.LayoutDirection
leaveEvent(self, a0: QEvent)
leave_notify_event(guiEvent=None)

Callback processing for the mouse cursor leaving the canvas.

Backend derived classes should call this function when leaving canvas.

guiEvent

The native UI event that generated the Matplotlib event.

locale(self) QLocale
logicalDpiX(self) int
logicalDpiY(self) int
lower(self)
mapFrom(self, a0: QWidget, a1: QPoint) QPoint
mapFrom(self, a0: QWidget, a1: QPointF) QPointF
mapFromGlobal(self, a0: QPoint) QPoint
mapFromGlobal(self, a0: QPointF) QPointF
mapFromParent(self, a0: QPoint) QPoint
mapFromParent(self, a0: QPointF) QPointF
mapTo(self, a0: QWidget, a1: QPoint) QPoint
mapTo(self, a0: QWidget, a1: QPointF) QPointF
mapToGlobal(self, a0: QPoint) QPoint
mapToGlobal(self, a0: QPointF) QPointF
mapToParent(self, a0: QPoint) QPoint
mapToParent(self, a0: QPointF) QPointF
mask(self) QRegion
maximumHeight(self) int
maximumSize(self) QSize
maximumWidth(self) int
metaObject(self) QMetaObject
metric(self, a0: QPaintDevice.PaintDeviceMetric) int
minimumHeight(self) int
minimumSize(self) QSize
minimumSizeHint(self) QSize
minimumWidth(self) int
minumumSizeHint()
motion_notify_event(x, y, guiEvent=None)

Callback processing for mouse movement events.

Backend derived classes should call this function on any motion-notify-event.

This method will call all functions connected to the ‘motion_notify_event’ with a MouseEvent instance.

xfloat

The canvas coordinates where 0=left.

yfloat

The canvas coordinates where 0=bottom.

guiEvent

The native UI event that generated the Matplotlib event.

mouseDoubleClickEvent(self, a0: QMouseEvent)
mouseEventCoords(pos)

Calculate mouse coordinates in physical pixels.

Qt uses logical pixels, but the figure is scaled to physical pixels for rendering. Transform to physical pixels so that all of the down-stream transforms work as expected.

Also, the origin is different and needs to be corrected.

mouseGrabber() QWidget
mouseMoveEvent(self, a0: QMouseEvent)
move(self, a0: QPoint)
move(self, ax: int, ay: int) None
moveEvent(self, a0: QMoveEvent)
moveToThread(self, thread: QThread)
mpl_connect(s, func)

Bind function func to event s.

sstr

One of the following events ids:

  • ‘button_press_event’

  • ‘button_release_event’

  • ‘draw_event’

  • ‘key_press_event’

  • ‘key_release_event’

  • ‘motion_notify_event’

  • ‘pick_event’

  • ‘resize_event’

  • ‘scroll_event’

  • ‘figure_enter_event’,

  • ‘figure_leave_event’,

  • ‘axes_enter_event’,

  • ‘axes_leave_event’

  • ‘close_event’.

funccallable

The callback function to be executed, which must have the signature:

def func(event: Event) -> Any

For the location events (button and key press/release), if the mouse is over the axes, the inaxes attribute of the event will be set to the Axes the event occurs is over, and additionally, the variables xdata and ydata attributes will be set to the mouse location in data coordinates. See KeyEvent and MouseEvent for more info.

cid

A connection id that can be used with FigureCanvasBase.mpl_disconnect.

def on_press(event):
    print('you pressed', event.button, event.xdata, event.ydata)

cid = canvas.mpl_connect('button_press_event', on_press)
mpl_disconnect(cid)

Disconnect the callback with id cid.

cid = canvas.mpl_connect('button_press_event', on_press)
# ... later
canvas.mpl_disconnect(cid)
nativeEvent(self, eventType: QByteArray, message: PyQt6.sip.voidptr) Tuple[bool, PyQt6.sip.voidptr]
nativeParentWidget(self) QWidget
new_timer(interval=None, callbacks=None)

Create a new backend-specific subclass of Timer.

This is useful for getting periodic events through the backend’s native event loop. Implemented only for backends with GUIs.

intervalint

Timer interval in milliseconds.

callbackslist[tuple[callable, tuple, dict]]

Sequence of (func, args, kwargs) where func(*args, **kwargs) will be executed by the timer every interval.

Callbacks which return False or 0 will be removed from the timer.

>>> timer = fig.canvas.new_timer(callbacks=[(f1, (1,), {'a': 3})])
nextInFocusChain(self) QWidget
normalGeometry(self) QRect
objectName(self) str
objectNameChanged

objectNameChanged(self, objectName: str) [signal]

overrideWindowFlags(self, type: Qt.WindowType)
overrideWindowState(self, state: Qt.WindowState)
paintEngine(self) QPaintEngine
paintEvent(event)

Copy the image from the Agg canvas to the qt.drawable.

In Qt, all drawing should be done inside of here when a widget is shown onscreen.

paintingActive(self) bool
palette(self) QPalette
parent(self) QObject
parentWidget(self) QWidget
physicalDpiX(self) int
physicalDpiY(self) int
pick(mouseevent)
pick_event(mouseevent, artist, **kwargs)

Callback processing for pick events.

This method will be called by artists who are picked and will fire off PickEvent callbacks registered listeners.

Note that artists are not pickable by default (see Artist.set_picker).

pos(self) QPoint
previousInFocusChain(self) QWidget
print_figure(*args, **kwargs)

Render the figure to hardcopy. Set the figure patch face and edge colors. This is useful because some of the GUIs have a gray figure face color background and you’ll probably want to override this on hardcopy.

filenamestr or path-like or file-like

The file where the figure is saved.

dpifloat, default: :rc:`savefig.dpi`

The dots per inch to save the figure in.

facecolorcolor or ‘auto’, default: :rc:`savefig.facecolor`

The facecolor of the figure. If ‘auto’, use the current figure facecolor.

edgecolorcolor or ‘auto’, default: :rc:`savefig.edgecolor`

The edgecolor of the figure. If ‘auto’, use the current figure edgecolor.

orientation{‘landscape’, ‘portrait’}, default: ‘portrait’

Only currently applies to PostScript printing.

formatstr, optional

Force a specific file format. If not given, the format is inferred from the filename extension, and if that fails from :rc:`savefig.format`.

bbox_inches‘tight’ or Bbox, default: :rc:`savefig.bbox`

Bounding box in inches: only the given portion of the figure is saved. If ‘tight’, try to figure out the tight bbox of the figure.

pad_inchesfloat, default: :rc:`savefig.pad_inches`

Amount of padding around the figure when bbox_inches is ‘tight’.

bbox_extra_artistslist of Artist, optional

A list of extra artists that will be considered when the tight bbox is calculated.

backendstr, optional

Use a non-default backend to render the file, e.g. to render a png file with the “cairo” backend rather than the default “agg”, or a pdf file with the “pgf” backend rather than the default “pdf”. Note that the default backend is normally sufficient. See the-builtin-backends for a list of valid backends for each file format. Custom backends can be referenced as “module://…”.

print_jpeg(filename_or_obj, *args, pil_kwargs=None, **kwargs)

Write the figure to a JPEG file.

filename_or_objstr or path-like or file-like

The file to write to.

pil_kwargsdict, optional

Additional keyword arguments that are passed to PIL.Image.Image.save when saving the figure.

print_jpg(filename_or_obj, *args, pil_kwargs=None, **kwargs)

Write the figure to a JPEG file.

filename_or_objstr or path-like or file-like

The file to write to.

pil_kwargsdict, optional

Additional keyword arguments that are passed to PIL.Image.Image.save when saving the figure.

print_png(filename_or_obj, *args, metadata=None, pil_kwargs=None)

Write the figure to a PNG file.

filename_or_objstr or path-like or file-like

The file to write to.

metadatadict, optional

Metadata in the PNG file as key-value pairs of bytes or latin-1 encodable strings. According to the PNG specification, keys must be shorter than 79 chars.

The PNG specification defines some common keywords that may be used as appropriate:

  • Title: Short (one line) title or caption for image.

  • Author: Name of image’s creator.

  • Description: Description of image (possibly long).

  • Copyright: Copyright notice.

  • Creation Time: Time of original image creation (usually RFC 1123 format).

  • Software: Software used to create the image.

  • Disclaimer: Legal disclaimer.

  • Warning: Warning of nature of content.

  • Source: Device used to create the image.

  • Comment: Miscellaneous comment; conversion from other image format.

Other keywords may be invented for other purposes.

If ‘Software’ is not given, an autogenerated value for Matplotlib will be used. This can be removed by setting it to None.

For more details see the PNG specification.

pil_kwargsdict, optional

Keyword arguments passed to PIL.Image.Image.save.

If the ‘pnginfo’ key is present, it completely overrides metadata, including the default ‘Software’ key.

print_raw(filename_or_obj, *args)
print_rgba(filename_or_obj, *args)
print_tif(filename_or_obj, *, pil_kwargs=None)
print_tiff(filename_or_obj, *, pil_kwargs=None)
print_to_buffer()
property(self, name: str) Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

raise_(self)
receivers(self, signal: PYQT_SIGNAL) int
rect(self) QRect
releaseKeyboard(self)
releaseMouse(self)
releaseShortcut(self, id: int)
release_mouse(ax)

Release the mouse grab held by the Axes ax.

Usually called by the widgets. It is ok to call this even if ax doesn’t have the mouse grab currently.

removeAction(self, action: QAction)
removeEventFilter(self, a0: QObject)
render(self, target: QPaintDevice, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlag = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren))
render(self, painter: QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlag = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren)) None
repaint(self)
repaint(self, x: int, y: int, w: int, h: int) None
repaint(self, a0: QRect) None
repaint(self, a0: QRegion) None
required_interactive_framework = 'qt'
resize(self, a0: QSize)
resize(self, w: int, h: int) None
resizeEvent(self, a0: QResizeEvent)
resize_event()

Pass a ResizeEvent to all functions connected to resize_event.

restoreGeometry(self, geometry: QByteArray) bool
restore_region(region, bbox=None, xy=None)
saveGeometry(self) QByteArray
screen(self) QScreen
scroll(self, dx: int, dy: int)
scroll(self, dx: int, dy: int, a2: QRect) None
scroll_event(x, y, step, guiEvent=None)

Callback processing for scroll events.

Backend derived classes should call this function on any scroll wheel event. (x, y) are the canvas coords ((0, 0) is lower left). button and key are as defined in MouseEvent.

This method will call all functions connected to the ‘scroll_event’ with a MouseEvent instance.

property scroll_pick_id
sender(self) QObject
senderSignalIndex(self) int
setAcceptDrops(self, on: bool)
setAccessibleDescription(self, description: str)
setAccessibleName(self, name: str)
setAttribute(self, attribute: Qt.WidgetAttribute, on: bool = True)
setAutoFillBackground(self, enabled: bool)
setBackgroundRole(self, a0: QPalette.ColorRole)
setBaseSize(self, basew: int, baseh: int)
setBaseSize(self, s: QSize) None
setContentsMargins(self, left: int, top: int, right: int, bottom: int)
setContentsMargins(self, margins: QMargins) None
setContextMenuPolicy(self, policy: Qt.ContextMenuPolicy)
setCursor(self, a0: Union[QCursor, Qt.CursorShape])
setDisabled(self, a0: bool)
setEnabled(self, a0: bool)
setFixedHeight(self, h: int)
setFixedSize(self, a0: QSize)
setFixedSize(self, w: int, h: int) None
setFixedWidth(self, w: int)
setFocus(self)
setFocus(self, reason: Qt.FocusReason) None
setFocusPolicy(self, policy: Qt.FocusPolicy)
setFocusProxy(self, a0: QWidget)
setFont(self, a0: QFont)
setForegroundRole(self, a0: QPalette.ColorRole)
setGeometry(self, a0: QRect)
setGeometry(self, ax: int, ay: int, aw: int, ah: int) None
setGraphicsEffect(self, effect: QGraphicsEffect)
setHidden(self, hidden: bool)
setInputMethodHints(self, hints: Qt.InputMethodHint)
setLayout(self, a0: QLayout)
setLayoutDirection(self, direction: Qt.LayoutDirection)
setLocale(self, locale: QLocale)
setMask(self, a0: QBitmap)
setMask(self, a0: QRegion) None
setMaximumHeight(self, maxh: int)
setMaximumSize(self, maxw: int, maxh: int)
setMaximumSize(self, s: QSize) None
setMaximumWidth(self, maxw: int)
setMinimumHeight(self, minh: int)
setMinimumSize(self, minw: int, minh: int)
setMinimumSize(self, s: QSize) None
setMinimumWidth(self, minw: int)
setMouseTracking(self, enable: bool)
setObjectName(self, name: str)
setPalette(self, a0: QPalette)
setParent(self, parent: QWidget)
setParent(self, parent: QWidget, f: Qt.WindowType) None
setProperty(self, name: str, value: Any) bool
setScreen(self, a0: QScreen)
setShortcutAutoRepeat(self, id: int, enabled: bool = True)
setShortcutEnabled(self, id: int, enabled: bool = True)
setSizeIncrement(self, w: int, h: int)
setSizeIncrement(self, s: QSize) None
setSizePolicy(self, a0: QSizePolicy)
setSizePolicy(self, hor: QSizePolicy.Policy, ver: QSizePolicy.Policy) None
setStatusTip(self, a0: str)
setStyle(self, a0: QStyle)
setStyleSheet(self, styleSheet: str)
setTabOrder(a0: QWidget, a1: QWidget)
setTabletTracking(self, enable: bool)
setToolTip(self, a0: str)
setToolTipDuration(self, msec: int)
setUpdatesEnabled(self, enable: bool)
setVisible(self, visible: bool)
setWhatsThis(self, a0: str)
setWindowFilePath(self, filePath: str)
setWindowFlag(self, a0: Qt.WindowType, on: bool = True)
setWindowFlags(self, type: Qt.WindowType)
setWindowIcon(self, icon: QIcon)
setWindowIconText(self, a0: str)
setWindowModality(self, windowModality: Qt.WindowModality)
setWindowModified(self, a0: bool)
setWindowOpacity(self, level: float)
setWindowRole(self, a0: str)
setWindowState(self, state: Qt.WindowState)
setWindowTitle(self, a0: str)
set_cursor(cursor)

Set the current cursor.

This may have no effect if the backend does not display anything.

If required by the backend, this method should trigger an update in the backend event loop after the cursor is set, as this method may be called e.g. before a long-running task during which the GUI is not updated.

cursorCursors

The cursor to display over the canvas. Note: some backends may change the cursor for the entire window.

set_window_title(title)

[Deprecated] Set the title text of the window containing the figure. Note that this has no effect if there is no window (e.g., a PS backend).

Deprecated since version 3.4: Use FigureManagerBase.set_window_title or GUI-specific methods instead.

sharedPainter(self) QPainter
show(self)
showEvent(self, a0: QShowEvent)
showFullScreen(self)
showMaximized(self)
showMinimized(self)
showNormal(self)
signalsBlocked(self) bool
size(self) QSize
sizeHint(self) QSize
sizeIncrement(self) QSize
sizePolicy(self) QSizePolicy
stackUnder(self, a0: QWidget)
startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int
start_event_loop(timeout=0)

Start a blocking event loop.

Such an event loop is used by interactive functions, such as ginput and waitforbuttonpress, to wait for events.

The event loop blocks until a callback function triggers stop_event_loop, or timeout is reached.

If timeout is 0 or negative, never timeout.

Only interactive backends need to reimplement this method and it relies on flush_events being properly implemented.

Interactive backends should implement this in a more native way.

staticMetaObject = <PyQt6.QtCore.QMetaObject object>
statusTip(self) str
stop_event_loop(event=None)

Stop the current blocking event loop.

Interactive backends need to reimplement this to match start_event_loop

style(self) QStyle
styleSheet(self) str
supports_blit = True
switch_backends(FigureCanvasClass)

Instantiate an instance of FigureCanvasClass

This is used for backend switching, e.g., to instantiate a FigureCanvasPS from a FigureCanvasGTK. Note, deep copying is not done, so any changes to one of the instances (e.g., setting figure size or line props), will be reflected in the other

tabletEvent(self, a0: QTabletEvent)
testAttribute(self, attribute: Qt.WidgetAttribute) bool
thread(self) QThread
timerEvent(self, a0: QTimerEvent)
toolTip(self) str
toolTipDuration(self) int
tostring_argb()

Get the image as ARGB bytes.

draw must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.

tostring_rgb()

Get the image as RGB bytes.

draw must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.

tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str
underMouse(self) bool
ungrabGesture(self, type: Qt.GestureType)
unsetCursor(self)
unsetLayoutDirection(self)
unsetLocale(self)
update(self)
update(self, a0: QRect) None
update(self, a0: QRegion) None
update(self, ax: int, ay: int, aw: int, ah: int) None
updateGeometry(self)
updateMicroFocus(self, query: Qt.InputMethodQuery = Qt.ImQueryAll)
updatesEnabled(self) bool
visibleRegion(self) QRegion
whatsThis(self) str
wheelEvent(self, a0: QWheelEvent)
width(self) int
widthMM(self) int
winId(self) PyQt6.sip.voidptr
window(self) QWidget
windowFilePath(self) str
windowFlags(self) Qt.WindowType
windowHandle(self) QWindow
windowIcon(self) QIcon
windowIconChanged

windowIconChanged(self, icon: QIcon) [signal]

windowIconText(self) str
windowIconTextChanged

windowIconTextChanged(self, iconText: str) [signal]

windowModality(self) Qt.WindowModality
windowOpacity(self) float
windowRole(self) str
windowState(self) Qt.WindowState
windowTitle(self) str
windowTitleChanged

windowTitleChanged(self, title: str) [signal]

windowType(self) Qt.WindowType
x(self) int
y(self) int
schrodinger.ui.qt.smatplotlib.autoset_axis_range(axes, yaxis=True, minimum_span=0.01)

Set the axis range based on the min and max values of the plotted data.

Parameters
  • axes (matplotlib.axes.Axes) – The plot that its axis range will be set.

  • yaxis (bool) – If True, the y-axis range will be set. If False, the x-axis range will be set.

  • minimum_span (float) – Minimum span between axis min and max

schrodinger.ui.qt.smatplotlib.add_axis_margins(min_val: float, max_val: float, margin_frac: float = 0.05) Tuple[float]

Return a new range with an added margin to both the min and max values. Mainly for aesthetic benefit.

Min_val

The current minimum value.

Max_val

The current maximum value. Assumed to be > min_val

Margin_frac

The fraction of the value range that we want to add as margin to each side.

schrodinger.ui.qt.smatplotlib.get_annotation_position(text_obj: matplotlib.text.Text, ax: matplotlib.axes._axes.Axes, x_cursor: int, y_cursor: int) Tuple[float, float]

Return the new position at which text_obj should be placed relative to the annotation origin, which is the top left corner by default. The main philosophy here is to always keep the annotation within the bounds of the axes. This is because the annotation will get clipped if it extends beyond the edge of the parent view. This may not always happen, but it’s very possible when annotation is large and there is little padding between the plot and the edge of the parent panel.

Rules: 1. The annotation should be placed below the mouse and to the right when possible to mimic normal tooltip behavior. 2. If drawing the annotation below the cursor would cause it to extend below the axes, it should instead be placed above the cursor. 3. If drawing the annotation to the right of the cursor would cause it to extend off the axes to the right, it should instead be placed to the left of the cursor.

Parameters
  • text_obj – The annotation to be moved.

  • ax – The axes in which the annotation is being placed.

  • x_cursor – The x-coordinate of the cursor.

  • y_cursor – The y-coordinate of the cursor.