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


Python GraphArtist.draw_horizontal_line方法代码示例

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


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

示例1: boxplot_phi_reconstruction_results_for_MIP

# 需要导入模块: from artist import GraphArtist [as 别名]
# 或者: from artist.GraphArtist import draw_horizontal_line [as 别名]
def boxplot_phi_reconstruction_results_for_MIP(table, N):
    figure()

    THETA = deg2rad(22.5)
    DTHETA = deg2rad(5.)

    bin_edges = linspace(-180, 180, 18)
    x, r_dphi = [], []
    d25, d50, d75 = [], [], []
    for low, high in zip(bin_edges[:-1], bin_edges[1:]):
        rad_low = deg2rad(low)
        rad_high = deg2rad(high)
        query = '(min_n134 >= N) & (rad_low < reference_phi) & (reference_phi < rad_high) & (abs(reference_theta - THETA) <= DTHETA)'
        sel = table.read_where(query)
        dphi = sel[:]['reconstructed_phi'] - sel[:]['reference_phi']
        dphi = (dphi + pi) % (2 * pi) - pi
        r_dphi.append(rad2deg(dphi))

        d25.append(scoreatpercentile(rad2deg(dphi), 25))
        d50.append(scoreatpercentile(rad2deg(dphi), 50))
        d75.append(scoreatpercentile(rad2deg(dphi), 75))
        x.append((low + high) / 2)

    #boxplot(r_dphi, positions=x, widths=1 * (high - low), sym='')
    fill_between(x, d25, d75, color='0.75')
    plot(x, d50, 'o-', color='black')

    xlabel(r"$\phi_K$ [deg]")
    ylabel(r"$\phi_H - \phi_K$ [deg]")
    title(r"$N_{MIP} \geq %d, \quad \theta = 22.5^\circ \pm %d^\circ$" % (N, rad2deg(DTHETA)))

    xticks(linspace(-180, 180, 9))
    axhline(0, color='black')

    utils.saveplot(N)

    graph = GraphArtist()
    graph.draw_horizontal_line(0, linestyle='gray')
    graph.shade_region(x, d25, d75)
    graph.plot(x, d50, linestyle=None)
    graph.set_xlabel(r"$\phi_K$ [\si{\degree}]")
    graph.set_ylabel(r"$\phi_H - \phi_K$ [\si{\degree}]")
    graph.set_xticks([-180, -90, '...', 180])
    graph.set_xlimits(-180, 180)
    graph.set_ylimits(-23, 23)
    artist.utils.save_graph(graph, suffix=N, dirname='plots')
开发者ID:HiSPARC,项目名称:sapphire,代码行数:48,代码来源:direction_reconstruction.py

示例2: boxplot_phi_reconstruction_results_for_MIP

# 需要导入模块: from artist import GraphArtist [as 别名]
# 或者: from artist.GraphArtist import draw_horizontal_line [as 别名]
def boxplot_phi_reconstruction_results_for_MIP(group, N):
    table = group.E_1PeV.zenith_22_5

    figure()

    bin_edges = linspace(-180, 180, 18)
    x, r_dphi = [], []
    d25, d50, d75 = [], [], []
    for low, high in zip(bin_edges[:-1], bin_edges[1:]):
        rad_low = deg2rad(low)
        rad_high = deg2rad(high)
        query = '(min_n134 >= N) & (rad_low < reference_phi) & (reference_phi < rad_high)'
        sel = table.read_where(query)
        dphi = sel[:]['reconstructed_phi'] - sel[:]['reference_phi']
        dphi = (dphi + pi) % (2 * pi) - pi
        r_dphi.append(rad2deg(dphi))

        d25.append(scoreatpercentile(rad2deg(dphi), 25))
        d50.append(scoreatpercentile(rad2deg(dphi), 50))
        d75.append(scoreatpercentile(rad2deg(dphi), 75))
        x.append((low + high) / 2)

    fill_between(x, d25, d75, color='0.75')
    plot(x, d50, 'o-', color='black')

    xlabel(r"$\phi_{simulated}$ [deg]")
    ylabel(r"$\phi_{reconstructed} - \phi_{simulated}$ [deg]")
    #title(r"$N_{MIP} \geq %d, \quad \theta = 22.5^\circ$" % N)

    xticks(linspace(-180, 180, 9))
    axhline(0, color='black')
    ylim(-15, 15)

    utils.saveplot(N)

    graph = GraphArtist()
    graph.draw_horizontal_line(0, linestyle='gray')
    graph.shade_region(x, d25, d75)
    graph.plot(x, d50, linestyle=None)
    graph.set_xlabel(r"$\phi_\mathrm{sim}$ [\si{\degree}]")
    graph.set_ylabel(r"$\phi_\mathrm{rec} - \phi_\mathrm{sim}$ [\si{\degree}]")
    graph.set_title(r"$N_\mathrm{MIP} \geq %d$" % N)
    graph.set_xticks([-180, -90, '...', 180])
    graph.set_xlimits(-180, 180)
    graph.set_ylimits(-17, 17)
    artist.utils.save_graph(graph, suffix=N, dirname='plots')
开发者ID:OpenCosmics,项目名称:sapphire,代码行数:48,代码来源:direction_reconstruction.py

示例3: boxplot_theta_reconstruction_results_for_MIP

# 需要导入模块: from artist import GraphArtist [as 别名]
# 或者: from artist.GraphArtist import draw_horizontal_line [as 别名]
def boxplot_theta_reconstruction_results_for_MIP(table, N):
    figure()

    DTHETA = deg2rad(1.)

    angles = [0, 5, 10, 15, 22.5, 35]
    r_dtheta = []
    x = []
    d25, d50, d75 = [], [], []
    for angle in angles:
        theta = deg2rad(angle)
        sel = table.read_where('(min_n134 >= N) & (abs(reference_theta - theta) <= DTHETA)')
        dtheta = rad2deg(sel[:]['reconstructed_theta'] - sel[:]['reference_theta'])
        r_dtheta.append(dtheta)

        d25.append(scoreatpercentile(dtheta, 25))
        d50.append(scoreatpercentile(dtheta, 50))
        d75.append(scoreatpercentile(dtheta, 75))
        x.append(angle)

    #boxplot(r_dtheta, sym='', positions=angles, widths=2.)
    fill_between(x, d25, d75, color='0.75')
    plot(x, d50, 'o-', color='black')

    xlabel(r"$\theta_K$ [deg]")
    ylabel(r"$\theta_H - \theta_K$ [deg]")
    title(r"$N_{MIP} \geq %d$" % N)

    axhline(0, color='black')
    ylim(-20, 25)
    xlim(0, 35)

    utils.saveplot(N)

    graph = GraphArtist()
    graph.draw_horizontal_line(0, linestyle='gray')
    graph.shade_region(angles, d25, d75)
    graph.plot(angles, d50, linestyle=None)
    graph.set_xlabel(r"$\theta_K$ [\si{\degree}]")
    graph.set_ylabel(r"$\theta_H - \theta_K$ [\si{\degree}]")
    graph.set_ylimits(-5, 15)
    artist.utils.save_graph(graph, suffix=N, dirname='plots')
开发者ID:HiSPARC,项目名称:sapphire,代码行数:44,代码来源:direction_reconstruction.py

示例4: boxplot_theta_reconstruction_results_for_MIP

# 需要导入模块: from artist import GraphArtist [as 别名]
# 或者: from artist.GraphArtist import draw_horizontal_line [as 别名]
def boxplot_theta_reconstruction_results_for_MIP(group, N):
    group = group.E_1PeV

    figure()

    angles = [0, 5, 10, 15, 22.5, 30, 35, 45]
    r_dtheta = []
    d25, d50, d75 = [], [], []
    for angle in angles:
        table = group._f_get_child('zenith_%s' % str(angle).replace('.', '_'))
        sel = table.read_where('min_n134 >= %d' % N)
        dtheta = sel[:]['reconstructed_theta'] - sel[:]['reference_theta']
        r_dtheta.append(rad2deg(dtheta))

        d25.append(scoreatpercentile(rad2deg(dtheta), 25))
        d50.append(scoreatpercentile(rad2deg(dtheta), 50))
        d75.append(scoreatpercentile(rad2deg(dtheta), 75))

    fill_between(angles, d25, d75, color='0.75')
    plot(angles, d50, 'o-', color='black')

    xlabel(r"$\theta_{simulated}$ [deg]")
    ylabel(r"$\theta_{reconstructed} - \theta_{simulated}$ [deg]")
    #title(r"$N_{MIP} \geq %d$" % N)

    axhline(0, color='black')
    ylim(-10, 25)

    utils.saveplot(N)

    graph = GraphArtist()
    graph.draw_horizontal_line(0, linestyle='gray')
    graph.shade_region(angles, d25, d75)
    graph.plot(angles, d50, linestyle=None)
    graph.set_xlabel(r"$\theta_\mathrm{sim}$ [\si{\degree}]")
    graph.set_ylabel(r"$\theta_\mathrm{rec} - \theta_\mathrm{sim}$ [\si{\degree}]")
    graph.set_title(r"$N_\mathrm{MIP} \geq %d$" % N)
    graph.set_ylimits(-8, 22)
    artist.utils.save_graph(graph, suffix=N, dirname='plots')
开发者ID:OpenCosmics,项目名称:sapphire,代码行数:41,代码来源:direction_reconstruction.py


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