Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0764eb2

Browse files
committed
Remove various mentions of the now removed GTK(2) backend.
1 parent 3a5d8c2 commit 0764eb2

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

lib/matplotlib/backends/backend_template.py

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -135,26 +135,24 @@ def points_to_pixels(self, points):
135135

136136
class 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

167165
def 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

175173
def 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):
212207
class 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):

lib/matplotlib/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ def to_polygons(self, transform=None, width=0, height=0, closed_only=True):
578578
polygon/polyline is an Nx2 array of vertices. In other words,
579579
each polygon has no ``MOVETO`` instructions or curves. This
580580
is useful for displaying in backends that do not support
581-
compound paths or Bezier curves, such as GDK.
581+
compound paths or Bezier curves.
582582
583583
If *width* and *height* are both non-zero then the lines will
584584
be simplified so that vertices outside of (0, 0), (width,

tutorials/introductory/usage.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,6 @@ def my_plotter(ax, data1, data2, param_dict):
449449
# .. _`Portable Document Format`: https://en.wikipedia.org/wiki/Portable_Document_Format
450450
# .. _`Scalable Vector Graphics`: https://en.wikipedia.org/wiki/Scalable_Vector_Graphics
451451
# .. _`Cairo graphics`: https://wwW.cairographics.org
452-
# .. _`Gimp Drawing Kit`: https://en.wikipedia.org/wiki/GDK
453-
# .. _PyGTK: http://www.pygtk.org
454452
# .. _PyGObject: https://wiki.gnome.org/action/show/Projects/PyGObject
455453
# .. _pycairo: https://www.cairographics.org/pycairo/
456454
# .. _cairocffi: https://pythonhosted.org/cairocffi/

0 commit comments

Comments
 (0)