Commit 4b286282 authored by Yori Fournier's avatar Yori Fournier
Browse files

add print_in_notebook function

I am afraid that the as_seen feature won't work since
it seems that they call fig.plot before rendering...
I need to dig more.
parent 91975266
Pipeline #512 passed with stage
in 12 minutes and 25 seconds
......@@ -361,6 +361,18 @@ class MplFig(Figure):
print(SPCE + " ID the figure: " + str(self.fignum))
print(SPCE + "Size of the figure: " + str(self.FIGSIZE) + ' [inch] \n')
# PRINT IN NOTEBOOK --------------------------------------------------
def print_in_notebook(self, **kwargs):
as_seen = kwargs.get('as_seen', False)
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
canvas = FigureCanvas(self) # set the figures canvas /!\ this will destroy the bounding to a window.
self.bounded_to_win = False
return(self)
# PRINT 2 FILE -------------------------------------------------------
def print_to_file(self, filename, *args, **kwargs):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment