@@ -135,26 +135,24 @@ def points_to_pixels(self, points):
135135
136136class GraphicsContextTemplate (GraphicsContextBase ):
137137 """
138- The graphics context provides the color, line styles, etc... See the gtk
138+ The graphics context provides the color, line styles, etc... See the cairo
139139 and postscript backends for examples of mapping the graphics context
140140 attributes (cap styles, join styles, line widths, colors) to a particular
141- backend. In GTK this is done by wrapping a gtk.gdk.GC object and
141+ backend. In cairo this is done by wrapping a cairo.Context object and
142142 forwarding the appropriate calls to it using a dictionary mapping styles
143143 to gdk constants. In Postscript, all the work is done by the renderer,
144144 mapping line styles to postscript calls.
145145
146146 If it's more appropriate to do the mapping at the renderer level (as in
147147 the postscript backend), you don't need to override any of the GC methods.
148- If it's more appropriate to wrap an instance (as in the GTK backend) and
148+ If it's more appropriate to wrap an instance (as in the cairo backend) and
149149 do the mapping here, you'll need to override several of the setter
150150 methods.
151151
152152 The base GraphicsContext stores colors as a RGB tuple on the unit
153153 interval, e.g., (0.5, 0.0, 1.0). You may need to map this to colors
154154 appropriate for your backend.
155155 """
156- pass
157-
158156
159157
160158########################################################################
@@ -166,19 +164,18 @@ class GraphicsContextTemplate(GraphicsContextBase):
166164
167165def draw_if_interactive ():
168166 """
169- For image backends - is not required
167+ For image backends - is not required.
170168 For GUI backends - this should be overridden if drawing should be done in
171- interactive python mode
169+ interactive python mode.
172170 """
173171
174172
175173def show (block = None ):
176174 """
177- For image backends - is not required
175+ For image backends - is not required.
178176 For GUI backends - show() is usually the last line of a pyplot script and
179- tells the backend that it is time to draw. In interactive mode, this may
180- be a do nothing func. See the GTK backend for an example of how to handle
181- interactive versus batch mode
177+ tells the backend that it is time to draw. In interactive mode, this
178+ should do nothing.
182179 """
183180 for manager in Gcf .get_all_fig_managers ():
184181 # do something to display the GUI
@@ -189,12 +186,11 @@ def new_figure_manager(num, *args, FigureClass=Figure, **kwargs):
189186 """
190187 Create a new figure manager instance
191188 """
192- # May be implemented via the `_new_figure_manager_template` helper.
193189 # If a main-level app must be created, this (and
194190 # new_figure_manager_given_figure) is the usual place to do it -- see
195191 # backend_wx, backend_wxagg and backend_tkagg for examples. Not all GUIs
196- # require explicit instantiation of a main-level app (egg backend_gtk,
197- # backend_gtkagg) for pylab.
192+ # require explicit instantiation of a main-level app (e.g., backend_gtk3)
193+ # for pylab.
198194 thisFig = FigureClass (* args , ** kwargs )
199195 return new_figure_manager_given_figure (num , thisFig )
200196
@@ -203,7 +199,6 @@ def new_figure_manager_given_figure(num, figure):
203199 """
204200 Create a new figure manager instance for the given figure.
205201 """
206- # May be implemented via the `_new_figure_manager_template` helper.
207202 canvas = FigureCanvasTemplate (figure )
208203 manager = FigureManagerTemplate (canvas , num )
209204 return manager
@@ -212,19 +207,18 @@ def new_figure_manager_given_figure(num, figure):
212207class FigureCanvasTemplate (FigureCanvasBase ):
213208 """
214209 The canvas the figure renders into. Calls the draw and print fig
215- methods, creates the renderers, etc...
210+ methods, creates the renderers, etc.
216211
217- Note GUI templates will want to connect events for button presses,
212+ Note: GUI templates will want to connect events for button presses,
218213 mouse movements and key presses to functions that call the base
219214 class methods button_press_event, button_release_event,
220- motion_notify_event, key_press_event, and key_release_event. See,
221- e.g., backend_gtk.py, backend_wx.py and backend_tkagg.py
215+ motion_notify_event, key_press_event, and key_release_event. See the
216+ implementations of the interactive backends for examples.
222217
223218 Attributes
224219 ----------
225220 figure : `matplotlib.figure.Figure`
226221 A high-level Figure instance
227-
228222 """
229223
230224 def draw (self ):
0 commit comments