-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2015-2016, Exa Analytics Development Team | ||
# Distributed under the terms of the Apache License 2.0 | ||
import numpy as np | ||
from exa.test import UnitTester | ||
from exa.mpl import _gen_figure | ||
|
||
class TestGenFigure(UnitTester): | ||
"""Test matplotlib wrapper function. Needs work.""" | ||
|
||
def setUp(self): | ||
"""Make some figures.""" | ||
self.fig1 = _gen_figure(nxplot=1, nyplot=2, x=np.array([0, 1, 2]), | ||
nxlabel=5, nxdecimal=3, sharex=True, sharey=True) | ||
self.fig2 = _gen_figure(nxplot=2, nyplot=1, projection='3d') | ||
self.fig3 = _gen_figure(nxplot=1, nyplot=1, projection='polar') | ||
|
||
def test_2d_plot(self): | ||
"""Test shared axes.""" | ||
ax = self.fig1.get_axes()[0] | ||
self.assertTrue('_sharex' in ax.__dict__) | ||
self.assertTrue('_sharey' in ax.__dict__) | ||
|
||
def test_3d_plot(self): | ||
"""Test 3D axes.""" | ||
self.assertTrue(self.fig2.get_axes()[0].__dict__['_axis3don']) | ||
|
||
def test_polar_plot(self): | ||
"""Test polar axes.""" | ||
self.assertTrue('_theta_offset' in self.fig3.get_axes()[0].__dict__) | ||
## -*- coding: utf-8 -*- | ||
## Copyright (c) 2015-2016, Exa Analytics Development Team | ||
## Distributed under the terms of the Apache License 2.0 | ||
#import numpy as np | ||
#from exa.test import UnitTester | ||
#from exa.mpl import _gen_figure | ||
# | ||
#class TestGenFigure(UnitTester): | ||
# """Test matplotlib wrapper function. Needs work.""" | ||
# | ||
# def setUp(self): | ||
# """Make some figures.""" | ||
# self.fig1 = _gen_figure(nxplot=1, nyplot=2, x=np.array([0, 1, 2]), | ||
# nxlabel=5, nxdecimal=3, sharex=True, sharey=True) | ||
# self.fig2 = _gen_figure(nxplot=2, nyplot=1, projection='3d') | ||
# self.fig3 = _gen_figure(nxplot=1, nyplot=1, projection='polar') | ||
# | ||
# def test_2d_plot(self): | ||
# """Test shared axes.""" | ||
# ax = self.fig1.get_axes()[0] | ||
# self.assertTrue('_sharex' in ax.__dict__) | ||
# self.assertTrue('_sharey' in ax.__dict__) | ||
# | ||
# def test_3d_plot(self): | ||
# """Test 3D axes.""" | ||
# self.assertTrue(self.fig2.get_axes()[0].__dict__['_axis3don']) | ||
# | ||
# def test_polar_plot(self): | ||
# """Test polar axes.""" | ||
# self.assertTrue('_theta_offset' in self.fig3.get_axes()[0].__dict__) |