Skip to content

Commit

Permalink
add kwargs to xarray
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjwilson committed Jun 6, 2023
1 parent ff34e0b commit 2c77ebb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ncplot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def in_notebook(out=None):
def view(x, vars=None, autoscale=True, out=None, **kwargs):
"""
Plot the contents of a NetCDF out
Parameters
-------------
x : object or str
Expand Down Expand Up @@ -214,6 +215,7 @@ def view(x, vars=None, autoscale=True, out=None, **kwargs):
try:
try:
import nctoolkit as nc
warnings.warn("Checking if nctoolkit is available")

if os.path.exists(x):
ds = nc.open_data(x)
Expand Down
8 changes: 4 additions & 4 deletions ncplot/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ class NCAccessor:
def __init__(self, xarray_obj):
self._obj = xarray_obj

def view(self, vars = None):
def view(self, vars = None, **kwargs):
"""Plot data """
return view(self._obj, vars)
return view(self._obj, vars, **kwargs)

@xr.register_dataarray_accessor('ncplot')
class NCAccessor:
def __init__(self, xarray_obj):
self._obj = xarray_obj

def view(self, vars = None):
def view(self, vars = None, **kwargs):
"""Plot data """
return view(self._obj, vars)
return view(self._obj, vars, **kwargs)

0 comments on commit 2c77ebb

Please sign in to comment.