From ead55f040749778f102112166d0e94a6b31233b9 Mon Sep 17 00:00:00 2001 From: kmazouzi Date: Fri, 3 Apr 2015 21:10:57 +0200 Subject: [PATCH] plot --- lab3/plot.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 lab3/plot.py diff --git a/lab3/plot.py b/lab3/plot.py new file mode 100755 index 0000000..09e9d81 --- /dev/null +++ b/lab3/plot.py @@ -0,0 +1,18 @@ +#!/usr/bin/python +#-*-coding:utf8-*- +from sys import argv +from pylab import * + +if __name__ == "__main__": + if len(argv) != 2: + print "Usage: python", argv[0], " matrix.dat" + exit (0) + + +f = open ( argv[1] , 'r') +A = [ map(float,line.split()) for line in f ] + +figure(1) +imshow(A, interpolation='nearest') +grid(True) +show() -- 1.7.10.4