Skip to content

Commit 50979e0

Browse files
committed
add missing factor
1 parent 8f9e9cf commit 50979e0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/py_eddy_tracker/observations/observation.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,7 @@ def scatter(self, ax, name, ref=None, factor=1, **kwargs):
13581358
:param matplotlib.axes.Axes ax: matplotlib axes use to draw
13591359
:param str name: var which will be use to fill contour
13601360
:param float,None ref: if define use like west bound
1361+
:param float factor: multiply value by
13611362
:param dict kwargs: look at :py:meth:`matplotlib.axes.Axes.scatter`
13621363
:return: scatter mappable
13631364
@@ -1377,24 +1378,27 @@ def filled(
13771378
lut=10,
13781379
vmin=None,
13791380
vmax=None,
1381+
factor=1,
13801382
**kwargs,
13811383
):
13821384
"""
13831385
:param matplotlib.axes.Axes ax: matplotlib axes use to draw
1384-
:param str varname: var which will be use to fill contour
1386+
:param str,array varname: var which will be use to fill contour, or an array of same size of obs
13851387
:param bool intern: if True draw speed contour instead of effective contour
13861388
:param str cmap: matplotlib colormap name
13871389
:param int,None lut: Number of division of colormaps
13881390
:param float,None vmin:
13891391
:param float,None vmax:
1392+
:param float factor: multiply value by
13901393
:return: Collection drawed
13911394
:rtype: matplotlib.collections.PolyCollection
13921395
13931396
.. minigallery:: py_eddy_tracker.EddiesObservations.filled
13941397
"""
13951398
cmap = get_cmap(cmap, lut)
13961399
x_name, y_name = self.intern(intern)
1397-
x, y, v = self[x_name], self[y_name], self[varname]
1400+
v = (self[varname] if isinstance(varname, str) else varname) * factor
1401+
x, y = self[x_name], self[y_name]
13981402
if vmin is None:
13991403
vmin = v.min()
14001404
if vmax is None:

0 commit comments

Comments
 (0)