Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Remove various mentions of the now removed GTK(2) backend. #11503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 14 additions & 20 deletions 34 lib/matplotlib/backends/backend_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,26 +135,24 @@ def points_to_pixels(self, points):

class GraphicsContextTemplate(GraphicsContextBase):
"""
The graphics context provides the color, line styles, etc... See the gtk
The graphics context provides the color, line styles, etc... See the cairo
and postscript backends for examples of mapping the graphics context
attributes (cap styles, join styles, line widths, colors) to a particular
backend. In GTK this is done by wrapping a gtk.gdk.GC object and
backend. In cairo this is done by wrapping a cairo.Context object and
forwarding the appropriate calls to it using a dictionary mapping styles
to gdk constants. In Postscript, all the work is done by the renderer,
mapping line styles to postscript calls.

If it's more appropriate to do the mapping at the renderer level (as in
the postscript backend), you don't need to override any of the GC methods.
If it's more appropriate to wrap an instance (as in the GTK backend) and
If it's more appropriate to wrap an instance (as in the cairo backend) and
do the mapping here, you'll need to override several of the setter
methods.

The base GraphicsContext stores colors as a RGB tuple on the unit
interval, e.g., (0.5, 0.0, 1.0). You may need to map this to colors
appropriate for your backend.
"""
pass



########################################################################
Expand All @@ -166,19 +164,18 @@ class GraphicsContextTemplate(GraphicsContextBase):

def draw_if_interactive():
"""
For image backends - is not required
For image backends - is not required.
For GUI backends - this should be overridden if drawing should be done in
interactive python mode
interactive python mode.
"""


def show(block=None):
"""
For image backends - is not required
For image backends - is not required.
For GUI backends - show() is usually the last line of a pyplot script and
tells the backend that it is time to draw. In interactive mode, this may
be a do nothing func. See the GTK backend for an example of how to handle
interactive versus batch mode
tells the backend that it is time to draw. In interactive mode, this
should do nothing.
"""
for manager in Gcf.get_all_fig_managers():
# do something to display the GUI
Expand All @@ -189,12 +186,11 @@ def new_figure_manager(num, *args, FigureClass=Figure, **kwargs):
"""
Create a new figure manager instance
"""
# May be implemented via the `_new_figure_manager_template` helper.
# If a main-level app must be created, this (and
# new_figure_manager_given_figure) is the usual place to do it -- see
# backend_wx, backend_wxagg and backend_tkagg for examples. Not all GUIs
# require explicit instantiation of a main-level app (egg backend_gtk,
# backend_gtkagg) for pylab.
# require explicit instantiation of a main-level app (e.g., backend_gtk3)
# for pylab.
thisFig = FigureClass(*args, **kwargs)
return new_figure_manager_given_figure(num, thisFig)

Expand All @@ -203,7 +199,6 @@ def new_figure_manager_given_figure(num, figure):
"""
Create a new figure manager instance for the given figure.
"""
# May be implemented via the `_new_figure_manager_template` helper.
canvas = FigureCanvasTemplate(figure)
manager = FigureManagerTemplate(canvas, num)
return manager
Expand All @@ -212,19 +207,18 @@ def new_figure_manager_given_figure(num, figure):
class FigureCanvasTemplate(FigureCanvasBase):
"""
The canvas the figure renders into. Calls the draw and print fig
methods, creates the renderers, etc...
methods, creates the renderers, etc.

Note GUI templates will want to connect events for button presses,
Note: GUI templates will want to connect events for button presses,
mouse movements and key presses to functions that call the base
class methods button_press_event, button_release_event,
motion_notify_event, key_press_event, and key_release_event. See,
e.g., backend_gtk.py, backend_wx.py and backend_tkagg.py
motion_notify_event, key_press_event, and key_release_event. See the
implementations of the interactive backends for examples.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we point to a more concrete location?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Literally any of the interactive backends will do; I don't think there's much of a point of picking one versus the other.


Attributes
----------
figure : `matplotlib.figure.Figure`
A high-level Figure instance

"""

def draw(self):
Expand Down
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def to_polygons(self, transform=None, width=0, height=0, closed_only=True):
polygon/polyline is an Nx2 array of vertices. In other words,
each polygon has no ``MOVETO`` instructions or curves. This
is useful for displaying in backends that do not support
compound paths or Bezier curves, such as GDK.
compound paths or Bezier curves.

If *width* and *height* are both non-zero then the lines will
be simplified so that vertices outside of (0, 0), (width,
Expand Down
2 changes: 0 additions & 2 deletions 2 tutorials/introductory/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,6 @@ def my_plotter(ax, data1, data2, param_dict):
# .. _`Portable Document Format`: https://en.wikipedia.org/wiki/Portable_Document_Format
# .. _`Scalable Vector Graphics`: https://en.wikipedia.org/wiki/Scalable_Vector_Graphics
# .. _`Cairo graphics`: https://wwW.cairographics.org
# .. _`Gimp Drawing Kit`: https://en.wikipedia.org/wiki/GDK
# .. _PyGTK: http://www.pygtk.org
# .. _PyGObject: https://wiki.gnome.org/action/show/Projects/PyGObject
# .. _pycairo: https://www.cairographics.org/pycairo/
# .. _cairocffi: https://pythonhosted.org/cairocffi/
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.