def positions(inputGame, panel, ignored=0):
    obj = BrasileiroGame(inputGame)
    players = obj.getPlayers()
    gameObj = obj.getGameStruct()
    panel.figure.clf()
    graphical = panel.figure.gca()

    len_gameRounds = obj.getNumberRounds()
    for player in players:
        x = list(range(1+ignored,len_gameRounds+1))
        y = []
        for index in range(0+ignored,len_gameRounds):
            round = obj.getRound(index+1)
            count = 0
            for item_tuple in round[1]:
                count = count + 1
                if item_tuple.playerCode == player:
                    y.append(count)
            pass
        graphical.plot(x,y,'o-',lineWidth=2)
        #print(player,y,"<----")

    graphical.set_yticks(list(range(0,len(players)+1)))
    graphical.set_ylabel("Position")
    graphical.set_xlabel("Round")
    graphical.invert_yaxis()
    panel.draw()
def points(inputGame, panel, ignored=0):
    obj = BrasileiroGame(inputGame)
    players = obj.getPlayers()
    gameObj = obj.getGameStruct()
    panel.figure.clf()
    graphical = panel.figure.gca()

    len_gameRounds = obj.getNumberRounds()
    for player in players:
        x = list(range(1+ignored,len_gameRounds+1))
        y = []
        for index in range(0+ignored,len_gameRounds):
            round = obj.getRound(index+1)
            for item_tuple in round[1]:
                if item_tuple.playerCode == player:
                    y.append(item_tuple.totalScore)
            pass
        graphical.plot(x,y,'o-',lineWidth=2)
        #print(player,y,"<----")
    graphical.set_ylabel('Points')
    graphical.set_xlabel('Round')
    panel.draw()
 wb = Workbook()
 planilha = wb.active
 planilha.append(['ano','Drama by Path', 'Drama by Points', 'Drama by position'])
 games = Game.retrieveList()
 for game in games:
     genGame = BrasileiroGame(game)
     
     dramaPath = DramaByPaths(game=genGame, ignored=0).getMeasureValue() 
     dramaPoints = DramaByPointsUp2First(game=genGame, ignored=0, normScores=True).getMeasureValue()
     dramaPosition = DramaByPositionUp2First(game=genGame, ignored=0).getMeasureValue()
     planilha.append([game.year, dramaPath, dramaPoints, dramaPosition])
     
     
     winner = genGame.getWinner()
     nPlayers = len(genGame.getPlayers())
     nRounds = genGame.getNumberRounds()
     winnerPath = []
     for i in range(1, nRounds + 1):
         gameRound = genGame.getRound(i)[1]
         for r in gameRound:
             if r.playerCode == winner:
                 winnerPath.append(gameRound.index(r)+1)
                 break
     plt.figure(game.year)
     plt.plot(np.arange(1,nRounds+1), winnerPath, '-b', linewidth=1.5)
     plt.xlim(1,nRounds)
     plt.ylim(0, nPlayers)
     plt.yticks(np.arange(1, nPlayers, 3))
     plt.gca().invert_yaxis()
     plt.gca().set_title(str(game.year))
     fString = '{0:.4f}'