@@ -1626,8 +1626,7 @@ def check_gc(self, gc, fillcolor=None):
16261626 gc ._effective_alphas = orig_alphas
16271627
16281628 def track_characters (self , font , s ):
1629- """Keeps track of which characters are required from
1630- each font."""
1629+ """Keeps track of which characters are required from each font."""
16311630 if isinstance (font , str ):
16321631 fname = font
16331632 else :
@@ -1647,19 +1646,16 @@ def get_image_magnification(self):
16471646 return self .image_dpi / 72.0
16481647
16491648 def option_scale_image (self ):
1650- """
1651- pdf backend support arbitrary scaling of image.
1652- """
1649+ # docstring inherited
16531650 return True
16541651
16551652 def option_image_nocomposite (self ):
1656- """
1657- return whether to generate a composite image from multiple images on
1658- a set of axes
1659- """
1653+ # docstring inherited
16601654 return not rcParams ['image.composite_image' ]
16611655
16621656 def draw_image (self , gc , x , y , im , transform = None ):
1657+ # docstring inherited
1658+
16631659 h , w = im .shape [:2 ]
16641660 if w == 0 or h == 0 :
16651661 return
@@ -1688,6 +1684,7 @@ def draw_image(self, gc, x, y, im, transform=None):
16881684 imob , Op .use_xobject , Op .grestore )
16891685
16901686 def draw_path (self , gc , path , transform , rgbFace = None ):
1687+ # docstring inherited
16911688 self .check_gc (gc , rgbFace )
16921689 self .file .writePath (
16931690 path , transform ,
@@ -1767,6 +1764,8 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
17671764
17681765 def draw_markers (self , gc , marker_path , marker_trans , path , trans ,
17691766 rgbFace = None ):
1767+ # docstring inherited
1768+
17701769 # Same logic as in draw_path_collection
17711770 len_marker_path = len (marker_path )
17721771 uses = len (path )
@@ -1899,6 +1898,7 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
18991898 self .file .output (Op .grestore )
19001899
19011900 def draw_tex (self , gc , x , y , s , prop , angle , ismath = 'TeX!' , mtext = None ):
1901+ # docstring inherited
19021902 texmanager = self .get_texmanager ()
19031903 fontsize = prop .get_size_in_points ()
19041904 dvifile = texmanager .make_dvi (s , fontsize )
@@ -1982,6 +1982,8 @@ def encode_string(self, s, fonttype):
19821982 return s .encode ('utf-16be' , 'replace' )
19831983
19841984 def draw_text (self , gc , x , y , s , prop , angle , ismath = False , mtext = None ):
1985+ # docstring inherited
1986+
19851987 # TODO: combine consecutive texts into one BT/ET delimited section
19861988
19871989 # This function is rather complex, since there is no way to
@@ -2017,9 +2019,11 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
20172019 fonttype = 42
20182020
20192021 def check_simple_method (s ):
2020- """Determine if we should use the simple or woven method
2021- to output this text, and chunks the string into 1-byte and
2022- 2-byte sections if necessary."""
2022+ """
2023+ Determine if we should use the simple or woven method to output
2024+ this text, and chunks the string into 1-byte and 2-byte sections if
2025+ necessary.
2026+ """
20232027 use_simple_method = True
20242028 chunks = []
20252029
@@ -2052,9 +2056,10 @@ def draw_text_simple():
20522056 Op .end_text )
20532057
20542058 def draw_text_woven (chunks ):
2055- """Outputs text using the woven method, alternating
2056- between chunks of 1-byte characters and 2-byte characters.
2057- Only used for Type 3 fonts."""
2059+ """
2060+ Outputs text using the woven method, alternating between chunks of
2061+ 1-byte and 2-byte characters. Only used for Type 3 fonts.
2062+ """
20582063 chunks = [(a , '' .join (b )) for a , b in chunks ]
20592064
20602065 # Do the rotation and global translation as a single matrix
@@ -2122,6 +2127,8 @@ def draw_text_woven(chunks):
21222127 return draw_text_woven (chunks )
21232128
21242129 def get_text_width_height_descent (self , s , prop , ismath ):
2130+ # docstring inherited
2131+
21252132 if rcParams ['text.usetex' ]:
21262133 texmanager = self .get_texmanager ()
21272134 fontsize = prop .get_size_in_points ()
@@ -2177,12 +2184,15 @@ def _get_font_ttf(self, prop):
21772184 return font
21782185
21792186 def flipy (self ):
2187+ # docstring inherited
21802188 return False
21812189
21822190 def get_canvas_width_height (self ):
2191+ # docstring inherited
21832192 return self .file .width * 72.0 , self .file .height * 72.0
21842193
21852194 def new_gc (self ):
2195+ # docstring inherited
21862196 return GraphicsContextPdf (self .file )
21872197
21882198
0 commit comments