max_y = y if y > max_y else max_y min_y = y if y < min_y else min_y ci += 1 print("ymin", min_y, "ymax", max_y) used_value = set() for i in range(N): x = range(len(spec_fi)) value = data[fi][i] # categorical value spectrum = [float(data[j][i]) for j in spec_fi] print(value, spectrum) if case == 'derivative': x, spectrum = deriv(x, spectrum) if case == 'integral': x, spectrum = integ(x, spectrum) plt.plot( x, spectrum, # marker=markers[lookup[value]], color=colors()[lookup[value]], label=(value if value not in used_value else None)) used_value.add(value) # don't forget to put the spectra field labels on the bottom as ticks! #plt.legend() # loc='lower left') # upper right') plt.xticks(x, [fields[i] for i in spec_fi[0:len(x)]], rotation='vertical') plt.legend() plt.tight_layout() fn = args[1] + "_spectra_plot_" + (case if case != 'regular' else '') + '_' + field_label + ".png" print("+w", fn) plt.savefig(fn)
import requests import subprocess import argparse import sys from misc import redundant from misc import colors """Author: Joshua Whitaker""" """Twitter: @_Stahlz""" """Email: [email protected]""" """Initalizing Classes""" global initall initall = redundant() global colors initcolor = colors() """Misc Vars""" global write_output write_output = False global set_tor_reset_interval set_tor_reset_interval = 5 global tor_count tor_count = 0 art = (initcolor.OKGREEN + ' ▄▄▄██▀▀▀█████ ██████ ██░ ██ ▓█████ ██▓ ██▓ ' + initcolor.ENDC + '\n' + initcolor.OKGREEN + ' ▒██ ▒██▓ ██▒▒██ ▒ ▓██░ ██▒▓█ ▀ ▓██▒ ▓██▒ ' + initcolor.ENDC + '\n' + initcolor.OKGREEN + ' ░██ ▒██▒ ██░░ ▓██▄ ▒██▀▀██░▒███ ▒██░ ▒██░ ' + initcolor.ENDC + '\n' + initcolor.OKGREEN + '▓██▄██▓░██ █▀ ░ ▒ ██▒░▓█ ░██ ▒▓█ ▄ ▒██░ ▒██░ ' + initcolor.ENDC + '\n' + initcolor.OKGREEN +
'''20220227 this program calculates a concave-hull for a set of points in 2d''' import os import sys import copy import sha3 import pickle import fileinput import alphashape import numpy as np from misc import colors import matplotlib.pyplot as plt from descartes import PolygonPatch from misc import args, err c = colors() files = [x.strip() for x in os.popen('ls -1 *.pkl').readlines()] print(files) print('+w alpha_shape.png') fig, ax = plt.subplots() # plot init ci = 0 for fn in files: n = fn.split('.')[0] print(n, c[ci]) [X_bak, points, alpha, alpha_shape, patch_alpha] = pickle.load(open(fn, 'rb')) ax.scatter(*zip(*points), color=c[ci]) # plot inputs ax.add_patch( PolygonPatch(alpha_shape,