summaryrefslogtreecommitdiff
path: root/gnuradio-examples/python/ofdm/gr_plot_ofdm.py
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-examples/python/ofdm/gr_plot_ofdm.py')
-rwxr-xr-xgnuradio-examples/python/ofdm/gr_plot_ofdm.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/gnuradio-examples/python/ofdm/gr_plot_ofdm.py b/gnuradio-examples/python/ofdm/gr_plot_ofdm.py
index e3b347189..b24855148 100755
--- a/gnuradio-examples/python/ofdm/gr_plot_ofdm.py
+++ b/gnuradio-examples/python/ofdm/gr_plot_ofdm.py
@@ -20,14 +20,24 @@
# Boston, MA 02110-1301, USA.
#
-import scipy, pylab, math
-import struct, sys
-from pylab import *
-from matplotlib.font_manager import fontManager, FontProperties
+import math, struct, sys
from optparse import OptionParser
-from scipy import fftpack
from math import log10
+try:
+ import scipy
+ from scipy import fftpack
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
+try:
+ from pylab import *
+ from matplotlib.font_manager import fontManager, FontProperties
+except ImportError:
+ print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+ sys.exit(1)
+
matplotlib.interactive(True)
matplotlib.use('TkAgg')