Skip to content
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
2 changes: 1 addition & 1 deletion INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ optional Matplotlib backends and the capabilities they provide.
`PySide <https://pypi.python.org/pypi/PySide>`_: for the Qt4Agg backend;
* `PyQt5 <https://pypi.python.org/pypi/PyQt5>`_: for the Qt5Agg backend;
* :term:`pygtk` (>= 2.4): for the GTK and the GTKAgg backend;
* :term:`wxpython` (>= 2.8 or later): for the WX or WXAgg backend;
* :term:`wxpython` (>= 2.9 or later): for the WX or WXAgg backend;
* `pycairo <https://pypi.python.org/pypi/pycairo>`_: for GTK3Cairo;
* `Tornado <https://pypi.python.org/pypi/tornado>`_: for the WebAgg backend.

Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ class ToolBar(object):
class Frame(object):
pass

VERSION_STRING = '2.8.12'
VERSION_STRING = '2.9'


class MyPyQt4(MagicMock):
Expand Down
2 changes: 1 addition & 1 deletion examples/user_interfaces/README.wx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
You have a few different options available to you for embedding
matplotlib in a wxPython application
matplotlib in a wxPython application

1. Embed one of the wxPython backend widgets (which subclass wx.Panel)
directly and draw plots on it using matplotlib's object-oriented
Expand Down
15 changes: 2 additions & 13 deletions examples/user_interfaces/embedding_in_wx2_sgskip.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,14 @@
Embedding In Wx2
================

An example of how to use wx or wxagg in an application with the new
toolbar - comment out the setA_toolbar line for no toolbar
An example of how to use wxagg in an application with the new
toolbar - comment out the add_toolbar line for no toolbar
"""

# Matplotlib requires wxPython 2.8+
# set the wxPython version in lib\site-packages\wx.pth file
# or if you have wxversion installed un-comment the lines below
#import wxversion
#wxversion.ensureMinimal('2.8')

from numpy import arange, sin, pi

import matplotlib

# uncomment the following to use wx rather than wxagg
#matplotlib.use('WX')
#from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas

# comment out the following to use wx rather than wxagg
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas

Expand Down
8 changes: 1 addition & 7 deletions examples/user_interfaces/embedding_in_wx3_sgskip.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,9 @@
This was derived from embedding_in_wx and dynamic_image_wxagg.

Thanks to matplotlib and wx teams for creating such great software!

"""
from __future__ import print_function

# matplotlib requires wxPython 2.8+
# set the wxPython version in lib\site-packages\wx.pth file
# or if you have wxversion installed un-comment the lines below
#import wxversion
#wxversion.ensureMinimal('2.8')
from __future__ import print_function

import sys
import time
Expand Down
6 changes: 0 additions & 6 deletions examples/user_interfaces/embedding_in_wx4_sgskip.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
toolbar
"""

# matplotlib requires wxPython 2.8+
# set the wxPython version in lib\site-packages\wx.pth file
# or if you have wxversion installed un-comment the lines below
#import wxversion
#wxversion.ensureMinimal('2.8')

from numpy import arange, sin, pi

import matplotlib
Expand Down
5 changes: 0 additions & 5 deletions examples/user_interfaces/embedding_in_wx5_sgskip.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
Embedding In Wx5
================

Matplotlib requires wxPython 2.8+
set the wxPython version in lib\site-packages\wx.pth file
or if you have wxversion installed un-comment the lines below
import wxversion
wxversion.ensureMinimal('2.8')
"""

import wx
Expand Down
7 changes: 1 addition & 6 deletions examples/user_interfaces/fourier_demo_wx_sgskip.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
===============

"""
import numpy as np

# matplotlib requires wxPython 2.8+
# set the wxPython version in lib\site-packages\wx.pth file
# or if you have wxversion installed un-comment the lines below
#import wxversion
#wxversion.ensureMinimal('2.8')
import numpy as np

import wx
import matplotlib
Expand Down
5 changes: 0 additions & 5 deletions examples/user_interfaces/wxcursor_demo_sgskip.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@

Example to draw a cursor and report the data coords in wx
"""
# matplotlib requires wxPython 2.8+
# set the wxPython version in lib\site-packages\wx.pth file
# or if you have wxversion installed un-comment the lines below
#import wxversion
#wxversion.ensureMinimal('2.8')

import matplotlib
matplotlib.use('WXAgg')
Expand Down
9 changes: 2 additions & 7 deletions lib/matplotlib/backends/backend_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,13 +684,8 @@ def do_nothing(*args, **kwargs):
self.Bind(wx.EVT_MOUSE_CAPTURE_CHANGED, self._onCaptureLost)
self.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self._onCaptureLost)

if wx.VERSION_STRING < "2.9":
# only needed in 2.8 to reduce flicker
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
self.Bind(wx.EVT_ERASE_BACKGROUND, self._onEraseBackground)
else:
# this does the same in 2.9+
self.SetBackgroundStyle(wx.BG_STYLE_PAINT)
# Reduce flicker.
self.SetBackgroundStyle(wx.BG_STYLE_PAINT)

self.macros = {} # dict from wx id to seq of macros

Expand Down
5 changes: 2 additions & 3 deletions lib/matplotlib/backends/wx_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import six
from distutils.version import LooseVersion

missingwx = "Matplotlib backend_wx and backend_wxagg require wxPython >=2.8.12"
missingwx = "Matplotlib backend_wx and backend_wxagg require wxPython>=2.9"


try:
Expand All @@ -24,8 +24,7 @@
raise ImportError(missingwx)

# Ensure we have the correct version imported
if LooseVersion(wx.VERSION_STRING) < LooseVersion("2.8.12"):
print(" wxPython version %s was imported." % backend_version)
if LooseVersion(wx.VERSION_STRING) < LooseVersion("2.9"):
raise ImportError(missingwx)

if is_phoenix:
Expand Down
10 changes: 3 additions & 7 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@ def check_requirements(self):
_wx_ensure_failed = wxversion.VersionError

try:
wxversion.ensureMinimal('2.8')
wxversion.ensureMinimal('2.9')
except _wx_ensure_failed:
pass

Expand All @@ -1817,13 +1817,9 @@ def check_requirements(self):
except ImportError:
raise CheckFailed("requires wxPython")

# Extra version check in case wxversion lacks AlreadyImportedError;
# then VersionError might have been raised and ignored when
# there really *is* a problem with the version.
major, minor = [int(n) for n in backend_version.split('.')[:2]]
if major < 2 or (major < 3 and minor < 8):
if not is_min_version(backend_version, "2.9"):
raise CheckFailed(
"Requires wxPython 2.8, found %s" % backend_version)
"Requires wxPython 2.9, found %s" % backend_version)

return "version %s" % backend_version

Expand Down