From b0a759c4548b136678fb46f7f9a1ca32175a525e Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Sat, 20 Jul 2019 23:55:34 +0300 Subject: [PATCH] Add Seaborn to Matplotlib example --- examples/matplotlib_example.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/matplotlib_example.py b/examples/matplotlib_example.py index f918bed7..2398b250 100644 --- a/examples/matplotlib_example.py +++ b/examples/matplotlib_example.py @@ -1,7 +1,8 @@ -# TRAINS - Example of Matplotlib integration and reporting +# TRAINS - Example of Matplotlib and Seaborn integration and reporting # import numpy as np import matplotlib.pyplot as plt +import seaborn as sns from trains import Task @@ -33,4 +34,13 @@ plt.imshow(m) plt.title('Image Title') plt.show() -print('This is a Matplotlib example') +sns.set(style="darkgrid") +# Load an example dataset with long-form data +fmri = sns.load_dataset("fmri") +# Plot the responses for different events and regions +sns.lineplot(x="timepoint", y="signal", + hue="region", style="event", + data=fmri) +plt.show() + +print('This is a Matplotlib & Seaborn example')