Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions lib/matplotlib/backends/backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions lib/matplotlib/tests/test_backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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