diff --git a/examples/make_spectrum.py b/examples/make_spectrum.py index 3b99216..b258186 100755 --- a/examples/make_spectrum.py +++ b/examples/make_spectrum.py @@ -23,6 +23,8 @@ import ctools import cscripts try: import matplotlib.pyplot as plt + plt.figure() + plt.close() has_matplotlib = True except: has_matplotlib = False diff --git a/examples/show_butterfly.py b/examples/show_butterfly.py index 875afe5..1704df5 100755 --- a/examples/show_butterfly.py +++ b/examples/show_butterfly.py @@ -22,6 +22,8 @@ import sys import gammalib try: import matplotlib.pyplot as plt + plt.figure() + plt.close() except: print('This script needs the "matplotlib" module') sys.exit() diff --git a/examples/show_model.py b/examples/show_model.py index d92a6cc..d8e0792 100755 --- a/examples/show_model.py +++ b/examples/show_model.py @@ -23,6 +23,8 @@ import math import gammalib try: import matplotlib.pyplot as plt + plt.figure() + plt.close() except: print('This script needs the "matplotlib" module') sys.exit() diff --git a/examples/show_pha.py b/examples/show_pha.py index b68c14c..c770b66 100755 --- a/examples/show_pha.py +++ b/examples/show_pha.py @@ -23,6 +23,8 @@ import math import gammalib try: import matplotlib.pyplot as plt + plt.figure() + plt.close() except: print('This script needs the "matplotlib" module') sys.exit() @@ -68,7 +70,7 @@ def show_pha(pha, plotfile=''): plt.semilogy(energy, counts, 'ro') else: plt.loglog(energy, counts, 'ro') - plt.errorbar(energy, counts, error, fmt=None, ecolor='r') + plt.errorbar(energy, counts, error, fmt='none', ecolor='r') # Set axes if channels: diff --git a/examples/show_pull_evolution.py b/examples/show_pull_evolution.py index 22a47ec..8715dcd 100755 --- a/examples/show_pull_evolution.py +++ b/examples/show_pull_evolution.py @@ -24,6 +24,8 @@ try: import matplotlib.pyplot as plt except: print('This script needs the "matplotlib" module') + plt.figure() + plt.close() sys.exit() try: import numpy as np diff --git a/examples/show_pull_histogram.py b/examples/show_pull_histogram.py index 957cced..ccd2311 100755 --- a/examples/show_pull_histogram.py +++ b/examples/show_pull_histogram.py @@ -23,6 +23,8 @@ import csv try: import matplotlib.pyplot as plt import matplotlib.mlab as mlab + plt.figure() + plt.close() except: print('This script needs the "matplotlib" module') sys.exit()