Merge branch 'master' of https://github.com/PYFTS/pyFTS
This commit is contained in:
commit
e2438afee3
@ -7,7 +7,7 @@ from pyFTS.common import Membership, Util
|
|||||||
|
|
||||||
|
|
||||||
def plot_sets(partitioner, start=0, end=10, step=1, tam=[5, 5], colors=None,
|
def plot_sets(partitioner, start=0, end=10, step=1, tam=[5, 5], colors=None,
|
||||||
save=False, file=None, axes=None, data=None, window_size = 1, only_lines=False):
|
save=False, file=None, axes=None, data=None, window_size = 1, only_lines=False, legend=True):
|
||||||
|
|
||||||
range = np.arange(start,end,step)
|
range = np.arange(start,end,step)
|
||||||
ticks = []
|
ticks = []
|
||||||
@ -43,14 +43,15 @@ def plot_sets(partitioner, start=0, end=10, step=1, tam=[5, 5], colors=None,
|
|||||||
axes.set_xlabel("Time")
|
axes.set_xlabel("Time")
|
||||||
plt.xticks([k for k in range], ticks, rotation='vertical')
|
plt.xticks([k for k in range], ticks, rotation='vertical')
|
||||||
|
|
||||||
|
if legend:
|
||||||
handles0, labels0 = axes.get_legend_handles_labels()
|
handles0, labels0 = axes.get_legend_handles_labels()
|
||||||
lgd = axes.legend(handles0, labels0, loc=2, bbox_to_anchor=(1, 1))
|
lgd = axes.legend(handles0, labels0, loc=2, bbox_to_anchor=(1, 1))
|
||||||
|
|
||||||
if data is not None:
|
if data is not None:
|
||||||
axes.plot(np.arange(start, start + len(data), 1), data,c="black")
|
axes.plot(np.arange(start, start + len(data), 1), data,c="black")
|
||||||
|
|
||||||
|
if file is not None:
|
||||||
plt.tight_layout()
|
plt.tight_layout()
|
||||||
|
|
||||||
Util.show_and_save_image(fig, file, save)
|
Util.show_and_save_image(fig, file, save)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user