コード例 #1
0
ファイル: newhist2d.py プロジェクト: tcoenen/brp
 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)
コード例 #2
0
ファイル: newhist2d.py プロジェクト: tcoenen/brp
 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)
コード例 #3
0
ファイル: histogram2d.py プロジェクト: tcoenen/brp
 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
コード例 #4
0
ファイル: histogram2d.py プロジェクト: tcoenen/brp
 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
コード例 #5
0
ファイル: scatter.py プロジェクト: tcoenen/brp
 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)
コード例 #6
0
ファイル: scatter.py プロジェクト: tcoenen/brp
 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)