matplotlib.backends.backend_webagg_core#
Displays Agg images in the browser, with interactivity.
- matplotlib.backends.backend_webagg_core.FigureCanvas[source]#
alias of
FigureCanvasWebAggCore
- classmatplotlib.backends.backend_webagg_core.FigureCanvasWebAggCore(*args,**kwargs)[source]#
Bases:
FigureCanvasAgg- draw()[source]#
Render the
Figure.This method must walk the artist tree, even if no output is produced,because it triggers deferred work that users may want to accessbefore saving output to disk. For example computing limits,auto-limits, and tick values.
- draw_idle()[source]#
Request a widget redraw once control returns to the GUI event loop.
Even if multiple calls to
draw_idleoccur before control returnsto the GUI event loop, the figure will only be rendered once.Notes
Backends may choose to override the method and implement their ownstrategy to prevent multiple renderings.
- manager_class[source]#
alias of
FigureManagerWebAgg
- set_cursor(cursor)[source]#
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 inthe backend event loop after the cursor is set, as this method may becalled e.g. before a long-running task during which the GUI is notupdated.
- Parameters:
- cursor
Cursors The cursor to display over the canvas. Note: some backends maychange the cursor for the entire window.
- cursor
- set_image_mode(mode)[source]#
Set the image mode for any subsequent images which will be sentto the clients. The modes may currently be either 'full' or 'diff'.
Note: diff images may not contain transparency, therefore upondraw this mode may be changed if the resulting image has anytransparent component.
- supports_blit=False#
- matplotlib.backends.backend_webagg_core.FigureManager[source]#
alias of
FigureManagerWebAgg
- classmatplotlib.backends.backend_webagg_core.FigureManagerWebAgg(canvas,num)[source]#
Bases:
FigureManagerBase- ToolbarCls[source]#
alias of
NavigationToolbar2WebAgg
- set_window_title(title)[source]#
Set the title text of the window containing the figure.
Examples
>>>fig=plt.figure()>>>fig.canvas.manager.set_window_title('My figure')
- show()[source]#
For GUI backends, show the figure window and redraw.For non-GUI backends, raise an exception, unless running headless (i.e.on Linux with an unset DISPLAY); this exception is converted to awarning in
Figure.show.
- classmatplotlib.backends.backend_webagg_core.NavigationToolbar2WebAgg(canvas)[source]#
Bases:
NavigationToolbar2- draw_rubberband(event,x0,y0,x1,y1)[source]#
Draw a rectangle rubberband to indicate zoom limits.
Note that it is not guaranteed that
x0<=x1andy0<=y1.
- toolitems=[('Home','Resetoriginalview','home','home'),('Back','Backtopreviousview','back','back'),('Forward','Forwardtonextview','forward','forward'),(None,None,None,None),('Pan','Leftbuttonpans,Rightbuttonzooms\nx/yfixesaxis,CTRLfixesaspect','move','pan'),('Zoom','Zoomtorectangle\nx/yfixesaxis','zoom_to_rect','zoom'),(None,None,None,None),('Download','Downloadplot','filesave','download')]#
- classmatplotlib.backends.backend_webagg_core.TimerAsyncio(*args,**kwargs)[source]#
Bases:
TimerBase- Parameters:
- intervalint, default: 1000ms
The time between timer events in milliseconds. Will be stored as
timer.interval.- callbackslist[tuple[callable, tuple, dict]]
List of (func, args, kwargs) tuples that will be called upon timerevents. This list is accessible as
timer.callbacksand can bemanipulated directly, or the functionsadd_callbackandremove_callbackcan be used.
- classmatplotlib.backends.backend_webagg_core.TimerTornado(*args,**kwargs)[source]#
Bases:
TimerBase- Parameters:
- intervalint, default: 1000ms
The time between timer events in milliseconds. Will be stored as
timer.interval.- callbackslist[tuple[callable, tuple, dict]]
List of (func, args, kwargs) tuples that will be called upon timerevents. This list is accessible as
timer.callbacksand can bemanipulated directly, or the functionsadd_callbackandremove_callbackcan be used.