Skip to content
Snippets Groups Projects
Commit 35dcd635 authored by Jean-Luc Parouty's avatar Jean-Luc Parouty
Browse files

Update SYNOP and pwk

parent e2db673c
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -30,7 +30,7 @@ import matplotlib.pyplot as plt
import seaborn as sn #IDRIS : module en cours d'installation
from IPython.display import display,Image,Markdown,HTML
VERSION='0.4.4'
VERSION='0.5.0'
_save_figs = False
_figs_dir = './figs'
......@@ -382,6 +382,39 @@ def plot_donut(values, labels, colors=["lightsteelblue","coral"], figsize=(6,6),
save_fig(save_as)
plt.show()
def plot_multivariate_serie(sequence, labels=None, prediction=None, only_features=None,
columns=3, width=5,height=4,wspace=0.3,hspace=0.2,
save_as='auto'):
sequence_len = len(sequence)
features_len = sequence.shape[1]
if only_features is None : only_features=range(features_len)
if labels is None : labels=range(features_len)
t=np.arange(sequence_len)
rows = math.ceil(features_len/columns)
fig = plt.figure(figsize=(columns*width, rows*height))
fig.subplots_adjust(wspace=0.3,hspace=0.2)
n=1
for i in only_features:
ax=fig.add_subplot(rows, columns, n)
ax.plot(t, sequence[:,i], '-', linewidth=1, color='steelblue', label=labels[i])
ax.plot(t, sequence[:,i], 'o', markersize=4, color='steelblue')
ax.plot(t[-1], sequence[-1:,i], 'o', fillstyle='full', markersize=8, color='steelblue')
if prediction is not None:
ax.plot(t[-1], [prediction[0][i]], 'o', fillstyle='full', markersize=8, color='red')
ax.legend(loc="upper left")
n+=1
save_fig(save_as)
plt.show()
def set_save_fig(save=True, figs_dir='./figs', figs_name='fig_', figs_id=0):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment