Commit ecd8254d023be1f11bdb4d1d4bf86cc1ce622c39

Authored by Jürgen Knödlseder
1 parent d9b8269c

Check also opening of figure in matplotlib test

examples/make_spectrum.py
... ... @@ -23,6 +23,8 @@ import ctools
23 23 import cscripts
24 24 try:
25 25 import matplotlib.pyplot as plt
  26 + plt.figure()
  27 + plt.close()
26 28 has_matplotlib = True
27 29 except:
28 30 has_matplotlib = False
... ...
examples/show_butterfly.py
... ... @@ -22,6 +22,8 @@ import sys
22 22 import gammalib
23 23 try:
24 24 import matplotlib.pyplot as plt
  25 + plt.figure()
  26 + plt.close()
25 27 except:
26 28 print('This script needs the "matplotlib" module')
27 29 sys.exit()
... ...
examples/show_model.py
... ... @@ -23,6 +23,8 @@ import math
23 23 import gammalib
24 24 try:
25 25 import matplotlib.pyplot as plt
  26 + plt.figure()
  27 + plt.close()
26 28 except:
27 29 print('This script needs the "matplotlib" module')
28 30 sys.exit()
... ...
examples/show_pha.py
... ... @@ -23,6 +23,8 @@ import math
23 23 import gammalib
24 24 try:
25 25 import matplotlib.pyplot as plt
  26 + plt.figure()
  27 + plt.close()
26 28 except:
27 29 print('This script needs the "matplotlib" module')
28 30 sys.exit()
... ... @@ -68,7 +70,7 @@ def show_pha(pha, plotfile=''):
68 70 plt.semilogy(energy, counts, 'ro')
69 71 else:
70 72 plt.loglog(energy, counts, 'ro')
71   - plt.errorbar(energy, counts, error, fmt=None, ecolor='r')
  73 + plt.errorbar(energy, counts, error, fmt='none', ecolor='r')
72 74  
73 75 # Set axes
74 76 if channels:
... ...
examples/show_pull_evolution.py
... ... @@ -24,6 +24,8 @@ try:
24 24 import matplotlib.pyplot as plt
25 25 except:
26 26 print('This script needs the "matplotlib" module')
  27 + plt.figure()
  28 + plt.close()
27 29 sys.exit()
28 30 try:
29 31 import numpy as np
... ...
examples/show_pull_histogram.py
... ... @@ -23,6 +23,8 @@ import csv
23 23 try:
24 24 import matplotlib.pyplot as plt
25 25 import matplotlib.mlab as mlab
  26 + plt.figure()
  27 + plt.close()
26 28 except:
27 29 print('This script needs the "matplotlib" module')
28 30 sys.exit()
... ...