@@ -179,7 +179,8 @@ class TestPlot1D(PlotTestCase):
179
179
180
180
def setUp (self ):
181
181
d = [0 , 1.1 , 0 , 2 ]
182
- self .darray = DataArray (d , coords = {'period' : range (len (d ))})
182
+ self .darray = DataArray (d , coords = {'period' : range (len (d ))},
183
+ dims = 'period' )
183
184
184
185
def test_xlabel_is_index_name (self ):
185
186
self .darray .plot ()
@@ -206,7 +207,8 @@ def test_can_pass_in_axis(self):
206
207
self .pass_in_axis (self .darray .plot .line )
207
208
208
209
def test_nonnumeric_index_raises_typeerror (self ):
209
- a = DataArray ([1 , 2 , 3 ], {'letter' : ['a' , 'b' , 'c' ]})
210
+ a = DataArray ([1 , 2 , 3 ], {'letter' : ['a' , 'b' , 'c' ]},
211
+ dims = 'letter' )
210
212
with self .assertRaisesRegexp (TypeError , r'[Pp]lot' ):
211
213
a .plot .line ()
212
214
@@ -1032,6 +1034,12 @@ def test_can_set_vmin_vmax(self):
1032
1034
clim = np .array (image .get_clim ())
1033
1035
self .assertTrue (np .allclose (expected , clim ))
1034
1036
1037
+ def test_can_set_norm (self ):
1038
+ norm = mpl .colors .SymLogNorm (0.1 )
1039
+ self .g .map_dataarray (xplt .imshow , 'x' , 'y' , norm = norm )
1040
+ for image in plt .gcf ().findobj (mpl .image .AxesImage ):
1041
+ self .assertIs (image .norm , norm )
1042
+
1035
1043
def test_figure_size (self ):
1036
1044
1037
1045
self .assertArrayEqual (self .g .fig .get_size_inches (), (10 , 3 ))
0 commit comments