@@ -27,7 +27,7 @@ class RendererBase:
27
27
28
28
The following methods *should* be implemented in the backend for
29
29
optimization reasons:
30
-
30
+
31
31
draw_markers
32
32
draw_path_collection
33
33
draw_quad_mesh
@@ -73,7 +73,7 @@ def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None)
73
73
self .draw_path (gc , marker_path ,
74
74
marker_trans + transforms .Affine2D ().translate (x , y ),
75
75
rgbFace )
76
-
76
+
77
77
def draw_path_collection (self , master_transform , cliprect , clippath ,
78
78
clippath_trans , paths , all_transforms , offsets ,
79
79
offsetTrans , facecolors , edgecolors , linewidths ,
@@ -126,12 +126,12 @@ def draw_quad_mesh(self, master_transform, cliprect, clippath,
126
126
else :
127
127
edgecolors = facecolors
128
128
linewidths = npy .array ([1.0 ], npy .float_ )
129
-
129
+
130
130
return self .draw_path_collection (
131
131
master_transform , cliprect , clippath , clippath_trans ,
132
132
paths , [], offsets , offsetTrans , facecolors , edgecolors ,
133
133
linewidths , [], [antialiased ])
134
-
134
+
135
135
def _iter_collection_raw_paths (self , master_transform , paths , all_transforms ):
136
136
"""
137
137
This is a helper method (along with _iter_collection) to make
@@ -203,20 +203,20 @@ def _iter_collection(self, path_ids, cliprect, clippath, clippath_trans,
203
203
return
204
204
if Noffsets :
205
205
toffsets = offsetTrans .transform (offsets )
206
-
206
+
207
207
gc = self .new_gc ()
208
208
209
209
gc .set_clip_rectangle (cliprect )
210
210
if clippath is not None :
211
211
clippath = transforms .TransformedPath (clippath , clippath_trans )
212
212
gc .set_clip_path (clippath )
213
-
213
+
214
214
if Nfacecolors == 0 :
215
215
rgbFace = None
216
216
217
217
if Nedgecolors == 0 :
218
218
gc .set_linewidth (0.0 )
219
-
219
+
220
220
xo , yo = 0 , 0
221
221
for i in xrange (N ):
222
222
path_id = path_ids [i % Npaths ]
@@ -233,7 +233,7 @@ def _iter_collection(self, path_ids, cliprect, clippath, clippath_trans,
233
233
gc .set_antialiased (antialiaseds [i % Naa ])
234
234
235
235
yield xo , yo , path_id , gc , rgbFace
236
-
236
+
237
237
def get_image_magnification (self ):
238
238
"""
239
239
Get the factor by which to magnify images passed to draw_image.
@@ -282,7 +282,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False):
282
282
your text.
283
283
"""
284
284
raise NotImplementedError
285
-
285
+
286
286
def flipy (self ):
287
287
"""return true if y small numbers are top for renderer
288
288
Is used for drawing text (text.py) and images (image.py) only
@@ -334,7 +334,7 @@ def start_rasterizing(self):
334
334
335
335
def stop_rasterizing (self ):
336
336
pass
337
-
337
+
338
338
339
339
class GraphicsContextBase :
340
340
"""An abstract base class that provides color, line styles, etc...
@@ -380,8 +380,6 @@ def get_alpha(self):
380
380
Return the alpha value used for blending - not supported on
381
381
all backends
382
382
"""
383
- if len (self ._rgb ) == 4 :
384
- return self ._rgb [3 ]
385
383
return self ._alpha
386
384
387
385
def get_antialiased (self ):
@@ -795,7 +793,7 @@ def sort_artists(artists):
795
793
# can't delete the artist
796
794
while h :
797
795
print "Removing" ,h
798
- if h .remove ():
796
+ if h .remove ():
799
797
self .draw_idle ()
800
798
break
801
799
parent = None
@@ -804,7 +802,7 @@ def sort_artists(artists):
804
802
parent = p
805
803
break
806
804
h = parent
807
-
805
+
808
806
def onHilite (self , ev ):
809
807
"""
810
808
Mouse event processor which highlights the artists
@@ -980,7 +978,7 @@ def get_width_height(self):
980
978
# a) otherwise we'd have cyclical imports, since all of these
981
979
# classes inherit from FigureCanvasBase
982
980
# b) so we don't import a bunch of stuff the user may never use
983
-
981
+
984
982
def print_emf (self , * args , ** kwargs ):
985
983
from backends .backend_emf import FigureCanvasEMF # lazy import
986
984
emf = self .switch_backends (FigureCanvasEMF )
@@ -990,7 +988,7 @@ def print_eps(self, *args, **kwargs):
990
988
from backends .backend_ps import FigureCanvasPS # lazy import
991
989
ps = self .switch_backends (FigureCanvasPS )
992
990
return ps .print_eps (* args , ** kwargs )
993
-
991
+
994
992
def print_pdf (self , * args , ** kwargs ):
995
993
from backends .backend_pdf import FigureCanvasPdf # lazy import
996
994
pdf = self .switch_backends (FigureCanvasPdf )
@@ -1000,7 +998,7 @@ def print_png(self, *args, **kwargs):
1000
998
from backends .backend_agg import FigureCanvasAgg # lazy import
1001
999
agg = self .switch_backends (FigureCanvasAgg )
1002
1000
return agg .print_png (* args , ** kwargs )
1003
-<
8000
/span>
1001
+
1004
1002
def print_ps (self , * args , ** kwargs ):
1005
1003
from backends .backend_ps import FigureCanvasPS # lazy import
1006
1004
ps = self .switch_backends (FigureCanvasPS )
@@ -1016,12 +1014,12 @@ def print_svg(self, *args, **kwargs):
1016
1014
from backends .backend_svg import FigureCanvasSVG # lazy import
1017
1015
svg = self .switch_backends (FigureCanvasSVG )
1018
1016
return svg .print_svg (* args , ** kwargs )
1019
-
1017
+
1020
1018
def print_svgz (self , * args , ** kwargs ):
1021
1019
from backends .backend_svg import FigureCanvasSVG # lazy import
1022
1020
svg = self .switch_backends (FigureCanvasSVG )
1023
1021
return svg .print_svgz (* args , ** kwargs )
1024
-
1022
+
1025
1023
def get_supported_filetypes (self ):
1026
1024
return self .filetypes
1027
1025
@@ -1031,7 +1029,7 @@ def get_supported_filetypes_grouped(self):
1031
1029
groupings .setdefault (name , []).append (ext )
1032
1030
groupings [name ].sort ()
1033
1031
return groupings
1034
-
1032
+
1035
1033
def print_figure (self , filename , dpi = None , facecolor = 'w' , edgecolor = 'w' ,
1036
1034
orientation = 'portrait' , format = None , ** kwargs ):
1037
1035
"""
@@ -1069,7 +1067,7 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
1069
1067
1070
1068
if dpi is None :
1071
1069
dpi = rcParams ['savefig.dpi' ]
1072
-
1070
+
1073
1071
origDPI = self .figure .dpi
1074
1072
origfacecolor = self .figure .get_facecolor ()
1075
1073
origedgecolor = self .figure .get_edgecolor ()
@@ -1092,12 +1090,12 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
1092
1090
self .figure .set_edgecolor (origedgecolor )
1093
1091
self .figure .set_canvas (self )
1094
1092
self .figure .canvas .draw ()
1095
-
1093
+
1096
1094
return result
1097
1095
1098
1096
def get_default_filetype (self ):
1099
1097
raise NotImplementedError
1100
-
1098
+
1101
1099
def set_window_title (self , title ):
1102
1100
"""
1103
1101
Set the title text of the window containing the figure. Note that
0 commit comments