labours.py 413 B

123456789101112131415161718
  1. import sys
  2. import matplotlib.pyplot as pyplot
  3. import numpy
  4. import seaborn # to get nice colors, he-he
  5. def main():
  6. matrix = []
  7. for line in sys.stdin.read().split("\n")[:-1]:
  8. matrix.append(numpy.fromstring(line, dtype=int, sep=" "))
  9. matrix = numpy.array(matrix).T
  10. pyplot.stackplot(numpy.arange(matrix.shape[1]), matrix)
  11. pyplot.show()
  12. if __name__ == "__main__":
  13. sys.exit(main())