import pydicom
import numpy as np
import matplotlib.pyplot as plt
import os
import csv
import math

x = []
y = []
c = []

a = []
b = []
c = []
d = []


first = True
with open("mimx.csv") as f:
  for row in csv.reader(f, delimiter=","):
    if first or len(row) < 9:
      first = False
      continue

    x.append(int(row[4]))
    y.append(int(row[6]))
    a.append(int(row[7]))
    b.append(int(row[8]))
    c.append(int(row[9]))
    d.append(int(row[10]))


def showHisto(items, n="?"):
  h = [0 for x in range(1 + max(items))]
  for i in items:
    h[i] += 1
  xs = list(range(len(h)))
  plt.plot(xs, [math.log(i + 1) for i in h], label=n)

#plt.scatter(x,y,c=c)

showHisto(a, "A")
showHisto(b, "B")
showHisto(c, "C")
showHisto(d, "D")
plt.show()
    
