Skip to content

Commit

Permalink
Added "new_figure_manager_given_figure" function for pgf backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
pelson committed Aug 30, 2012
1 parent 7885d94 commit f4245bb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/matplotlib/backends/backend_pgf.py
Expand Up @@ -598,6 +598,7 @@ class GraphicsContextPgf(GraphicsContextBase):
def draw_if_interactive():
pass


def new_figure_manager(num, *args, **kwargs):
"""
Create a new figure manager instance
Expand All @@ -608,7 +609,14 @@ def new_figure_manager(num, *args, **kwargs):
# main-level app (egg backend_gtk, backend_gtkagg) for pylab
FigureClass = kwargs.pop('FigureClass', Figure)
thisFig = FigureClass(*args, **kwargs)
canvas = FigureCanvasPgf(thisFig)
return new_figure_manager_given_figure(thisFig)


def new_figure_manager_given_figure(num, figure):
"""
Create a new figure manager instance for the given figure.
"""
canvas = FigureCanvasPgf(figure)
manager = FigureManagerPgf(canvas, num)
return manager

Expand Down

0 comments on commit f4245bb

Please sign in to comment.