Beispiel #1
0
    def _process_configs(configs, w, h, equate_axes):
        defaults = {
            'plot':
            dict(),
            'subplot':
            dict(sharex=True, sharey=True, dpi=76, figsize=(9, 9)),
            'tight':
            dict(),
            'title':
            dict(weight='bold', fontsize=13, y=1.05),
            'annot':
            dict(fontsize=12,
                 weight='bold',
                 xy=(.90, .93),
                 xycoords='axes fraction'),
            'annot-nan':
            dict(fontsize=12,
                 weight='bold',
                 color='red',
                 xy=(.05, .63),
                 xycoords='axes fraction'),
            'save':
            dict(),
        }
        # deepcopy configs, and override defaults dicts or dict values
        kw = _kw_from_configs(configs, defaults)

        if not equate_axes:
            kw['subplot'].update({'sharex': False, 'sharey': False})
        size = kw['subplot']['figsize']
        kw['subplot']['figsize'] = (size[0] * w, size[1] * h)
        return kw
Beispiel #2
0
    def _process_configs(configs, w, h, tight, share_xy):
        def _set_share_xy(kw, share_xy):
            if isinstance(share_xy, (list, tuple)):
                sharex, sharey = share_xy
            else:
                sharex = sharey = share_xy
            if isinstance(sharex, int):
                sharex = bool(sharex)
            if isinstance(sharey, int):
                sharey = bool(sharey)
            kw['subplot']['sharex'] = sharex
            kw['subplot']['sharey'] = sharey

        defaults = {
            'plot': dict(),
            'subplot': dict(dpi=76, figsize=(10, 10)),
            'title': dict(weight='bold', fontsize=14, y=.93 + .12 * tight),
            'tight': dict(left=0, right=1, bottom=0, top=1, wspace=0,
                          hspace=0),
            'colorbar': dict(),
            'save': dict(),
        }
        # deepcopy configs, and override defaults dicts or dict values
        kw = _kw_from_configs(configs, defaults)

        _set_share_xy(kw, share_xy)
        size = kw['subplot']['figsize']
        kw['subplot']['figsize'] = (size[0] * w, size[1] * h)
        return kw
Beispiel #3
0
 def _process_configs(configs, w, h):
     defaults = {
         'plot': dict(s=15, linewidth=2),
         'title': dict(weight='bold', fontsize=14),
         'save': dict(),
     }
     # deepcopy configs, and override defaults dicts or dict values
     kw = _kw_from_configs(configs, defaults)
     return kw
Beispiel #4
0
    def _process_configs(configs, w, h):
        defaults = {
            'plot': dict(interpolation='nearest'),
            'plot-bias': dict(interpolation='nearest'),
            'subplot': dict(dpi=76, figsize=(14, 8)),
            'tight': dict(),
            'title': dict(weight='bold', fontsize=14, y=.98),
            'subtitle': dict(weight='bold', fontsize=14),
            'xlabel': dict(fontsize=12, weight='bold'),
            'ylabel': dict(fontsize=12, weight='bold'),
            'colorbar': dict(fraction=.03),
            'save': dict(),
        }
        # deepcopy configs, and override defaults dicts or dict values
        kw = _kw_from_configs(configs, defaults)

        size = kw['subplot']['figsize']
        kw['subplot']['figsize'] = (size[0] * w, size[1] * h)
        return kw
Beispiel #5
0
    def _process_configs(configs, w, h, share_xy):
        def _set_share_xy(kw, share_xy):
            if isinstance(share_xy, (list, tuple)):
                sharex, sharey = share_xy
            else:
                sharex = sharey = share_xy
            if isinstance(sharex, int):
                sharex = bool(sharex)
            if isinstance(sharey, int):
                sharey = bool(sharey)
            kw['subplot']['sharex'] = sharex
            kw['subplot']['sharey'] = sharey

        defaults = {
            'plot':
            dict(peaks_to_clip=0),
            'subplot':
            dict(dpi=76, figsize=(10, 10)),
            'title':
            dict(weight='bold', fontsize=15, y=1.06),
            'tight':
            dict(left=0, right=1, bottom=0, top=1, wspace=.05, hspace=.05),
            'colnames':
            dict(weight='bold', fontsize=14),
            'side_annot':
            dict(weight='bold',
                 fontsize=14,
                 xy=(1.02, .5),
                 xycoords='axes fraction'),
            'save':
            dict(),
        }
        # deepcopy configs, and override defaults dicts or dict values
        kw = _kw_from_configs(configs, defaults)

        _set_share_xy(kw, share_xy)
        size = kw['subplot']['figsize']
        kw['subplot']['figsize'] = (size[0] * w, size[1] * h)
        return kw