36. Label and widget refactor

Questions and discussion for this lecture live here. Fire away by hitting Reply below :fire:

Hi Sean, just wanted to suggest a tiny improvement.
When we plot axial force at each node, if we select both Fxi and Fxj for intermediate nodes (between 1 and 15 in the example), we get Fxj labels superimposed to Fxi labels. A simple solution could be to nest an if statement under the last elif

        if(labels == 'Fxi'):
            plt.text(xi+dx, yi+dy, label_i, fontsize = font_size, bbox = dict(facecolor='grey', alpha = 0.1))
        elif(labels == 'Fxj'):
            plt.text(xj+dx, yj+dy, label_j, fontsize = font_size, bbox = dict(facecolor='grey', alpha = 0.1))
        elif(labels == 'Fxi & Fxj'):
            plt.text(xi+dx, yi+dy, label_i, fontsize = font_size, bbox = dict(facecolor='grey', alpha = 0.1))
            if(n == len(members)-1):
                plt.text(xj+dx, yj+dy, label_j, fontsize = font_size, bbox = dict(facecolor='grey', alpha = 0.1))

Thanks @Oliviero - nice addition :+1:
Seán