Bugfix in common.Util.plot_interval2
This commit is contained in:
parent
985e91f2ee
commit
99c36fc5e9
@ -265,7 +265,6 @@ def plot_interval2(intervals, data, **kwargs):
|
||||
:keyword typeonlegend:
|
||||
:keyword ls: matplotlib line style
|
||||
:keyword linewidth: matplotlib width
|
||||
:return: a list [lower, upper] with the minimum and maximum bounds of the intervals
|
||||
'''
|
||||
|
||||
l = len(intervals)
|
||||
@ -283,8 +282,6 @@ def plot_interval2(intervals, data, **kwargs):
|
||||
|
||||
lower = [kk[0] for kk in intervals]
|
||||
upper = [kk[1] for kk in intervals]
|
||||
mi = min(lower) * 0.95
|
||||
ma = max(upper) * 1.05
|
||||
|
||||
typeonlegend = kwargs.get('typeonlegend', False)
|
||||
color = kwargs.get('color', 'red')
|
||||
@ -296,8 +293,6 @@ def plot_interval2(intervals, data, **kwargs):
|
||||
if typeonlegend: label += " (Interval)"
|
||||
ax.plot(lower, color=color, label=label, ls=ls,linewidth=linewidth)
|
||||
ax.plot(upper, color=color, ls=ls,linewidth=linewidth)
|
||||
return [mi, ma]
|
||||
|
||||
|
||||
|
||||
def plot_rules(model, size=[5, 5], axis=None, rules_by_axis=None, columns=1):
|
||||
|
@ -39,7 +39,7 @@ distributions = model.predict(test[:10], type='distribution', steps_ahead=horizo
|
||||
fig, ax = plt.subplots(nrows=1, ncols=1,figsize=[15,5])
|
||||
|
||||
ax.plot(test[:10], label='Original',color='black')
|
||||
cUtil.plot_interval(ax, intervals, model.order, label='ensemble')
|
||||
cUtil.plot_interval2(intervals, test[:10], start_at=3, ax=ax)
|
||||
cUtil.plot_distribution2(distributions, test[:10], start_at=2, ax=ax, cmap="Blues")
|
||||
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user