in plotting.py [0:0]
def line_plot(
Y, X, xlabel=None, ylabel=None, ymax=None, ymin=None,
xmax=None, xmin=None, filename=None, legend=None, errors=None,
xlog=False, ylog=False, size=None, marker="s"):
colors = sns.cubehelix_palette(Y.shape[0], start=2, rot=0, dark=0, light=.5)
plt.clf()
if legend is None:
legend = [None] * Y.shape[0]
if size is not None:
plt.figure(figsize=size)
for n in range(Y.shape[0]):
x = X[n, :] if X.ndim == 2 else X
plt.plot(x, Y[n, :], label=legend[n], color=colors[n],
marker=marker, markersize=5)
if errors is not None:
plt.fill_between(
x, Y[n, :] - errors[n, :], Y[n, :] + errors[n, :],
alpha=0.1, color=colors[n])
if ymax is not None:
plt.ylim(top=ymax)
if ymin is not None:
plt.ylim(bottom=ymin)
if xmax is not None:
plt.xlim(right=xmax)
if xmin is not None:
plt.xlim(left=xmin)
plt.xlabel(xlabel)
plt.ylabel(ylabel)
if legend[0] is not None:
plt.legend()
axes = plt.gca()
if xlog:
axes.semilogx(10.)
if ylog:
axes.semilogy(10.)
if filename is not None:
savefig(filename)