Commit 61fe9b08 authored by Martin Reinecke's avatar Martin Reinecke

Merge branch 'addPlottingKwargs' into 'NIFTy_4'

Add plotting kwargs

See merge request ift/NIFTy!227
parents e110e7d5 f1895905
Pipeline #25680 passed with stages
in 5 minutes and 55 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 = [1.] * 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,8 @@ 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 +262,8 @@ 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