# from http://pythonprogramming.net/3d-bar-charts-python-matplotlib/
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib import animation
import numpy as np
import pylab as pylab
import math as math
from decimal import *
from savedWeights import *
fig = plt.figure()
ax1 = fig.add_subplot(111, projection='3d')
colorNumber = -1
ypos = []
yposNeuronOrder = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
weights = retreiveTestW()
colors = []
neurons = [None]*len(weights)
numberOfWeights = len(weights)
numberOfPixels = 15
xpos = np.ones(numberOfPixels*numberOfWeights)
num_elements = len(xpos)
zpos = np.zeros(numberOfPixels*numberOfWeights)
dx = np.ones(numberOfPixels*numberOfWeights)*.9
dy = np.ones(numberOfPixels*numberOfWeights)*.5
timeDelay = 24#3
for weightIndex in range(numberOfWeights):
colorNumber += 1
if colorNumber == 4: colorNumber = 0
if colorNumber == 0: colors = np.append(colors, ['r']*15); neurons[weightIndex] = plt.Rectangle((0, 0), 0.1, 0.1,fc='r');
if colorNumber == 1: colors = np.append(colors, ['g']*15); neurons[weightIndex] = plt.Rectangle((0, 0), 0.1, 0.1,fc='g');
if colorNumber == 2: colors = np.append(colors, ['b']*15); neurons[weightIndex] = plt.Rectangle((0, 0), 0.1, 0.1,fc='b');
if colorNumber == 3: colors = np.append(colors, ['y']*15); neurons[weightIndex] = plt.Rectangle((0, 0), 0.1, 0.1,fc='y');
ypos = np.append(ypos, yposNeuronOrder)
xpos[(15*weightIndex):(15*(weightIndex+1))] *= (weightIndex+1)
colors = colors.tolist();ypos = ypos.tolist();xpos = xpos.tolist();