本文整理汇总了Python中aplpy.FITSFigure.set_tick_labels_font方法的典型用法代码示例。如果您正苦于以下问题:Python FITSFigure.set_tick_labels_font方法的具体用法?Python FITSFigure.set_tick_labels_font怎么用?Python FITSFigure.set_tick_labels_font使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aplpy.FITSFigure
的用法示例。
在下文中一共展示了FITSFigure.set_tick_labels_font方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: convolve
# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import set_tick_labels_font [as 别名]
correlated_counts = convolve(counts, tophat.array)
correlated_model = convolve(model, tophat.array)
# Fermi significance
fermi_significance = np.nan_to_num(significance(correlated_counts, correlated_gtmodel, method="lima"))
# Gammapy significance
significance = np.nan_to_num(significance(correlated_counts, correlated_model, method="lima"))
titles = ["Gammapy Significance", "Fermi Tools Significance"]
# Plot
fig = plt.figure(figsize=(10, 5))
hdu1 = fits.ImageHDU(significance, header)
f1 = FITSFigure(hdu1, figure=fig, convention="wells", subplot=(1, 2, 1))
f1.set_tick_labels_font(size="x-small")
f1.tick_labels.set_xformat("ddd")
f1.tick_labels.set_yformat("ddd")
f1.show_colorscale(vmin=0, vmax=20, cmap="afmhot", stretch="sqrt")
f1.add_colorbar(axis_label_text="Significance")
f1.colorbar.set_width(0.1)
f1.colorbar.set_location("right")
hdu2 = fits.ImageHDU(fermi_significance, header)
f2 = FITSFigure(hdu2, figure=fig, convention="wells", subplot=(1, 2, 2))
f2.set_tick_labels_font(size="x-small")
f2.tick_labels.set_xformat("ddd")
f2.hide_ytick_labels()
f2.hide_yaxis_label()
f2.show_colorscale(vmin=0, vmax=20, cmap="afmhot", stretch="sqrt")
f2.add_colorbar(axis_label_text="Significance")
示例2: FITSFigure
# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import set_tick_labels_font [as 别名]
# Fermi significance
fermi_significance = np.nan_to_num(significance(correlated_counts, gtmodel,
method='lima'))
# Gammapy significance
significance = np.nan_to_num(significance(correlated_counts, correlated_model,
method='lima'))
titles = ['Gammapy Significance', 'Fermi Tools Significance']
# Plot
fig = plt.figure(figsize=(10, 5))
hdu1 = fits.ImageHDU(significance, header)
f1 = FITSFigure(hdu1, figure=fig, convention='wells', subplot=(1, 2, 1))
f1.set_tick_labels_font(size='x-small')
f1.tick_labels.set_xformat('ddd')
f1.tick_labels.set_yformat('ddd')
f1.show_colorscale(vmin=0, vmax=10, cmap='afmhot')
f1.add_colorbar(axis_label_text='Significance')
f1.colorbar.set_width(0.1)
f1.colorbar.set_location('right')
hdu2 = fits.ImageHDU(fermi_significance, header)
f2 = FITSFigure(hdu2, figure=fig, convention='wells', subplot=(1, 2, 2))
f2.set_tick_labels_font(size='x-small')
f2.tick_labels.set_xformat('ddd')
f2.hide_ytick_labels()
f2.hide_yaxis_label()
f2.show_colorscale(vmin=0, vmax=10, cmap='afmhot')
f2.add_colorbar(axis_label_text='Significance')
示例3: raw_input
# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import set_tick_labels_font [as 别名]
from aplpy import FITSFigure
from astropy.io import fits
filename = raw_input("File to plot: ")
hdu = fits.open(filename)[1]
fig = FITSFigure(hdu)
fig.show_colorscale(stretch='log', interpolation='none')
#fig.add_colorbar()
#fig.colorbar.set_ticks([0.1e-11, 0.4e-11, 1.2e-11])
#fig.colorbar.set_width(0.1)
#fig.colorbar.set_font('serif')
#fig.colorbar.set_label_properties(size='small')
#fig.hide_ytick_labels()
#fig.hide_yaxis_label()
#fig.hide_xaxis_label()
fig.tick_labels.set_yformat('ddd')
fig.tick_labels.set_xformat('ddd')
fig.set_tick_yspacing(5)
fig.axis_labels.set_font(size='small', family='roman')
fig.set_tick_labels_font('serif')
fig.set_tick_labels_size('small')
fig.save('image.pdf')