diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a5c8544b7e88..a46ea3dac031 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,6 +2,8 @@ # Create and test a Python package on multiple Python versions. # Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/python +pr: none +trigger: none strategy: matrix: diff --git a/lib/matplotlib/backends/backend_pgf.py b/lib/matplotlib/backends/backend_pgf.py index 4474aa32a3e1..be1b83ff06e7 100644 --- a/lib/matplotlib/backends/backend_pgf.py +++ b/lib/matplotlib/backends/backend_pgf.py @@ -870,6 +870,12 @@ def _print_pgf_to_fh(self, fh, *, writeln(fh, r"\makeatother") writeln(fh, r"\endgroup") + + def draw(self): + # docstring inherited + self.figure.draw(self.get_renderer()) + + def print_pgf(self, fname_or_fh, *args, **kwargs): """ Output pgf macros for drawing the figure so it can be included and diff --git a/lib/matplotlib/tests/test_backend_pgf.py b/lib/matplotlib/tests/test_backend_pgf.py index 702cc6c35870..126fb1e276e7 100644 --- a/lib/matplotlib/tests/test_backend_pgf.py +++ b/lib/matplotlib/tests/test_backend_pgf.py @@ -324,3 +324,16 @@ def test_bbox_inches_tight(tmpdir): ax.imshow([[0, 1], [2, 3]]) fig.savefig(os.path.join(tmpdir, "test.pdf"), backend="pgf", bbox_inches="tight") + + +@needs_pdflatex +@pytest.mark.style('default') +@pytest.mark.backend('pgf') +def test_draw(): + mpl.rcParams['pgf.texsystem'] = 'pdflatex' + fig, ax = plt.subplots() + ax.plot(np.arange(10)) + old_Nticks = len(ax.yaxis.majorTicks) + fig.canvas.draw() + new_Nticks = len(ax.yaxis.majorTicks) + assert old_Nticks != new_Nticks