Skip to content

Commit d613a52

Browse files
authored
Add support for matplotlib 2 and 3 (#52)
* Try both two methods when setting the background color in matplotlib * Add matrix of tests for matplotlib versions * Remove verbal support for python version 3.3
1 parent d698c05 commit d613a52

7 files changed

Lines changed: 24 additions & 8 deletions

File tree

.travis.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,27 @@ dist: trusty
33
language: python
44
python:
55
- 2.7
6-
- 3.3
76
- 3.4
87
- 3.5
98
cache: pip
109
env:
1110
global:
1211
- CFLAGS="-coverage"
1312
- TRAVIS_TEST=true
13+
matrix:
14+
- MATPLOTLIB_VERSION=1.5.1
15+
- MATPLOTLIB_VERSION=2.2.3
16+
- MATPLOTLIB_VERSION=3.0.2
17+
matrix:
18+
exclude:
19+
- python: 2.7
20+
env: MATPLOTLIB_VERSION=3.0.2
21+
- python: 3.4
22+
env: MATPLOTLIB_VERSION=3.0.2
1423
install:
1524
- pip install --upgrade pip
1625
- pip install $(grep 'pytest' requirements.txt)
17-
- pip install coveralls coverage matplotlib==1.5.1
26+
- pip install coveralls coverage matplotlib==$MATPLOTLIB_VERSION
1827
- pip install -e .
1928
before_script:
2029
- "export DISPLAY=:99.0"

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Installation
3737
------------
3838

3939

40-
**Prerequisites:** Queueing-tool runs on Python 2.7 and 3.3-3.5 and it
40+
**Prerequisites:** Queueing-tool runs on Python 2.7 and 3.4-3.5 and it
4141
requires `networkx <http://networkx.readthedocs.org/en/stable/>`__ and
4242
`numpy <http://www.numpy.org/>`__. If you want to plot, you will need
4343
to install `matplotlib <http://matplotlib.org/>`__ as well.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.1
1+
1.2.2

queueing_tool/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import queueing_tool.graph as graph
1111

1212
__all__ = []
13-
__version__ = '1.2.1'
13+
__version__ = '1.2.2'
1414

1515
__all__.extend(['__version__'])
1616
__all__.extend(queues.__all__)

queueing_tool/graph/graph_wrapper.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,11 @@ def draw_graph(self, line_kwargs=None, scatter_kwargs=None, **kwargs):
411411
ax.add_collection(edge_collection)
412412
ax.scatter(**scatter_kwargs)
413413

414-
ax.set_axis_bgcolor(kwargs.get('bgcolor', [1, 1, 1, 1]))
414+
if hasattr(ax, 'set_facecolor'):
415+
ax.set_facecolor(kwargs.get('bgcolor', [1, 1, 1, 1]))
416+
else:
417+
ax.set_axis_bgcolor(kwargs.get('bgcolor', [1, 1, 1, 1]))
418+
415419
ax.get_xaxis().set_visible(False)
416420
ax.get_yaxis().set_visible(False)
417421

queueing_tool/network/queue_network.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,11 @@ def update(frame_number):
536536
scatt.set_edgecolors(scat_args['edgecolors'])
537537
scatt.set_facecolor(scat_args['c'])
538538

539-
ax.set_axis_bgcolor(kwargs['bgcolor'])
539+
if hasattr(ax, 'set_facecolor'):
540+
ax.set_facecolor(kwargs['bgcolor'])
541+
else:
542+
ax.set_axis_bgcolor(kwargs['bgcolor'])
543+
540544
ax.get_xaxis().set_visible(False)
541545
ax.get_yaxis().set_visible(False)
542546

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
'Programming Language :: Python :: 2',
4747
'Programming Language :: Python :: 2.7',
4848
'Programming Language :: Python :: 3',
49-
'Programming Language :: Python :: 3.3',
5049
'Programming Language :: Python :: 3.4',
5150
'Programming Language :: Python :: 3.5',
5251
'Programming Language :: Cython',

0 commit comments

Comments
 (0)