11import matplotlib .pyplot as plt
22import numpy as np
33import numpy .ma as ma
4+
45from pandas import Series
56
67
@@ -17,9 +18,7 @@ def pointwise(x):
1718 if x < xs [0 ]:
1819 return ys [0 ] + (x - xs [0 ]) * (ys [1 ] - ys [0 ]) / (xs [1 ] - xs [0 ])
1920 elif x > xs [- 1 ]:
20- return ys [- 1 ] + (x - xs [- 1 ]) * (ys [- 1 ] - ys [- 2 ]) / (
21- xs [- 1 ] - xs [- 2 ]
22- )
21+ return ys [- 1 ] + (x - xs [- 1 ]) * (ys [- 1 ] - ys [- 2 ]) / (xs [- 1 ] - xs [- 2 ])
2322 else :
2423 return interpolator (x )
2524
@@ -143,9 +142,7 @@ def gen_topomask(h, lon, lat, dx=1.0, kind="linear", plot=False):
143142def plot_section (self , reverse = False , filled = False , ** kw ):
144143 import gsw
145144
146- lon , lat , data = list (
147- map (np .asanyarray , (self .lon , self .lat , self .values ))
148- )
145+ lon , lat , data = list (map (np .asanyarray , (self .lon , self .lat , self .values )))
149146 data = ma .masked_invalid (data )
150147 h = self .get_maxdepth ()
151148 if reverse :
@@ -167,8 +164,7 @@ def plot_section(self, reverse=False, filled=False, **kw):
167164 labelsize = kw .pop ("labelsize" , 11 )
168165 cmap = kw .pop ("cmap" , plt .cm .rainbow )
169166 levels = kw .pop (
170- "levels" ,
171- np .arange (np .floor (data .min ()), np .ceil (data .max ()) + 0.5 , 0.5 ),
167+ "levels" , np .arange (np .floor (data .min ()), np .ceil (data .max ()) + 0.5 , 0.5 ),
172168 )
173169
174170 # Colorbar key words.
@@ -218,14 +214,7 @@ def plot_section(self, reverse=False, filled=False, **kw):
218214
219215 # Color version.
220216 cs = ax .contourf (
221- x ,
222- z ,
223- data ,
224- cmap = cmap ,
225- levels = levels ,
226- alpha = 1.0 ,
227- extend = extend ,
228- zorder = 2 ,
217+ x , z , data , cmap = cmap , levels = levels , alpha = 1.0 , extend = extend , zorder = 2 ,
229218 ) # manual=True
230219 # Colorbar.
231220 cb = fig .colorbar (
0 commit comments