def __init__(self, img, **kwa): """ """ flexbase.__init__(self, **kwa) #arr = kwa.setdefault('arr', img) arr = kwa.get('arr', None) if arr is None: arr = img amin, amax = self._intensity_limits(arr, **kwa) self.hcolor = kwa.get('color', 'lightgreen') self.hbins = kwa.get('bins', 100) kwa.setdefault('w_in', 14) kwa.setdefault('h_in', 8) _fig = gr_figure(**kwa) kwfica = {} fymin, fymax = 0.04, 0.93 self.fig, self.axim, self.axcb, self.axhi = gr.fig_img_cbar_hist_axes(\ fig=_fig,\ win_axim = kwa.get('win_axim', (0.04, fymin, 0.71, fymax)),\ win_axhi = kwa.get('win_axhi', (0.76, fymin, 0.15, fymax)),\ win_axcb = kwa.get('win_axcb', (0.915, fymin, 0.01, fymax)), **kwfica) kwa.setdefault('amin', amin) kwa.setdefault('amax', amax) self.imsh, self.cbar = gr_imshow_cbar(self.fig, self.axim, self.axcb, img, **kwa) self.update_his(arr, **kwa) gr.draw_fig(self.fig)
def __init__(self, img, **kwa): """ """ flexbase.__init__(self, **kwa) arr = kwa.setdefault('arr', img) amin, amax = self._intensity_limits(arr, kwa) w_in = kwa.pop('w_in', 11) h_in = kwa.pop('h_in', 8) self.hcolor = kwa.get('color', 'lightgreen') self.hbins = kwa.get('bins', 100) #aspratio = float(img.shape[0])/img.shape[1] # heigh/width kwfig = {} _fig=gr.plt.figure(\ num = kwa.get('num',None),\ figsize = kwa.get('figsize',(w_in, h_in)),\ dpi = kwa.get('dpi',80),\ facecolor = kwa.get('facecolor','w'),\ edgecolor = kwa.get('edgecolor','w'),\ frameon = kwa.get('frameon',True),\ clear = kwa.get('clear',False),\ **kwfig) kwfica = {} fymin, fymax = 0.050, 0.90 self.fig, self.axim, self.axcb, self.axhi = gr.fig_img_cbar_hist_axes(\ fig=_fig,\ win_axim = kwa.get('win_axim', (0.02, fymin, 0.8, fymax)),\ win_axhi = kwa.get('win_axhi', (0.76, fymin, 0.15, fymax)),\ win_axcb = kwa.get('win_axcb', (0.915, fymin, 0.01, fymax)), **kwfica) kwic = { 'amin': amin, 'amax': amax, 'extent': kwa.get('extent', None), 'interpolation': kwa.get('interpolation', 'nearest'), 'aspect': kwa.get('aspect', 'equal'), 'origin': kwa.get('origin', 'upper'), 'orientation': kwa.get('orientation', 'vertical'), 'cmap': kwa.get('cmap', 'inferno'), } self.imsh, self.cbar = gr.imshow_cbar(self.fig, self.axim, self.axcb, img, **kwic) self.update_his(arr, **kwa) gr.draw_fig(self.fig)