Skip to content

Commit

Permalink
Save and restore state around the PDF backend path collection draw. F…
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Nov 6, 2012
1 parent 1656ebc commit a2ed1e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/matplotlib/backends/backend_pdf.py
Expand Up @@ -7,6 +7,7 @@
from __future__ import division, print_function

import codecs
import copy
import os
import re
import sys
Expand Down Expand Up @@ -1534,7 +1535,7 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
path_codes.append(name)

output = self.file.output
output(Op.gsave)
output(*self.gc.push())
lastx, lasty = 0, 0
for xo, yo, path_id, gc0, rgbFace in self._iter_collection(
gc, master_transform, all_transforms, path_codes, offsets,
Expand All @@ -1545,7 +1546,7 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
dx, dy = xo - lastx, yo - lasty
output(1, 0, 0, 1, dx, dy, Op.concat_matrix, path_id, Op.use_xobject)
lastx, lasty = xo, yo
output(Op.grestore)
output(*self.gc.pop())

def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None):
# For simple paths or small numbers of markers, don't bother
Expand Down

0 comments on commit a2ed1e6

Please sign in to comment.