pymor.gui package¶
Submodules¶
gl module¶
This module provides a widget for displaying patch plots of
scalar data assigned to 2D-grids using OpenGL. This widget is not
intended to be used directly. Instead, use
visualize_patch or
PatchVisualizer.
-
class
pymor.gui.gl.ColorBarWidget(parent, U=None, vmin=None, vmax=None)[source]¶ Bases:
PySide.QtOpenGL.QGLWidgetMethods
ColorBarWidgetinitializeGL,paintEvent,resizeGL,setQGLWidgetautoBufferSwap,bindTexture,colormap,context,convertToGLFormat,deleteTexture,doneCurrent,doubleBuffer,drawTexture,event,format,glDraw,glInit,grabFrameBuffer,initializeOverlayGL,isSharing,isValid,makeCurrent,makeOverlayCurrent,overlayContext,paintEngine,paintGL,paintOverlayGL,qglClearColor,qglColor,renderPixmap,renderText,resizeEvent,resizeOverlayGL,setAutoBufferSwap,setColormap,setMouseTracking,swapBuffers,updateGL,updateOverlayGL,__new__QWidgetacceptDrops,accessibleDescription,accessibleName,actionEvent,actions,activateWindow,addAction,addActions,adjustSize,autoFillBackground,backgroundRole,baseSize,changeEvent,childAt,childrenRect,childrenRegion,clearFocus,clearMask,close,closeEvent,contentsMargins,contentsRect,contextMenuEvent,contextMenuPolicy,createWinId,cursor,destroy,devType,dragEnterEvent,dragLeaveEvent,dragMoveEvent,dropEvent,effectiveWinId,ensurePolished,enterEvent,focusInEvent,focusNextChild,focusNextPrevChild,focusOutEvent,focusPolicy,focusPreviousChild,focusProxy,focusWidget,font,fontInfo,fontMetrics,foregroundRole,frameGeometry,frameSize,geometry,getContentsMargins,grabGesture,grabKeyboard,grabMouse,grabShortcut,graphicsEffect,graphicsProxyWidget,hasFocus,hasMouseTracking,height,heightForWidth,hide,hideEvent,inputContext,inputMethodEvent,inputMethodHints,inputMethodQuery,insertAction,insertActions,isActiveWindow,isAncestorOf,isEnabled,isEnabledTo,isFullScreen,isHidden,isLeftToRight,isMaximized,isMinimized,isModal,isRightToLeft,isVisible,isVisibleTo,isWindow,isWindowModified,keyboardGrabber,keyPressEvent,keyReleaseEvent,languageChange,layout,layoutDirection,leaveEvent,locale,lower,mapFrom,mapFromGlobal,mapFromParent,mapTo,mapToGlobal,mapToParent,mask,maximumHeight,maximumSize,maximumWidth,metric,minimumHeight,minimumSize,minimumSizeHint,minimumWidth,mouseDoubleClickEvent,mouseGrabber,mouseMoveEvent,mousePressEvent,mouseReleaseEvent,move,moveEvent,nativeParentWidget,nextInFocusChain,normalGeometry,overrideWindowFlags,overrideWindowState,palette,parentWidget,pos,previousInFocusChain,raise_,rect,releaseKeyboard,releaseMouse,releaseShortcut,removeAction,render,repaint,resetInputContext,resize,restoreGeometry,saveGeometry,scroll,setAcceptDrops,setAccessibleDescription,setAccessibleName,setAttribute,setAutoFillBackground,setBackgroundRole,setBaseSize,setContentsMargins,setContextMenuPolicy,setCursor,setDisabled,setEnabled,setFixedHeight,setFixedSize,setFixedWidth,setFocus,setFocusPolicy,setFocusProxy,setFont,setForegroundRole,setGeometry,setGraphicsEffect,setHidden,setInputContext,setInputMethodHints,setLayout,setLayoutDirection,setLocale,setMask,setMaximumHeight,setMaximumSize,setMaximumWidth,setMinimumHeight,setMinimumSize,setMinimumWidth,setPalette,setParent,setShortcutAutoRepeat,setShortcutEnabled,setSizeIncrement,setSizePolicy,setStatusTip,setStyle,setStyleSheet,setTabOrder,setToolTip,setUpdatesEnabled,setVisible,setWhatsThis,setWindowFilePath,setWindowFlags,setWindowIcon,setWindowIconText,setWindowModality,setWindowModified,setWindowOpacity,setWindowRole,setWindowState,setWindowTitle,show,showEvent,showFullScreen,showMaximized,showMinimized,showNormal,size,sizeHint,sizeIncrement,sizePolicy,stackUnder,statusTip,style,styleSheet,tabletEvent,testAttribute,toolTip,underMouse,ungrabGesture,unsetCursor,unsetLayoutDirection,unsetLocale,update,updateGeometry,updateMicroFocus,updatesEnabled,visibleRegion,whatsThis,wheelEvent,width,window,windowFilePath,windowFlags,windowIcon,windowIconText,windowModality,windowOpacity,windowRole,windowState,windowTitle,windowType,winId,x,x11Info,x11PictureHandle,yQObjectblockSignals,childEvent,children,connect,connectNotify,customEvent,deleteLater,disconnect,disconnectNotify,dumpObjectInfo,dumpObjectTree,dynamicPropertyNames,emit,eventFilter,findChild,findChildren,inherits,installEventFilter,isWidgetType,killTimer,metaObject,moveToThread,objectName,parent,property,receivers,registerUserData,removeEventFilter,sender,senderSignalIndex,setObjectName,setProperty,signalsBlocked,startTimer,thread,timerEvent,tr,trUtf8QPaintDevicecolorCount,depth,heightMM,logicalDpiX,logicalDpiY,numColors,paintingActive,physicalDpiX,physicalDpiY,widthMMAttributes
ColorBarWidgetstaticMetaObjectQWidgetcustomContextMenuRequested,DrawChildren,DrawWindowBackground,IgnoreMask,RenderFlag,RenderFlagsQObjectdestroyedQPaintDevicePaintDeviceMetric,painters,PdmDepth,PdmDpiX,PdmDpiY,PdmHeight,PdmHeightMM,PdmNumColors,PdmPhysicalDpiX,PdmPhysicalDpiY,PdmWidth,PdmWidthMM
-
class
pymor.gui.gl.GLPatchWidget(parent, grid, vmin=None, vmax=None, bounding_box=([0, 0], [1, 1]), codim=2)[source]¶ Bases:
PySide.QtOpenGL.QGLWidgetMethods
GLPatchWidgetinitializeGL,paintGL,resizeGL,set,set_coordinatesQGLWidgetautoBufferSwap,bindTexture,colormap,context,convertToGLFormat,deleteTexture,doneCurrent,doubleBuffer,drawTexture,event,format,glDraw,glInit,grabFrameBuffer,initializeOverlayGL,isSharing,isValid,makeCurrent,makeOverlayCurrent,overlayContext,paintEngine,paintEvent,paintOverlayGL,qglClearColor,qglColor,renderPixmap,renderText,resizeEvent,resizeOverlayGL,setAutoBufferSwap,setColormap,setMouseTracking,swapBuffers,updateGL,updateOverlayGL,__new__QWidgetacceptDrops,accessibleDescription,accessibleName,actionEvent,actions,activateWindow,addAction,addActions,adjustSize,autoFillBackground,backgroundRole,baseSize,changeEvent,childAt,childrenRect,childrenRegion,clearFocus,clearMask,close,closeEvent,contentsMargins,contentsRect,contextMenuEvent,contextMenuPolicy,createWinId,cursor,destroy,devType,dragEnterEvent,dragLeaveEvent,dragMoveEvent,dropEvent,effectiveWinId,ensurePolished,enterEvent,focusInEvent,focusNextChild,focusNextPrevChild,focusOutEvent,focusPolicy,focusPreviousChild,focusProxy,focusWidget,font,fontInfo,fontMetrics,foregroundRole,frameGeometry,frameSize,geometry,getContentsMargins,grabGesture,grabKeyboard,grabMouse,grabShortcut,graphicsEffect,graphicsProxyWidget,hasFocus,hasMouseTracking,height,heightForWidth,hide,hideEvent,inputContext,inputMethodEvent,inputMethodHints,inputMethodQuery,insertAction,insertActions,isActiveWindow,isAncestorOf,isEnabled,isEnabledTo,isFullScreen,isHidden,isLeftToRight,isMaximized,isMinimized,isModal,isRightToLeft,isVisible,isVisibleTo,isWindow,isWindowModified,keyboardGrabber,keyPressEvent,keyReleaseEvent,languageChange,layout,layoutDirection,leaveEvent,locale,lower,mapFrom,mapFromGlobal,mapFromParent,mapTo,mapToGlobal,mapToParent,mask,maximumHeight,maximumSize,maximumWidth,metric,minimumHeight,minimumSize,minimumSizeHint,minimumWidth,mouseDoubleClickEvent,mouseGrabber,mouseMoveEvent,mousePressEvent,mouseReleaseEvent,move,moveEvent,nativeParentWidget,nextInFocusChain,normalGeometry,overrideWindowFlags,overrideWindowState,palette,parentWidget,pos,previousInFocusChain,raise_,rect,releaseKeyboard,releaseMouse,releaseShortcut,removeAction,render,repaint,resetInputContext,resize,restoreGeometry,saveGeometry,scroll,setAcceptDrops,setAccessibleDescription,setAccessibleName,setAttribute,setAutoFillBackground,setBackgroundRole,setBaseSize,setContentsMargins,setContextMenuPolicy,setCursor,setDisabled,setEnabled,setFixedHeight,setFixedSize,setFixedWidth,setFocus,setFocusPolicy,setFocusProxy,setFont,setForegroundRole,setGeometry,setGraphicsEffect,setHidden,setInputContext,setInputMethodHints,setLayout,setLayoutDirection,setLocale,setMask,setMaximumHeight,setMaximumSize,setMaximumWidth,setMinimumHeight,setMinimumSize,setMinimumWidth,setPalette,setParent,setShortcutAutoRepeat,setShortcutEnabled,setSizeIncrement,setSizePolicy,setStatusTip,setStyle,setStyleSheet,setTabOrder,setToolTip,setUpdatesEnabled,setVisible,setWhatsThis,setWindowFilePath,setWindowFlags,setWindowIcon,setWindowIconText,setWindowModality,setWindowModified,setWindowOpacity,setWindowRole,setWindowState,setWindowTitle,show,showEvent,showFullScreen,showMaximized,showMinimized,showNormal,size,sizeHint,sizeIncrement,sizePolicy,stackUnder,statusTip,style,styleSheet,tabletEvent,testAttribute,toolTip,underMouse,ungrabGesture,unsetCursor,unsetLayoutDirection,unsetLocale,update,updateGeometry,updateMicroFocus,updatesEnabled,visibleRegion,whatsThis,wheelEvent,width,window,windowFilePath,windowFlags,windowIcon,windowIconText,windowModality,windowOpacity,windowRole,windowState,windowTitle,windowType,winId,x,x11Info,x11PictureHandle,yQObjectblockSignals,childEvent,children,connect,connectNotify,customEvent,deleteLater,disconnect,disconnectNotify,dumpObjectInfo,dumpObjectTree,dynamicPropertyNames,emit,eventFilter,findChild,findChildren,inherits,installEventFilter,isWidgetType,killTimer,metaObject,moveToThread,objectName,parent,property,receivers,registerUserData,removeEventFilter,sender,senderSignalIndex,setObjectName,setProperty,signalsBlocked,startTimer,thread,timerEvent,tr,trUtf8QPaintDevicecolorCount,depth,heightMM,logicalDpiX,logicalDpiY,numColors,paintingActive,physicalDpiX,physicalDpiY,widthMMAttributes
GLPatchWidgetstaticMetaObjectQWidgetcustomContextMenuRequested,DrawChildren,DrawWindowBackground,IgnoreMask,RenderFlag,RenderFlagsQObjectdestroyedQPaintDevicePaintDeviceMetric,painters,PdmDepth,PdmDpiX,PdmDpiY,PdmHeight,PdmHeightMM,PdmNumColors,PdmPhysicalDpiX,PdmPhysicalDpiY,PdmWidth,PdmWidthMM
jupyter module¶
This module provides plotting support inside the Jupyter notebook.
To use these routines you first have to execute
%matplotlib notebook
inside the given notebook.
-
pymor.gui.jupyter.visualize_patch(grid, U, bounding_box=([0, 0], [1, 1]), codim=2, title=None, legend=None, separate_colorbars=False, rescale_colorbars=False, columns=2)[source]¶ Visualize scalar data associated to a two-dimensional
Gridas a patch plot.The grid’s
ReferenceElementmust be the triangle or square. The data can either be attached to the faces or vertices of the grid.Parameters
- grid
- The underlying
Grid. - U
VectorArrayof the data to visualize. Iflen(U) > 1, the data is visualized as a time series of plots. Alternatively, a tuple ofVectorArrayscan be provided, in which case a subplot is created for each entry of the tuple. The lengths of all arrays have to agree.- bounding_box
- A bounding box in which the grid is contained.
- codim
- The codimension of the entities the data in
Uis attached to (either 0 or 2). - title
- Title of the plot.
- legend
- Description of the data that is plotted. Most useful if
Uis a tuple in which caselegendhas to be a tuple of strings of the same length. - separate_colorbars
- If
True, use separate colorbars for each subplot. - rescale_colorbars
- If
True, rescale colorbars to data in each frame. - columns
- The number of columns in the visualizer GUI in case multiple plots are displayed at the same time.
matplotlib module¶
This module provides a widgets for displaying plots of
scalar data assigned to one- and two-dimensional grids using
matplotlib. This widget is not intended to be used directly.
-
class
pymor.gui.matplotlib.Matplotlib1DWidget(parent, grid, count, vmin=None, vmax=None, legend=None, codim=1, separate_plots=False, dpi=100)[source]¶ Bases:
matplotlib.backends.backend_qt4agg.FigureCanvasQTAggMethods
Matplotlib1DWidgetsetFigureCanvasQTAggBaseblit,draw,draw_idle,drawRectangle,paintEvent,print_figureFigureCanvasQTwheelEventFigureCanvasQTenterEvent,flush_events,get_width_height,keyPressEvent,keyReleaseEvent,leaveEvent,minumumSizeHint,mouseDoubleClickEvent,mouseEventCoords,mouseMoveEvent,mousePressEvent,mouseReleaseEvent,new_timer,resizeEvent,sizeHint,start_event_loop,stop_event_loopQWidgetacceptDrops,accessibleDescription,accessibleName,actionEvent,actions,activateWindow,addAction,addActions,adjustSize,autoFillBackground,backgroundRole,baseSize,changeEvent,childAt,childrenRect,childrenRegion,clearFocus,clearMask,close,closeEvent,contentsMargins,contentsRect,contextMenuEvent,contextMenuPolicy,createWinId,cursor,destroy,devType,dragEnterEvent,dragLeaveEvent,dragMoveEvent,dropEvent,effectiveWinId,ensurePolished,event,focusInEvent,focusNextChild,focusNextPrevChild,focusOutEvent,focusPolicy,focusPreviousChild,focusProxy,focusWidget,font,fontInfo,fontMetrics,foregroundRole,frameGeometry,frameSize,geometry,getContentsMargins,grabGesture,grabKeyboard,grabMouse,grabShortcut,graphicsEffect,graphicsProxyWidget,hasFocus,hasMouseTracking,height,heightForWidth,hide,hideEvent,inputContext,inputMethodEvent,inputMethodHints,inputMethodQuery,insertAction,insertActions,isActiveWindow,isAncestorOf,isEnabled,isEnabledTo,isFullScreen,isHidden,isLeftToRight,isMaximized,isMinimized,isModal,isRightToLeft,isVisible,isVisibleTo,isWindow,isWindowModified,keyboardGrabber,languageChange,layout,layoutDirection,locale,lower,mapFrom,mapFromGlobal,mapFromParent,mapTo,mapToGlobal,mapToParent,mask,maximumHeight,maximumSize,maximumWidth,metric,minimumHeight,minimumSize,minimumSizeHint,minimumWidth,mouseGrabber,move,moveEvent,nativeParentWidget,nextInFocusChain,normalGeometry,overrideWindowFlags,overrideWindowState,paintEngine,palette,parentWidget,pos,previousInFocusChain,raise_,rect,releaseKeyboard,releaseMouse,releaseShortcut,removeAction,render,repaint,resetInputContext,resize,restoreGeometry,saveGeometry,scroll,setAcceptDrops,setAccessibleDescription,setAccessibleName,setAttribute,setAutoFillBackground,setBackgroundRole,setBaseSize,setContentsMargins,setContextMenuPolicy,setCursor,setDisabled,setEnabled,setFixedHeight,setFixedSize,setFixedWidth,setFocus,setFocusPolicy,setFocusProxy,setFont,setForegroundRole,setGeometry,setGraphicsEffect,setHidden,setInputContext,setInputMethodHints,setLayout,setLayoutDirection,setLocale,setMask,setMaximumHeight,setMaximumSize,setMaximumWidth,setMinimumHeight,setMinimumSize,setMinimumWidth,setMouseTracking,setPalette,setParent,setShortcutAutoRepeat,setShortcutEnabled,setSizeIncrement,setSizePolicy,setStatusTip,setStyle,setStyleSheet,setTabOrder,setToolTip,setUpdatesEnabled,setVisible,setWhatsThis,setWindowFilePath,setWindowFlags,setWindowIcon,setWindowIconText,setWindowModality,setWindowModified,setWindowOpacity,setWindowRole,setWindowState,setWindowTitle,show,showEvent,showFullScreen,showMaximized,showMinimized,showNormal,size,sizeIncrement,sizePolicy,stackUnder,statusTip,style,styleSheet,tabletEvent,testAttribute,toolTip,underMouse,ungrabGesture,unsetCursor,unsetLayoutDirection,unsetLocale,update,updateGeometry,updateMicroFocus,updatesEnabled,visibleRegion,whatsThis,width,window,windowFilePath,windowFlags,windowIcon,windowIconText,windowModality,windowOpacity,windowRole,windowState,windowTitle,windowType,winId,x,x11Info,x11PictureHandle,y,__new__QObjectblockSignals,childEvent,children,connect,connectNotify,customEvent,deleteLater,disconnect,disconnectNotify,dumpObjectInfo,dumpObjectTree,dynamicPropertyNames,emit,eventFilter,findChild,findChildren,inherits,installEventFilter,isWidgetType,killTimer,metaObject,moveToThread,objectName,parent,property,receivers,registerUserData,removeEventFilter,sender,senderSignalIndex,setObjectName,setProperty,signalsBlocked,startTimer,thread,timerEvent,tr,trUtf8QPaintDevicecolorCount,depth,heightMM,logicalDpiX,logicalDpiY,numColors,paintingActive,physicalDpiX,physicalDpiY,widthMMFigureCanvasAggbuffer_rgba,copy_from_bbox,get_renderer,print_jpeg,print_jpg,print_png,print_raw,print_rgba,print_tif,print_tiff,print_to_buffer,restore_region,tostring_argb,tostring_rgbFigureCanvasBasebutton_press_event,button_release_event,close_event,draw_cursor,draw_event,enter_notify_event,get_default_filename,get_default_filetype,get_supported_filetypes,get_supported_filetypes_grouped,get_window_title,grab_mouse,idle_event,is_saving,key_press_event,key_release_event,leave_notify_event,motion_notify_event,mpl_connect,mpl_disconnect,onHilite,onRemove,pick,pick_event,release_mouse,resize_event,scroll_event,set_window_title,start_event_loop_default,stop_event_loop_default,switch_backendsAttributes
Matplotlib1DWidgetstaticMetaObjectFigureCanvasQTbuttondQWidgetcustomContextMenuRequested,DrawChildren,DrawWindowBackground,IgnoreMask,RenderFlag,RenderFlagsQObjectdestroyedQPaintDevicePaintDeviceMetric,painters,PdmDepth,PdmDpiX,PdmDpiY,PdmHeight,PdmHeightMM,PdmNumColors,PdmPhysicalDpiX,PdmPhysicalDpiY,PdmWidth,PdmWidthMMFigureCanvasBaseevents,filetypes,fixed_dpi,supports_blit
-
class
pymor.gui.matplotlib.MatplotlibPatchAxes(figure, grid, bounding_box=None, vmin=None, vmax=None, codim=2, colorbar=True)[source]¶ Bases:
objectMethods
MatplotlibPatchAxesset
-
class
pymor.gui.matplotlib.MatplotlibPatchWidget(parent, grid, bounding_box=None, vmin=None, vmax=None, codim=2, dpi=100)[source]¶ Bases:
matplotlib.backends.backend_qt4agg.FigureCanvasQTAggMethods
MatplotlibPatchWidgetsetFigureCanvasQTAggBaseblit,draw,draw_idle,drawRectangle,paintEvent,print_figureFigureCanvasQTwheelEventFigureCanvasQTenterEvent,flush_events,get_width_height,keyPressEvent,keyReleaseEvent,leaveEvent,minumumSizeHint,mouseDoubleClickEvent,mouseEventCoords,mouseMoveEvent,mousePressEvent,mouseReleaseEvent,new_timer,resizeEvent,sizeHint,start_event_loop,stop_event_loopQWidgetacceptDrops,accessibleDescription,accessibleName,actionEvent,actions,activateWindow,addAction,addActions,adjustSize,autoFillBackground,backgroundRole,baseSize,changeEvent,childAt,childrenRect,childrenRegion,clearFocus,clearMask,close,closeEvent,contentsMargins,contentsRect,contextMenuEvent,contextMenuPolicy,createWinId,cursor,destroy,devType,dragEnterEvent,dragLeaveEvent,dragMoveEvent,dropEvent,effectiveWinId,ensurePolished,event,focusInEvent,focusNextChild,focusNextPrevChild,focusOutEvent,focusPolicy,focusPreviousChild,focusProxy,focusWidget,font,fontInfo,fontMetrics,foregroundRole,frameGeometry,frameSize,geometry,getContentsMargins,grabGesture,grabKeyboard,grabMouse,grabShortcut,graphicsEffect,graphicsProxyWidget,hasFocus,hasMouseTracking,height,heightForWidth,hide,hideEvent,inputContext,inputMethodEvent,inputMethodHints,inputMethodQuery,insertAction,insertActions,isActiveWindow,isAncestorOf,isEnabled,isEnabledTo,isFullScreen,isHidden,isLeftToRight,isMaximized,isMinimized,isModal,isRightToLeft,isVisible,isVisibleTo,isWindow,isWindowModified,keyboardGrabber,languageChange,layout,layoutDirection,locale,lower,mapFrom,mapFromGlobal,mapFromParent,mapTo,mapToGlobal,mapToParent,mask,maximumHeight,maximumSize,maximumWidth,metric,minimumHeight,minimumSize,minimumSizeHint,minimumWidth,mouseGrabber,move,moveEvent,nativeParentWidget,nextInFocusChain,normalGeometry,overrideWindowFlags,overrideWindowState,paintEngine,palette,parentWidget,pos,previousInFocusChain,raise_,rect,releaseKeyboard,releaseMouse,releaseShortcut,removeAction,render,repaint,resetInputContext,resize,restoreGeometry,saveGeometry,scroll,setAcceptDrops,setAccessibleDescription,setAccessibleName,setAttribute,setAutoFillBackground,setBackgroundRole,setBaseSize,setContentsMargins,setContextMenuPolicy,setCursor,setDisabled,setEnabled,setFixedHeight,setFixedSize,setFixedWidth,setFocus,setFocusPolicy,setFocusProxy,setFont,setForegroundRole,setGeometry,setGraphicsEffect,setHidden,setInputContext,setInputMethodHints,setLayout,setLayoutDirection,setLocale,setMask,setMaximumHeight,setMaximumSize,setMaximumWidth,setMinimumHeight,setMinimumSize,setMinimumWidth,setMouseTracking,setPalette,setParent,setShortcutAutoRepeat,setShortcutEnabled,setSizeIncrement,setSizePolicy,setStatusTip,setStyle,setStyleSheet,setTabOrder,setToolTip,setUpdatesEnabled,setVisible,setWhatsThis,setWindowFilePath,setWindowFlags,setWindowIcon,setWindowIconText,setWindowModality,setWindowModified,setWindowOpacity,setWindowRole,setWindowState,setWindowTitle,show,showEvent,showFullScreen,showMaximized,showMinimized,showNormal,size,sizeIncrement,sizePolicy,stackUnder,statusTip,style,styleSheet,tabletEvent,testAttribute,toolTip,underMouse,ungrabGesture,unsetCursor,unsetLayoutDirection,unsetLocale,update,updateGeometry,updateMicroFocus,updatesEnabled,visibleRegion,whatsThis,width,window,windowFilePath,windowFlags,windowIcon,windowIconText,windowModality,windowOpacity,windowRole,windowState,windowTitle,windowType,winId,x,x11Info,x11PictureHandle,y,__new__QObjectblockSignals,childEvent,children,connect,connectNotify,customEvent,deleteLater,disconnect,disconnectNotify,dumpObjectInfo,dumpObjectTree,dynamicPropertyNames,emit,eventFilter,findChild,findChildren,inherits,installEventFilter,isWidgetType,killTimer,metaObject,moveToThread,objectName,parent,property,receivers,registerUserData,removeEventFilter,sender,senderSignalIndex,setObjectName,setProperty,signalsBlocked,startTimer,thread,timerEvent,tr,trUtf8QPaintDevicecolorCount,depth,heightMM,logicalDpiX,logicalDpiY,numColors,paintingActive,physicalDpiX,physicalDpiY,widthMMFigureCanvasAggbuffer_rgba,copy_from_bbox,get_renderer,print_jpeg,print_jpg,print_png,print_raw,print_rgba,print_tif,print_tiff,print_to_buffer,restore_region,tostring_argb,tostring_rgbFigureCanvasBasebutton_press_event,button_release_event,close_event,draw_cursor,draw_event,enter_notify_event,get_default_filename,get_default_filetype,get_supported_filetypes,get_supported_filetypes_grouped,get_window_title,grab_mouse,idle_event,is_saving,key_press_event,key_release_event,leave_notify_event,motion_notify_event,mpl_connect,mpl_disconnect,onHilite,onRemove,pick,pick_event,release_mouse,resize_event,scroll_event,set_window_title,start_event_loop_default,stop_event_loop_default,switch_backendsAttributes
MatplotlibPatchWidgetstaticMetaObjectFigureCanvasQTbuttondQWidgetcustomContextMenuRequested,DrawChildren,DrawWindowBackground,IgnoreMask,RenderFlag,RenderFlagsQObjectdestroyedQPaintDevicePaintDeviceMetric,painters,PdmDepth,PdmDpiX,PdmDpiY,PdmHeight,PdmHeightMM,PdmNumColors,PdmPhysicalDpiX,PdmPhysicalDpiY,PdmWidth,PdmWidthMMFigureCanvasBaseevents,filetypes,fixed_dpi,supports_blit
qt module¶
This module provides a few methods and classes for visualizing data associated to grids. We use the the Qt widget toolkit for the GUI.
-
class
pymor.gui.qt.PlotMainWindow(U, plot, length=1, title=None)[source]¶ Bases:
PySide.QtGui.QWidgetBase class for plot main windows.
Methods
PlotMainWindowrewind,slider_changed,speed_changed,step_backward,step_forward,to_end,toggle_play,update_solutionQWidgetacceptDrops,accessibleDescription,accessibleName,actionEvent,actions,activateWindow,addAction,addActions,adjustSize,autoFillBackground,backgroundRole,baseSize,changeEvent,childAt,childrenRect,childrenRegion,clearFocus,clearMask,close,closeEvent,contentsMargins,contentsRect,contextMenuEvent,contextMenuPolicy,createWinId,cursor,destroy,devType,dragEnterEvent,dragLeaveEvent,dragMoveEvent,dropEvent,effectiveWinId,ensurePolished,enterEvent,event,focusInEvent,focusNextChild,focusNextPrevChild,focusOutEvent,focusPolicy,focusPreviousChild,focusProxy,focusWidget,font,fontInfo,fontMetrics,foregroundRole,frameGeometry,frameSize,geometry,getContentsMargins,grabGesture,grabKeyboard,grabMouse,grabShortcut,graphicsEffect,graphicsProxyWidget,hasFocus,hasMouseTracking,height,heightForWidth,hide,hideEvent,inputContext,inputMethodEvent,inputMethodHints,inputMethodQuery,insertAction,insertActions,isActiveWindow,isAncestorOf,isEnabled,isEnabledTo,isFullScreen,isHidden,isLeftToRight,isMaximized,isMinimized,isModal,isRightToLeft,isVisible,isVisibleTo,isWindow,isWindowModified,keyboardGrabber,keyPressEvent,keyReleaseEvent,languageChange,layout,layoutDirection,leaveEvent,locale,lower,mapFrom,mapFromGlobal,mapFromParent,mapTo,mapToGlobal,mapToParent,mask,maximumHeight,maximumSize,maximumWidth,metric,minimumHeight,minimumSize,minimumSizeHint,minimumWidth,mouseDoubleClickEvent,mouseGrabber,mouseMoveEvent,mousePressEvent,mouseReleaseEvent,move,moveEvent,nativeParentWidget,nextInFocusChain,normalGeometry,overrideWindowFlags,overrideWindowState,paintEngine,paintEvent,palette,parentWidget,pos,previousInFocusChain,raise_,rect,releaseKeyboard,releaseMouse,releaseShortcut,removeAction,render,repaint,resetInputContext,resize,resizeEvent,restoreGeometry,saveGeometry,scroll,setAcceptDrops,setAccessibleDescription,setAccessibleName,setAttribute,setAutoFillBackground,setBackgroundRole,setBaseSize,setContentsMargins,setContextMenuPolicy,setCursor,setDisabled,setEnabled,setFixedHeight,setFixedSize,setFixedWidth,setFocus,setFocusPolicy,setFocusProxy,setFont,setForegroundRole,setGeometry,setGraphicsEffect,setHidden,setInputContext,setInputMethodHints,setLayout,setLayoutDirection,setLocale,setMask,setMaximumHeight,setMaximumSize,setMaximumWidth,setMinimumHeight,setMinimumSize,setMinimumWidth,setMouseTracking,setPalette,setParent,setShortcutAutoRepeat,setShortcutEnabled,setSizeIncrement,setSizePolicy,setStatusTip,setStyle,setStyleSheet,setTabOrder,setToolTip,setUpdatesEnabled,setVisible,setWhatsThis,setWindowFilePath,setWindowFlags,setWindowIcon,setWindowIconText,setWindowModality,setWindowModified,setWindowOpacity,setWindowRole,setWindowState,setWindowTitle,show,showEvent,showFullScreen,showMaximized,showMinimized,showNormal,size,sizeHint,sizeIncrement,sizePolicy,stackUnder,statusTip,style,styleSheet,tabletEvent,testAttribute,toolTip,underMouse,ungrabGesture,unsetCursor,unsetLayoutDirection,unsetLocale,update,updateGeometry,updateMicroFocus,updatesEnabled,visibleRegion,whatsThis,wheelEvent,width,window,windowFilePath,windowFlags,windowIcon,windowIconText,windowModality,windowOpacity,windowRole,windowState,windowTitle,windowType,winId,x,x11Info,x11PictureHandle,y,__new__QObjectblockSignals,childEvent,children,connect,connectNotify,customEvent,deleteLater,disconnect,disconnectNotify,dumpObjectInfo,dumpObjectTree,dynamicPropertyNames,emit,eventFilter,findChild,findChildren,inherits,installEventFilter,isWidgetType,killTimer,metaObject,moveToThread,objectName,parent,property,receivers,registerUserData,removeEventFilter,sender,senderSignalIndex,setObjectName,setProperty,signalsBlocked,startTimer,thread,timerEvent,tr,trUtf8QPaintDevicecolorCount,depth,heightMM,logicalDpiX,logicalDpiY,numColors,paintingActive,physicalDpiX,physicalDpiY,widthMMAttributes
PlotMainWindowstaticMetaObjectQWidgetcustomContextMenuRequested,DrawChildren,DrawWindowBackground,IgnoreMask,RenderFlag,RenderFlagsQObjectdestroyedQPaintDevicePaintDeviceMetric,painters,PdmDepth,PdmDpiX,PdmDpiY,PdmHeight,PdmHeightMM,PdmNumColors,PdmPhysicalDpiX,PdmPhysicalDpiY,PdmWidth,PdmWidthMM
-
pymor.gui.qt._launch_qt_app(main_window_factory, block)[source]¶ Wrapper to display plot in a separate process.
-
pymor.gui.qt.visualize_matplotlib_1d(grid, U, codim=1, title=None, legend=None, separate_plots=False, block=False)[source]¶ Visualize scalar data associated to a one-dimensional
Gridas a plot.The grid’s
ReferenceElementmust be the line. The data can either be attached to the subintervals or vertices of the grid.Parameters
- grid
- The underlying
Grid. - U
VectorArrayof the data to visualize. Iflen(U) > 1, the data is visualized as a time series of plots. Alternatively, a tuple ofVectorArrayscan be provided, in which case several plots are made into the same axes. The lengths of all arrays have to agree.- codim
- The codimension of the entities the data in
Uis attached to (either 0 or 1). - title
- Title of the plot.
- legend
- Description of the data that is plotted. Most useful if
Uis a tuple in which caselegendhas to be a tuple of strings of the same length. - separate_plots
- If
True, use subplots to visualize multipleVectorArrays. - block
- If
True, block execution until the plot window is closed.
-
pymor.gui.qt.visualize_patch(grid, U, bounding_box=([0, 0], [1, 1]), codim=2, title=None, legend=None, separate_colorbars=False, rescale_colorbars=False, backend='gl', block=False, columns=2)[source]¶ Visualize scalar data associated to a two-dimensional
Gridas a patch plot.The grid’s
ReferenceElementmust be the triangle or square. The data can either be attached to the faces or vertices of the grid.Parameters
- grid
- The underlying
Grid. - U
VectorArrayof the data to visualize. Iflen(U) > 1, the data is visualized as a time series of plots. Alternatively, a tuple ofVectorArrayscan be provided, in which case a subplot is created for each entry of the tuple. The lengths of all arrays have to agree.- bounding_box
- A bounding box in which the grid is contained.
- codim
- The codimension of the entities the data in
Uis attached to (either 0 or 2). - title
- Title of the plot.
- legend
- Description of the data that is plotted. Most useful if
Uis a tuple in which caselegendhas to be a tuple of strings of the same length. - separate_colorbars
- If
True, use separate colorbars for each subplot. - rescale_colorbars
- If
True, rescale colorbars to data in each frame. - backend
- Plot backend to use (‘gl’ or ‘matplotlib’).
- block
- If
True, block execution until the plot window is closed. - columns
- The number of columns in the visualizer GUI in case multiple plots are displayed at the same time.
Defaults
backend (see
pymor.core.defaults)
visualizers module¶
-
class
pymor.gui.visualizers.OnedVisualizer(grid, codim=1, block=False)[source]¶ Bases:
pymor.core.interfaces.BasicInterfaceVisualize scalar data associated to a one-dimensional
Gridas a plot.The grid’s
ReferenceElementmust be the line. The data can either be attached to the subintervals or vertices of the grid.Parameters
- grid
- The underlying
Grid. - codim
- The codimension of the entities the data in
Uis attached to (either 0 or 1). - block
- If
True, block execution until the plot window is closed.
Methods
OnedVisualizervisualizeBasicInterfacedisable_logging,enable_logging,has_interface_name,implementor_names,implementorsAttributes
BasicInterfacelogger,logging_disabled,name,uid-
visualize(U, discretization, title=None, legend=None, block=None)[source]¶ Visualize the provided data.
Parameters
- U
VectorArrayof the data to visualize. Iflen(U) > 1, the data is visualized as a time series of plots. Alternatively, a tuple ofVectorArrayscan be provided, in which case several plots are made into the same axes. The lengths of all arrays have to agree.- discretization
- Filled in by
pymor.discretizations.DiscretizationBase.visualize(ignored). - title
- Title of the plot.
- legend
- Description of the data that is plotted. Most useful if
Uis a tuple in which caselegendhas to be a tuple of strings of the same length. - block
- If
True, block execution until the plot window is closed. IfNone, use the default provided during instantiation.
-
class
pymor.gui.visualizers.PatchVisualizer(grid, bounding_box=([0, 0], [1, 1]), codim=2, backend=None, block=False)[source]¶ Bases:
pymor.core.interfaces.BasicInterfaceVisualize scalar data associated to a two-dimensional
Gridas a patch plot.The grid’s
ReferenceElementmust be the triangle or square. The data can either be attached to the faces or vertices of the grid.Parameters
- grid
- The underlying
Grid. - bounding_box
- A bounding box in which the grid is contained.
- codim
- The codimension of the entities the data in
Uis attached to (either 0 or 2). - backend
- Plot backend to use (‘gl’, ‘matplotlib’, ‘jupyter’).
- block
- If
True, block execution until the plot window is closed.
Methods
PatchVisualizervisualizeBasicInterfacedisable_logging,enable_logging,has_interface_name,implementor_names,implementorsAttributes
BasicInterfacelogger,logging_disabled,name,uid-
visualize(U, discretization, title=None, legend=None, separate_colorbars=False, rescale_colorbars=False, block=None, filename=None, columns=2)[source]¶ Visualize the provided data.
Parameters
- U
VectorArrayof the data to visualize. Iflen(U) > 1, the data is visualized as a time series of plots. Alternatively, a tuple ofVectorArrayscan be provided, in which case a subplot is created for each entry of the tuple. The lengths of all arrays have to agree.- discretization
- Filled in
pymor.discretizations.DiscretizationBase.visualize(ignored). - title
- Title of the plot.
- legend
- Description of the data that is plotted. Most useful if
Uis a tuple in which caselegendhas to be a tuple of strings of the same length. - separate_colorbars
- If
True, use separate colorbars for each subplot. - rescale_colorbars
- If
True, rescale colorbars to data in each frame. - block
- If
True, block execution until the plot window is closed. IfNone, use the default provided during instantiation. - filename
- If specified, write the data to a VTK-file using
pymor.tools.vtkio.write_vtkinstead of displaying it. - columns
- The number of columns in the visualizer GUI in case multiple plots are displayed at the same time.