当前位置: 首页>>代码示例>>Python>>正文


Python pyplot.hexbin方法代码示例

本文整理汇总了Python中matplotlib.pyplot.hexbin方法的典型用法代码示例。如果您正苦于以下问题:Python pyplot.hexbin方法的具体用法?Python pyplot.hexbin怎么用?Python pyplot.hexbin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.pyplot的用法示例。


在下文中一共展示了pyplot.hexbin方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: plot_pixels

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import hexbin [as 别名]
def plot_pixels(file_name, candidate_data_single_band,
                reference_data_single_band, limits=None, fit_line=None):

    logging.info('Display: Creating pixel plot - {}'.format(file_name))
    fig = plt.figure()
    plt.hexbin(
        candidate_data_single_band, reference_data_single_band, mincnt=1)
    if not limits:
        min_value = 0
        _, ymax = plt.gca().get_ylim()
        _, xmax = plt.gca().get_xlim()
        max_value = max([ymax, xmax])
        limits = [min_value, max_value]
    plt.plot(limits, limits, 'k-')
    if fit_line:
        start = limits[0] * fit_line.gain + fit_line.offset
        end = limits[1] * fit_line.gain + fit_line.offset
        plt.plot(limits, [start, end], 'g-')
    plt.xlim(limits)
    plt.ylim(limits)
    plt.xlabel('Candidate DNs')
    plt.ylabel('Reference DNs')
    fig.savefig(file_name, bbox_inches='tight')
    plt.close(fig) 
开发者ID:planetlabs,项目名称:radiometric_normalization,代码行数:26,代码来源:display.py

示例2: make_2d_hist

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import hexbin [as 别名]
def make_2d_hist(data, name):
    f = plt.figure()
    X,Y = np.meshgrid(range(data.shape[0]), range(data.shape[1]))
    im = plt.pcolormesh(X,Y,data.transpose(), cmap='seismic')
    plt.colorbar(im, orientation='vertical')
#     plt.hexbin(data,data)
#     plt.show()
    f.savefig(pjoin(FLAGS.output_dir, name + '.png'))
    plt.close()
    
# def make_2d_hexbin(data, name):
#     f = plt.figure()
#     X,Y = np.meshgrid(range(data.shape[0]), range(data.shape[1]))
#     plt.hexbin(X, data)
# #     plt.show()
#     f.savefig(pjoin(FLAGS.output_dir, name + '.png')) 
开发者ID:glrs,项目名称:StackedDAE,代码行数:18,代码来源:visualize.py

示例3: hexbin_alex

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import hexbin [as 别名]
def hexbin_alex(d, i=0, vmin=1, vmax=None, gridsize=80, cmap='Spectral_r',
                E_name='E', S_name='S', **hexbin_kwargs):
    """Plot an hexbin 2D histogram for E-S.
    """
    if d.num_bursts[i] < 1:
        return
    hexbin_kwargs_ = dict(edgecolor='none', linewidth=0.2, gridsize=gridsize,
                          cmap=cmap, extent=(-0.2, 1.2, -0.2, 1.2), mincnt=1)
    if hexbin_kwargs is not None:
        hexbin_kwargs_.update(_normalize_kwargs(hexbin_kwargs))
    poly = plt.hexbin(d[E_name][i], d[S_name][i], **hexbin_kwargs_)
    poly.set_clim(vmin, vmax)
    plt.xlabel('E')
    plt.ylabel('S') 
开发者ID:tritemio,项目名称:FRETBursts,代码行数:16,代码来源:burst_plot.py

示例4: _alex_hexbin_vmax

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import hexbin [as 别名]
def _alex_hexbin_vmax(patches, vmax_fret=True, Smax=0.8):
    """Return the max counts in the E-S hexbin histogram in `patches`.

    When `vmax_fret` is True, returns the max count for S < Smax.
    Otherwise returns the max count in all the histogram.
    """
    counts = patches.get_array()
    if vmax_fret:
        offset = patches.get_offsets()
        xoffset, yoffset = offset[:, 0], offset[:, 1]
        mask = yoffset < Smax
        vmax = counts[mask].max()
    else:
        vmax = counts.max()
    return vmax 
开发者ID:tritemio,项目名称:FRETBursts,代码行数:17,代码来源:burst_plot.py

示例5: HexBin

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import hexbin [as 别名]
def HexBin(xs, ys, **options):
    """Makes a scatter plot.

    xs: x values
    ys: y values
    options: options passed to plt.scatter
    """
    options = _Underride(options, cmap=matplotlib.cm.Blues)
    plt.hexbin(xs, ys, **options) 
开发者ID:Notabela,项目名称:Lie_to_me,代码行数:11,代码来源:thinkplot.py

示例6: plot_results

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import hexbin [as 别名]
def plot_results(talkers,classifiers,savefig=False):

    plt.subplot(111)

    x,y,s = [],[],[]

    count_talkers = Counter(talkers)
    count_classifiers = Counter(classifiers)

    for k in count_talkers:
        if count_classifiers.has_key(k):
            x.append(count_talkers[k])
            y.append(count_classifiers[k])

    xmin = np.min(x)
    xmax = np.max(x)
    ymin = np.min(y)
    ymax = np.max(y)

    plt.hexbin(x,y,gridsize=(20,20),bins='log',cmap=plt.cm.viridis)
    plt.axis([xmin,xmax,ymin,ymax])
    cb = plt.colorbar()
    cb.set_label(r'$\log_{10} N$')

    plt.xlabel(r'$N_{talk comments}$',fontsize=25)
    plt.ylabel(r'$N_{classifications}$',fontsize=25)

    plt.tight_layout()
    if savefig:
        plt.savefig('talk_contributions_{0}.png'.format(project_name))
    else:
        plt.show()

    return None 
开发者ID:zooniverse,项目名称:Data-digging,代码行数:36,代码来源:talk_contributions.py

示例7: HexBin

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import hexbin [as 别名]
def HexBin(xs, ys, **options):
    """Makes a scatter plot.

    xs: x values
    ys: y values
    options: options passed to pyplot.scatter
    """
    options = _Underride(options, cmap=matplotlib.cm.Blues)
    pyplot.hexbin(xs, ys, **options) 
开发者ID:AllenDowney,项目名称:DataExploration,代码行数:11,代码来源:thinkplot.py


注:本文中的matplotlib.pyplot.hexbin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。