1
1
from __future__ import (absolute_import , division , print_function ,
2
2
unicode_literals )
3
3
4
- import six
5
-
6
4
import numpy as np
7
- from numpy import ma
8
- import matplotlib
9
5
from matplotlib import rc_context
10
6
from matplotlib .testing .decorators import image_comparison , cleanup
11
7
import matplotlib .pyplot as plt
12
- from matplotlib import rcParams
13
8
from matplotlib .colors import BoundaryNorm , LogNorm
14
9
from matplotlib .cm import get_cmap
15
- from matplotlib import cm
16
10
from matplotlib .colorbar import ColorbarBase
17
11
18
12
@@ -91,10 +85,10 @@ def _colorbar_extension_length(spacing):
91
85
cax .get_xticklines () + cax .get_yticklines ():
92
86
item .set_visible (False )
93
87
# Generate the colorbar.
94
- cb = ColorbarBase (cax , cmap = cmap , norm = norm ,
95
- boundaries = boundaries , values = values ,
96
- extend = extension_type , extendfrac = extendfrac ,
97
- orientation = 'horizontal' , spacing = spacing )
88
+ ColorbarBase (cax , cmap = cmap , norm = norm ,
89
+ boundaries = boundaries , values = values ,
90
+ extend = extension_type , extendfrac = extendfrac ,
91
+ orientation = 'horizontal' , spacing = spacing )
98
92
# Return the figure to the caller.
99
93
return fig
100
94
@@ -106,8 +100,8 @@ def _colorbar_extension_length(spacing):
106
100
def test_colorbar_extension_shape ():
107
101
'''Test rectangular colorbar extensions.'''
108
102
# Create figures for uniform and proportionally spaced colorbars.
109
- fig1 = _colorbar_extension_shape ('uniform' )
110
- fig2 = _colorbar_extension_shape ('proportional' )
103
+ _colorbar_extension_shape ('uniform' )
104
+ _colorbar_extension_shape ('proportional' )
111
105
112
106
113
107
@image_comparison (baseline_images = ['colorbar_extensions_uniform' ,
@@ -116,8 +110,8 @@ def test_colorbar_extension_shape():
116
110
def test_colorbar_extension_length ():
117
111
'''Test variable length colorbar extensions.'''
118
112
# Create figures for uniform and proportionally spaced colorbars.
119
- fig1 = _colorbar_extension_length ('uniform' )
120
- fig2 = _colorbar_extension_length ('proportional' )
113
+ _colorbar_extension_length ('uniform' )
114
+ _colorbar_extension_length ('proportional' )
121
115
122
116
123
117
@image_comparison (baseline_images = ['cbar_with_orientation' ,
@@ -332,8 +326,3 @@ def test_colorbar_lognorm_extension():
332
326
cb = ColorbarBase (ax , norm = LogNorm(vmin = 0.1 , vmax = 1000.0 ),
333
327
orientation = 'vertical' , extend = 'both' )
334
328
assert cb ._values [0 ] >= 0.0
335
-
336
-
337
- if __name__ == '__main__' :
338
- import nose
339
- nose .runmodule (argv = ['-s' , '--with-doctest' ], exit = False )
0 commit comments