|
26 | 26 | import matplotlib as mpl |
27 | 27 | from matplotlib import _api, _text_layout, cbook |
28 | 28 | from matplotlib._pylab_helpers import Gcf |
29 | | -from matplotlib.afm import AFM |
30 | 29 | from matplotlib.backend_bases import ( |
31 | 30 | _Backend, _check_savefig_extra_args, FigureCanvasBase, FigureManagerBase, |
32 | 31 | GraphicsContextBase, RendererBase) |
33 | 32 | from matplotlib.backends.backend_mixed import MixedModeRenderer |
34 | | -from matplotlib.dates import UTC |
35 | | -import matplotlib.dviread as dviread |
36 | 33 | from matplotlib.figure import Figure |
37 | 34 | from matplotlib.font_manager import findfont, get_font |
| 35 | +from matplotlib.afm import AFM |
| 36 | +import matplotlib.type1font as type1font |
| 37 | +import matplotlib.dviread as dviread |
38 | 38 | from matplotlib.ft2font import (FIXED_WIDTH, ITALIC, LOAD_NO_SCALE, |
39 | 39 | LOAD_NO_HINTING, KERNING_UNFITTED) |
40 | 40 | from matplotlib.mathtext import MathTextParser |
41 | | -from matplotlib import _path |
42 | | -from matplotlib.path import Path |
43 | | -from matplotlib._types import JoinStyle, CapStyle |
44 | | -import matplotlib.type1font as type1font |
45 | 41 | from matplotlib.transforms import Affine2D, BboxBase |
| 42 | +from matplotlib.path import Path |
| 43 | +from matplotlib.dates import UTC |
| 44 | +from matplotlib import _path |
46 | 45 | from . import _backend_pdf_ps |
47 | 46 |
|
48 | 47 | _log = logging.getLogger(__name__) |
@@ -747,8 +746,7 @@ def newPage(self, width, height): |
747 | 746 | self.reserveObject('length of content stream')) |
748 | 747 | # Initialize the pdf graphics state to match the default mpl |
749 | 748 | # graphics context: currently only the join style needs to be set |
750 | | - self.output(GraphicsContextPdf.joinstyles[JoinStyle.round], |
751 | | - Op.setlinejoin) |
| 749 | + self.output(GraphicsContextPdf.joinstyles['round'], Op.setlinejoin) |
752 | 750 |
|
753 | 751 | # Clear the list of annotations for the next page |
754 | 752 | self.pageAnnotations = [] |
@@ -2416,8 +2414,8 @@ def paint(self): |
2416 | 2414 | """ |
2417 | 2415 | return Op.paint_path(self.fill(), self.stroke()) |
2418 | 2416 |
|
2419 | | - capstyles = {CapStyle.butt: 0, CapStyle.round: 1, CapStyle.projecting: 2} |
2420 | | - joinstyles = {JoinStyle.miter: 0, JoinStyle.round: 1, JoinStyle.bevel: 2} |
| 2417 | + capstyles = {'butt': 0, 'round': 1, 'projecting': 2} |
| 2418 | + joinstyles = {'miter': 0, 'round': 1, 'bevel': 2} |
2421 | 2419 |
|
2422 | 2420 | def capstyle_cmd(self, style): |
2423 | 2421 | return [self.capstyles[style], Op.setlinecap] |
|
0 commit comments