From 48880c1631959a1898b4f97824d360299bee5f0e Mon Sep 17 00:00:00 2001 From: Madhur Tandon Date: Sat, 2 Feb 2019 15:49:45 +0530 Subject: [PATCH] Align the Figure and Buttons Toolbar to the center. - Made the ``matplotlib figure`` align to the center of the body of the text. - The buttons toolbar is now aligned to the center of the plot. --- packages/matplotlib/src/wasm_backend.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/matplotlib/src/wasm_backend.py b/packages/matplotlib/src/wasm_backend.py index 4192d4698..88a7ac41e 100644 --- a/packages/matplotlib/src/wasm_backend.py +++ b/packages/matplotlib/src/wasm_backend.py @@ -132,7 +132,10 @@ class FigureCanvasWasm(backend_agg.FigureCanvasAgg): width *= self._ratio height *= self._ratio div = self.create_root_element() - div.setAttribute('style', 'width: {}px'.format(width / self._ratio)) + div.setAttribute( + 'style', 'margin: 0 auto; text-align: center;' + + 'width: {}px'.format(width / self._ratio) + ) div.id = self._id # The top bar