File tree 1 file changed +18
-1
lines changed 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -94,9 +94,26 @@ def setUp(self):
94
94
def test1d (self ):
95
95
self .darray [:, 0 , 0 ].plot ()
96
96
97
- def test2dline (self ):
97
+ def test_2d_line (self ):
98
98
self .darray [:, :, 0 ].plot .line ()
99
99
100
+ def test_2d_line_accepts_legend_kw (self ):
101
+ self .darray [:, :, 0 ].plot .line (add_legend = False )
102
+ self .assertFalse (plt .gca ().get_legend ())
103
+ plt .cla ()
104
+ self .darray [:, :, 0 ].plot .line (add_legend = True )
105
+ self .assertTrue (plt .gca ().get_legend ())
106
+ # check whether legend title is set
107
+ self .assertTrue (plt .gca ().get_legend ().get_title ().get_text ()
108
+ == 'dim_0' )
109
+
110
+ def test_2d_line_accepts_x_kw (self ):
111
+ self .darray [:, :, 0 ].plot .line (x = 'dim_0' )
112
+ self .assertTrue (plt .gca ().get_xlabel () == 'dim_0' )
113
+ plt .cla ()
114
+ self .darray [:, :, 0 ].plot .line (x = 'dim_1' )
115
+ self .assertTrue (plt .gca ().get_xlabel () == 'dim_1' )
116
+
100
117
def test_2d_before_squeeze (self ):
101
118
a = DataArray (easy_array ((1 , 5 )))
102
119
a .plot ()
You can’t perform that action at this time.
0 commit comments