diff --git a/lib/matplotlib/backends/web_backend/nbagg_mpl.js b/lib/matplotlib/backends/web_backend/nbagg_mpl.js index 9747995725b8..9471f5340d51 100644 --- a/lib/matplotlib/backends/web_backend/nbagg_mpl.js +++ b/lib/matplotlib/backends/web_backend/nbagg_mpl.js @@ -55,6 +55,7 @@ mpl.mpl_figure_comm = function(comm, msg) { }; mpl.figure.prototype.handle_close = function(fig, msg) { + var width = fig.canvas.width/mpl.ratio fig.root.unbind('remove') // Update the output cell to use the data from the current canvas. @@ -63,7 +64,7 @@ mpl.figure.prototype.handle_close = function(fig, msg) { // Re-enable the keyboard manager in IPython - without this line, in FF, // the notebook keyboard shortcuts fail. IPython.keyboard_manager.enable() - $(fig.parent_element).html(''); + $(fig.parent_element).html(''); fig.close_ws(fig, msg); } @@ -74,8 +75,9 @@ mpl.figure.prototype.close_ws = function(fig, msg){ mpl.figure.prototype.push_to_output = function(remove_interactive) { // Turn the data on the canvas into data in the output cell. + var width = this.canvas.width/mpl.ratio var dataURL = this.canvas.toDataURL(); - this.cell_info[1]['text/html'] = ''; + this.cell_info[1]['text/html'] = ''; } mpl.figure.prototype.updated_canvas_event = function() {