From e183d76f20648d3f4a7542fd470f561a2fac0828 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Keck <Jean-Baptiste.Keck@imag.fr>
Date: Wed, 25 Sep 2019 14:08:10 +0200
Subject: [PATCH] fixed plot

---
 examples/taylor_green/taylor_green.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/examples/taylor_green/taylor_green.py b/examples/taylor_green/taylor_green.py
index 1e27a468b..8f2fb64af 100644
--- a/examples/taylor_green/taylor_green.py
+++ b/examples/taylor_green/taylor_green.py
@@ -200,8 +200,8 @@ def compute(args):
                 tag='hysop-{}'.format(snpts)
                 fig  = plt.figure(figsize=(30,18))
                 axe0 = plt.subplot2grid((3,2), (0,0), rowspan=3, colspan=1)
-                axe1 = plt.subplot2grid((3,2), (0,1), rowspan=2, colspan=1)
-                axe2 = plt.subplot2grid((3,2), (2,1), rowspan=1, colspan=1)
+                axe1 = plt.subplot2grid((3,2), (0,1), rowspan=2+args.fixed_timestep, colspan=1)
+                axe2 = plt.subplot2grid((3,2), (2,1), rowspan=1, colspan=1) if args.variable_timestep else None
                 axes = (axe0, axe1, axe2)
                 parameters={axe0:{tag:enstrophy}}
                 if args.variable_timestep:
@@ -245,12 +245,13 @@ def compute(args):
                 axe1.set_ylim(1e-4, 1e0)
                 axe1.set_yscale('log')
                 axe1.legend()
-                axe2.set_title('Equivalent CFL')
-                axe2.set_xlabel('Non-dimensional time', fontweight='bold')
-                axe2.set_ylabel('CFL*', fontweight='bold')
-                axe2.set_xlim(args.tstart, args.tend)
-                axe2.axhline(y=args.cfl, color='r', linestyle='--')
-                axe2.set_ylim(0., 1.1*args.cfl)
+                if axe2:
+                    axe2.set_title('Equivalent CFL')
+                    axe2.set_xlabel('Non-dimensional time', fontweight='bold')
+                    axe2.set_ylabel('CFL*', fontweight='bold')
+                    axe2.set_xlim(args.tstart, args.tend)
+                    axe2.axhline(y=args.cfl, color='r', linestyle='--')
+                    axe2.set_ylim(0., 1.1*args.cfl)
         plot = EnstrophyPlotter(update_frequency=args.plot_freq,
                                 visu_rank=args.visu_rank)
     else:
-- 
GitLab