function [x_for_ecdf,y_for_ecdf]=cumulative_histogram(values_of_interest,clr)
%description: like the name says
%called by: analyze_release_dependence, analyze_history_dependence, analyze_sd_over_time, change_point_data_plotter, latency_summarizer,
%simple_sd_solutions(deprecated), change_point_data_plotter, and several other deprecated functions 
%calls: [no custom functions]
%notes:
%code confirmed date: oct 9,2009

values_of_interest(isnan(values_of_interest))=[];
if ~isempty(values_of_interest)
	y_holder=[];
	for ind=1:length(values_of_interest)
         y_holder(ind)=length(find(values_of_interest<=values_of_interest(ind)))/length(values_of_interest);
    end
    x_for_ecdf=sort(values_of_interest);
    y_for_ecdf=sort(y_holder);
	stairs(x_for_ecdf,y_for_ecdf,clr)   %may need to add a zero and a one at the two ends of this to make the plot correct, but it won't affect calculation of k-s statistic
	%xlim([0 max(values_of_interest)])
    ylim([0 1])
else
    x_for_ecdf=nan,y_for_ecdf=nan;
end