Code Duplication    Length = 13-13 lines in 2 locations

mutis/astro.py 2 locations

@@ 329-341 (lines=13) @@
326
            x = knots_X[label][idx]
327
            y = knots_Y[label][idx]
328
329
            if lineas[i] is not None:
330
                if len(x) > 0:
331
                    lineas[i].set_xdata(x)
332
                    lineas[i].set_ydata(y)
333
                else:
334
                    lineas[i].remove()
335
                    lineas[i] = None
336
            else:
337
                if len(x) > 0:
338
                    if label == '' or label == 'None': # if it is unlabelled, do not connect it.
339
                        lineas[i] = ax.plot(x, y, '.', linewidth=0.8, alpha=0.5, label=label, color='black')[0]
340
                    else:
341
                        lineas[i] = ax.plot(x, y, '.-', linewidth=0.8, alpha=0.5, label=label)[0]
342
                
343
344
            if textos[i] is not None:
@@ 609-621 (lines=13) @@
606
        for i, label in enumerate(knots_names):   
607
            x, y = knots_jyears[label], knots_fluxes[label]
608
609
            if lineas[i] is not None:
610
                if len(x) > 0:
611
                    lineas[i].set_xdata(x)
612
                    lineas[i].set_ydata(y)
613
                else:
614
                    lineas[i].remove()
615
                    lineas[i] = None
616
            else:
617
                if len(x) > 0:
618
                    if label == '' or label == 'None': # if it is unlabelled, do not connect it.
619
                        lineas[i] = ax.plot(x, y, '.', linewidth=0.8, alpha=0.5, label=label, color='black')[0]
620
                    else:
621
                        lineas[i] = ax.plot(x, y, '.-', linewidth=0.8, alpha=0.5, label=label)[0]
622
        
623
            if textos[i] is not None:
624
                if len(x) > 0: