pymor.gui.jupyter package¶
This module provides plotting support inside the Jupyter notebook.
To use these routines you first have to execute
%matplotlib notebook
inside the given notebook.
Submodules¶
logging module¶
-
class
pymor.gui.jupyter.logging.LogViewer(out, accordion=None)[source]¶ Bases:
logging.HandlerMethods
acquire,createLock,flush,format,get_name,handle,handleError,release,set_name,setFormatter,setLevelFiltereraddFilter,filter,removeFilter
patch module¶
-
pymor.gui.jupyter.patch.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.
threejs module¶
-
class
pymor.gui.jupyter.threejs.ColorBarRenderer(render_size, color_map, vmin=None, vmax=None)[source]¶ Bases:
ipywidgets.widgets.widget_box.VBoxMethods
freeze_camera,gotoDOMWidgetadd_class,remove_classWidgetadd_traits,close,close_all,get_manager_state,get_state,get_view_spec,handle_comm_opened,hold_sync,notify_change,on_displayed,on_msg,on_widget_constructed,open,send,send_state,set_state,__del__HasTraitsclass_own_trait_events,class_own_traits,class_trait_names,class_traits,has_trait,hold_trait_notifications,observe,on_trait_change,set_trait,setup_instance,trait_events,trait_metadata,trait_names,traits,unobserve,unobserve_allAttributes
Boxbox_style,childrenDOMWidgetlayoutWidgetcomm,keys,model_id,widget_types,widgetsLoggingHasTraitslogHasTraitscross_validation_lock
-
class
pymor.gui.jupyter.threejs.Renderer(U, grid, render_size, color_map, title, bounding_box=([0, 0], [1, 1]), codim=2, vmin=None, vmax=None)[source]¶ Bases:
ipywidgets.widgets.widget_box.VBoxMethods
freeze_camera,gotoDOMWidgetadd_class,remove_classWidgetadd_traits,close,close_all,get_manager_state,get_state,get_view_spec,handle_comm_opened,hold_sync,notify_change,on_displayed,on_msg,on_widget_constructed,open,send,send_state,set_state,__del__HasTraitsclass_own_trait_events,class_own_traits,class_trait_names,class_traits,has_trait,hold_trait_notifications,observe,on_trait_change,set_trait,setup_instance,trait_events,trait_metadata,trait_names,traits,unobserve,unobserve_allAttributes
Boxbox_style,childrenDOMWidgetlayoutWidgetcomm,keys,model_id,widget_types,widgetsLoggingHasTraitslogHasTraitscross_validation_lock
-
class
pymor.gui.jupyter.threejs.ThreeJSPlot(grid, color_map, title, bounding_box, codim, U, vmins, vmaxs, separate_colorbars, size)[source]¶ Bases:
ipywidgets.widgets.widget_box.VBoxMethods
finish_loadingDOMWidgetadd_class,remove_classWidgetadd_traits,close,close_all,get_manager_state,get_state,get_view_spec,handle_comm_opened,hold_sync,notify_change,on_displayed,on_msg,on_widget_constructed,open,send,send_state,set_state,__del__HasTraitsclass_own_trait_events,class_own_traits,class_trait_names,class_traits,has_trait,hold_trait_notifications,observe,on_trait_change,set_trait,setup_instance,trait_events,trait_metadata,trait_names,traits,unobserve,unobserve_allAttributes
Boxbox_style,childrenDOMWidgetlayoutWidgetcomm,keys,model_id,widget_types,widgetsLoggingHasTraitslogHasTraitscross_validation_lock
-
pymor.gui.jupyter.threejs.visualize_py3js(grid, U, bounding_box=([0, 0], [1, 1]), codim=2, title=None, legend=None, separate_colorbars=False, rescale_colorbars=False, columns=2, color_map=<matplotlib.colors.ListedColormap object>)[source]¶ Generate a pythreejs Plot and associated controls for scalar data associated to a two-dimensional
Grid.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.
- color_map
a Matplotlib Colormap object