From fae94a9334a2a679a7cb58facf80955a814f9893 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Wed, 18 May 2011 06:58:04 -0400 Subject: [PATCH] Safeguard. --- survey/makestats | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/survey/makestats b/survey/makestats index af91aa1..68f605d 100755 --- a/survey/makestats +++ b/survey/makestats @@ -255,7 +255,8 @@ def mkpic_submissions_per_key(db, destdir, key, title, sortby='name', multiple=False): counts = db.get_counts(key) pl.figure(figsize=(6.4, (len(counts)-2) * 0.4 + 2)) - tmargin = .8/len(counts) + if not len(counts): tmargin = 0.4 + else: tmargin = .8/len(counts) if tmargin > 0.3: tmargin = 0.3 pl.subplots_adjust(left=0.03, right=0.97, top=1-tmargin, bottom=tmargin) pl.title(title) -- 2.39.5