Commit 1bd24498 authored by Philipp Arras's avatar Philipp Arras

Add kwargs

parent e110e7d5
Pipeline #25643 passed with stage
in 5 minutes and 39 seconds
......@@ -198,6 +198,18 @@ def plot(f, **kwargs):
if not isinstance(label, list):
label = [label]
linewidth = _get_kw("linewidth", None, **kwargs)
if linewidth is None:
linewidth = [None] * len(f)
if not isinstance(linewidth, list):
linewidth = [linewidth]
alpha = _get_kw("alpha", None, **kwargs)
if alpha is None:
alpha = [None] * len(f)
if not isinstance(alpha, list):
alpha = [alpha]
dom = dom[0]
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
......@@ -216,7 +228,7 @@ def plot(f, **kwargs):
xcoord = np.arange(npoints, dtype=np.float64)*dist
for i, fld in enumerate(f):
ycoord = fld.to_global_data()
plt.plot(xcoord, ycoord, label=label[i])
plt.plot(xcoord, ycoord, label=label[i], linewidth=linewidth[i], alpha=alpha[i])
_limit_xy(**kwargs)
if label != ([None]*len(f)):
plt.legend()
......@@ -249,7 +261,7 @@ def plot(f, **kwargs):
xcoord = dom.k_lengths
for i, fld in enumerate(f):
ycoord = fld.to_global_data()
plt.plot(xcoord, ycoord, label=label[i])
plt.plot(xcoord, ycoord, label=label[i], linewidth=linewidth[i], alpha=alpha[i])
_limit_xy(**kwargs)
if label != ([None]*len(f)):
plt.legend()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment