def Plot_line(arrays, color_name, theme, canvas, line_style, file_path): global plotted if arrays: plu.plot_line(arrays, color_name, 'X-axis', 'Y-axis', theme, True, line_style, file_path) image = Image.open(".temp/generated_plot.png").resize( (canvas.winfo_width(), canvas.winfo_height())) gif1 = ImageTk.PhotoImage(image, Image.ANTIALIAS) canvas.create_image(0, 0, image=gif1, anchor=NW) canvas.gif1 = gif1 plotted = True else: canvas.delete(ALL) sys.stdout.flush()
xpoints = list(map(float, options.xpoints[1:-1].split(','))) discrete = True else: if options.xstart: xstart = int(options.xstart) else: xstart = 0 if options.xend: xend = int(options.xend) else: xend = 100 if options.stepsize: stepsize = int(options.stepsize) else: stepsize = 1 xpoints = range(xstart, xend + 1, stepsize) discrete = False plu.plot(func, xpoints, color, xlabel, ylabel, theme, False, line_style, file_path, discrete) else: # No function, hence try to take points for line xypoints = options.line plu.plot_line(xypoints, color, xlabel, ylabel, theme, False, line_style, file_paths) # Visualise using matplotlib
with the option xpoints") elif options.xpoints: xpoints = list(map(float, options.xpoints[1:-1].split(','))) discrete = True else: if options.xstart: xstart = int(options.xstart) else: xstart = 0 if options.xend: xend = int(options.xend) else: xend = 100 if options.stepsize: stepsize = int(options.stepsize) else: stepsize = 1 xpoints = range(xstart, xend + 1, stepsize) discrete = False plu.plot(func, xpoints, color, xlabel, ylabel, theme, False, discrete) else: # No function, hence try to take points for line xypoints = options.line plu.plot_line(xypoints, color, xlabel, ylabel, theme, False) # Visualise using matplotlib