https://github.com/thompsar/Venison
Revision c55221310da4c0fd9f7dcd8333fa1af83b3cfcac authored by Andrew Thompson on 08 July 2020, 19:20:21 UTC, committed by Andrew Thompson on 08 July 2020, 19:20:21 UTC
Gaussian modeling with gradient descent optimization implemented. Significant code cleanup, class encapsulation and UI bug fixes are needed.
1 parent 3655697
Tip revision: c55221310da4c0fd9f7dcd8333fa1af83b3cfcac authored by Andrew Thompson on 08 July 2020, 19:20:21 UTC
Gaussian Modeling
Gaussian Modeling
Tip revision: c552213
spec_plot.py
from bokeh.plotting import figure
from src.mycolors import mycolors
import numpy as np
from bokeh.palettes import Category10_10 as palette
import itertools
##Need to reimplement colorlist for certain uses? (post implementing pallete)
def spec_plot(xs,ys,colorlist=None,**kwargs):
golden=1.61803
height=400
#plot_width=int(height*golden)
if 'plot_height' not in kwargs:
kwargs['plot_height']= height
kwargs['plot_width']=int(height*golden)
if 'plot_width' not in kwargs:
kwargs['plot_width']=int(kwargs['plot_height']*golden)
myplot=figure(**kwargs)
myplot.outline_line_alpha=0
#Xaxis prefs
myplot.xgrid.grid_line_color = None
myplot.xaxis.axis_label="Evolution Time (μs)"
myplot.xaxis.axis_label_text_font='helvetica'
myplot.xaxis.axis_label_text_font_style='normal'
myplot.xaxis.axis_label_text_font_size='24pt'
myplot.xaxis.major_label_text_font='helvetica'
myplot.xaxis.major_label_text_font_size='16pt'
#Yaxis prefs
myplot.ygrid.grid_line_alpha = 0.5
myplot.ygrid.grid_line_dash = [6, 4]
myplot.yaxis.major_label_text_font='helvetica'
myplot.yaxis.major_label_text_font_size='16pt'
colors = itertools.cycle(palette)
if (type(xs) == list) & (type(ys) == list):
for i, color in zip(range(len(xs)),colors):
myplot.line(xs[i],ys[i],line_width = 1, color = color)
elif (type(xs) == np.ndarray) & (type(ys) == np.ndarray):
try:
for i, color in zip(range(xs.T.shape[1]),colors):
myplot.line(xs[i,:],ys[i,:],line_width = 1, color = color)
except IndexError:
myplot.line(xs,ys,line_width = 1, color = next(colors))
return myplot

Computing file changes ...