

def preparePlot(shapeModeler):
    global sliders, mainPlot, fig
    (fig, ax) = plt.subplots()
    whiteSpace = (0.15 + (numParams * 0.05))
    plt.subplots_adjust(bottom=whiteSpace)
    plt.axis('equal')
    params = np.zeros((numParams, 1))
    shape = shapeModeler.makeShape(params)
    shape = ShapeModeler.normaliseShape(shape)
    numPointsInShape = (len(shape) / 2)
    x_shape = shape[0:numPointsInShape]
    y_shape = shape[numPointsInShape:]
    (mainPlot,) = plt.plot(x_shape, (- y_shape))
    plt.axis([(- 1), 1, (- 1), 1], autoscale_on=False, aspect='equal')
    parameterVariances = shapeModeler.getParameterVariances()
    sliders = ([0] * numParams)
    for i in range(numParams):
        slider = Slider(plt.axes([0.25, (0.1 + (0.05 * ((numParams - i) - 1))), 0.65, 0.03], axisbg=axcolor), ('Parameter ' + str((i + 1))), ((- 5) * parameterVariances[i]), (5 * parameterVariances[i]), valinit=0)
        slider.on_changed(update)
        sliders[i] = slider
    resetax = plt.axes([0.8, 0.025, 0.1, 0.04])
    button = Button(resetax, 'Reset', color=axcolor, hovercolor='0.975')
    button.on_clicked(reset)
    plt.show()

dataset/ETHPy150Open chili-epfl/shape_learning/scripts/shape_model_gui.py preparePlot/original