def __init__(self, x_seq, y_seq, *args, **kwargs): x_bins = kwargs.get('x_bins', 10) y_bins = kwargs.get('y_bins', 10) # First pass through data, find the range of values: bbox = kwargs.get('hist_bbox', find_bounding_box(x_seq, y_seq)) # bounding box needs stretching! self.img_bbox = bbox # Second pass trough the data to create the histogram. self.array = bin_data_2d(x_seq, y_seq, x_bins, y_bins, bbox) # Color code the data (on gray scale for now). # save the relevant information: self.gradient = kwargs.get('gradient', None)
def __init__(self, x_seq, y_seq, *args, **kwargs): x_bins = kwargs.get('x_bins', 10) y_bins = kwargs.get('y_bins', 10) # First pass through data, find the range of values: hist_bbox = kwargs.get('hist_bbox', find_bounding_box(x_seq, y_seq)) # Second pass trough the data to create the histogram. ar = bin_data_2d(x_seq, y_seq, x_bins, y_bins, hist_bbox) # Color code the data (on gray scale for now). max_val = numpy.amax(ar) min_val = 0 gradient = kwargs.get( 'gradient', RGBGradient((min_val, max_val), (0, 0, 1), (1, 0, 0))) colors = colorcode_ar_2d(ar, gradient) # save the relevant information: self.gradient = gradient self.encoded_png = colorcoded_ar_2d2png_string(colors) self.img_bbox = hist_bbox
def __init__(self, x_seq, y_seq, *args, **kwargs): x_bins = kwargs.get('x_bins', 10) y_bins = kwargs.get('y_bins', 10) # First pass through data, find the range of values: hist_bbox = kwargs.get('hist_bbox', find_bounding_box(x_seq, y_seq)) # Second pass trough the data to create the histogram. ar = bin_data_2d(x_seq, y_seq, x_bins, y_bins, hist_bbox) # Color code the data (on gray scale for now). max_val = numpy.amax(ar) min_val = 0 gradient = kwargs.get('gradient', RGBGradient((min_val, max_val), (0, 0, 1), (1, 0, 0))) colors = colorcode_ar_2d(ar, gradient) # save the relevant information: self.gradient = gradient self.encoded_png = colorcoded_ar_2d2png_string(colors) self.img_bbox = hist_bbox
def prepare_bbox(self, data_bbox): '''Update bounding box with the data for this scatter plot.''' return find_bounding_box(self.datapoints[0], self.datapoints[1], data_bbox)