當前位置: 首頁>>代碼示例>>Python>>正文


Python Plot.add_parameter_overlay方法代碼示例

本文整理匯總了Python中plot.Plot.add_parameter_overlay方法的典型用法代碼示例。如果您正苦於以下問題:Python Plot.add_parameter_overlay方法的具體用法?Python Plot.add_parameter_overlay怎麽用?Python Plot.add_parameter_overlay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在plot.Plot的用法示例。


在下文中一共展示了Plot.add_parameter_overlay方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

# 需要導入模塊: from plot import Plot [as 別名]
# 或者: from plot.Plot import add_parameter_overlay [as 別名]
def main():
    figure = Plot.new_figure(figsize=(5,10))

    data_path = lambda x: os.path.join('json', 'fig_4d_difference_' + x + '_lifetime.json')
    fits = [ Fit(data_path(fig)) for fig in ['large', 'larger'] ]

    for fit in fits:
        fit.maps['value_transforms']['τ'] = lambda x: '%.2E' % round(x, 2)
        fit.meta['contact_type'] = 'transparent'

    plots = []
    for idx, fit in enumerate(fits):
        n, m = 2, 1

        options = {}
        if idx != 0: options['sharex'] = plots[idx - 1].plt

        plot = Plot(fit, figure.add_subplot(n, m, (m * idx + 1), **options))
        plot.id = 'd.' + str(idx + 1)
        plots.append(plot)

    for plot in plots:
        plot.plot_data()
        plot.plot_fit()
        plot.add_ylabel()
        plot.add_parameter_overlay()

    plots[-1].add_xlabel()
    matplotlib.pyplot.setp(plots[0].plt.get_xticklabels(), visible=False)

    figure.savefig(os.path.join('build', 'plot_fits_large_lifetime.eps'), transparent=True)
    plots[0].fit.save_info('build/plot_fits_large_lifetime_info.tex', 'plotFitsLargeLifetimeInfo')
    Plot.close_figure(figure)
開發者ID:evansosenko,項目名稱:aps-spin-lifetime-plots,代碼行數:35,代碼來源:plot_fits_large_lifetime.py

示例2: main

# 需要導入模塊: from plot import Plot [as 別名]
# 或者: from plot.Plot import add_parameter_overlay [as 別名]
def main():
    figure = Plot.new_figure(figsize=(5,10))
    fit_ids = ['a', 'b', 'c', 'd']

    def data_path(fit_id):
        if fit_id == 'c':
            fit_type = 'parallel'
        else:
            fit_type = 'difference'
        return os.path.join('json', 'fig_4' + fit_id + '_' + fit_type + '.json')

    fits = [ Fit(data_path(fig)) for fig in fit_ids ]

    for fit in fits[0:3]:
        fit.maps['value_transforms']['Ω_C'] = lambda x: '%.2E' % round(x, 2)

    for i in (0, 1): fits[i].meta['contact_type'] = 'tunneling'
    fits[2].meta['contact_type'] = 'pinhole'
    fits[3].meta['contact_type'] = 'transparent'

    plots = []
    for idx, fit in enumerate(fits):
        n, m = 4, 1

        options = {}
        if idx != 0: options['sharex'] = plots[idx - 1].plt

        plot = Plot(fit, figure.add_subplot(n, m, (m * idx + 1), **options))
        plot.id = fit_ids[idx]
        plots.append(plot)

    for idx, plot in enumerate(plots):
        plot.plot_data()
        plot.plot_fit()

        if idx == 2:
            plot.add_ylabel(False)
        else:
            plot.add_ylabel(True)

        plot.add_parameter_overlay()

    plots[-1].add_xlabel()
    matplotlib.pyplot.setp([ p.plt.get_xticklabels() for p in plots[0:3] ], visible=False)

    figure.savefig(os.path.join('build', 'plot_fits.eps'), transparent=True)
    plots[0].fit.save_info('build/plot_fits_info.tex', 'plotFitsInfo')
    Plot.close_figure(figure)
開發者ID:evansosenko,項目名稱:aps-spin-lifetime-plots,代碼行數:50,代碼來源:plot_fits.py


注:本文中的plot.Plot.add_parameter_overlay方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。