function [change_potency_by_minute,sd_ratio_diff_times]=plot_cp_chargepot_v_sd_ratio_diff_times%(sd_ratio_diff_times)
%called directly from command prompt
close all

successes=[1     5     8    10    12    14     15     25    26    30];
confidences=[76.1 100 100 99.2 98.8 100 99.7 72.8 99.9 67.8];
change_charge_potency=[-9 14 9 7 18 35 17 22 12 35];   %these are in terms of trials
minutes_per_trial_each_case =[0.7792    0.7500    0.5833    0.5667    0.7500    0.6923    0.7000    0.7500    0.7500  0.7500];
sd_ratio_diff_times =[0   12.0000    3.4998    6.8004   21.0000   14.5383   18.2000         0   15.0000    5.2500];  %calculated with 15 minute window for best start spot (find_greatest_n_consecutive_vals) from analyze_sd_over_time
clr=colormap(hsv(10));
markersize=15

figure(1),hold on
alaa=1./minutes_per_trial_each_case
change_potency_by_minute=change_charge_potency.*(1./(minutes_per_trial_each_case));
fittable_cases=[2 3 4 5 7 9]

z=change_potency_by_minute(fittable_cases)
x=sd_ratio_diff_times(fittable_cases)

for ind=fittable_cases
    plot(change_potency_by_minute(ind),sd_ratio_diff_times(ind),'o','markerfacecolor',clr(ind,:),'markeredgecolor',clr(ind,:),'markersize',markersize)
    text(change_potency_by_minute(ind),sd_ratio_diff_times(ind),num2str(successes(ind)))
end

p=polyfit(sd_ratio_diff_times(fittable_cases),change_potency_by_minute(fittable_cases),1)
%p=polyfit(sd_ratio_diff_times(fittable_cases),change_potency_by_minute(fittable_cases)-10.7190,1)
%plot([p(2) change_potency_by_minute(5)],[0 p(2)+p(1)*sd_ratio_diff_times(5)],'color','k','linewidth',.1)
%plot([7 7+change_potency_by_minute(5)],[0 change_potency_by_minute(5)])