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


Python GraphArtist.set_title方法代码示例

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


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

示例1: boxplot_phi_reconstruction_results_for_MIP

# 需要导入模块: from artist import GraphArtist [as 别名]
# 或者: from artist.GraphArtist import set_title [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

示例2: boxplot_theta_reconstruction_results_for_MIP

# 需要导入模块: from artist import GraphArtist [as 别名]
# 或者: from artist.GraphArtist import set_title [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

示例3: plot_full_spectrum_fit_in_density_range

# 需要导入模块: from artist import GraphArtist [as 别名]
# 或者: from artist.GraphArtist import set_title [as 别名]
    def plot_full_spectrum_fit_in_density_range(self, sel, popt, low, high):
        bins = np.linspace(0, RANGE_MAX, N_BINS + 1)
        n, bins = np.histogram(sel, bins=bins)
        x = (bins[:-1] + bins[1:]) / 2

        p_gamma, p_landau = self.constrained_full_spectrum_fit(x, n, popt[:2], popt[2:])

        plt.figure()
        plt.plot(x * VNS, n, label="data")
        self.plot_landau_and_gamma(x, p_gamma, p_landau)

        y_charged = self.calc_charged_spectrum(x, n, p_gamma, p_landau)
        plt.plot(x * VNS, y_charged, label="charged particles")

        plt.yscale("log")
        plt.xlim(0, 50)
        plt.ylim(ymin=1)
        plt.xlabel("Pulse integral [V ns]")
        plt.ylabel("Count")
        plt.legend()
        suffix = "%.1f-%.1f" % (low, high)
        suffix = suffix.replace(".", "_")
        utils.saveplot(suffix)

        n = np.where(n > 0, n, 1e-99)
        y_charged = np.where(y_charged > 0, y_charged, 1e-99)

        graph = GraphArtist("semilogy")
        graph.histogram(n, bins * VNS, linestyle="gray")
        self.artistplot_alt_landau_and_gamma(graph, x, p_gamma, p_landau)
        graph.histogram(y_charged, bins * VNS)
        graph.set_xlabel(r"Pulse integral [\si{\volt\nano\second}]")
        graph.set_ylabel("Count")
        graph.set_title(
            r"$\SI{%.1f}{\per\square\meter} \leq \rho_\mathrm{charged}$ < $\SI{%.1f}{\per\square\meter}$" % (low, high)
        )
        graph.set_xlimits(0, 30)
        graph.set_ylimits(1e0, 1e4)
        artist.utils.save_graph(graph, suffix, dirname="plots")
开发者ID:pombredanne,项目名称:sapphire,代码行数:41,代码来源:reconstruction_efficiency.py


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