本文整理汇总了Python中GeneralUtil.python.PlotUtilities.tick_axis_number方法的典型用法代码示例。如果您正苦于以下问题:Python PlotUtilities.tick_axis_number方法的具体用法?Python PlotUtilities.tick_axis_number怎么用?Python PlotUtilities.tick_axis_number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeneralUtil.python.PlotUtilities
的用法示例。
在下文中一共展示了PlotUtilities.tick_axis_number方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plot_fec_cartoon
# 需要导入模块: from GeneralUtil.python import PlotUtilities [as 别名]
# 或者: from GeneralUtil.python.PlotUtilities import tick_axis_number [as 别名]
def plot_fec_cartoon(base,data_base,file_names,arrow_kwargs=dict()):
kw = dict(cache_directory=data_base,force=False)
file_paths = [data_base + f +".csv" for f in file_names]
cases = [read_and_cache_file(f,**kw) for f in file_paths]
n_cases = len(cases)
out_names = []
event_styles = Plotting._fec_event_colors
styles = [dict(colors=event_styles,use_events=False),
dict(colors=event_styles),
dict(colors=event_styles)]
fudge_pN = [10,12,25]
im_path = base + "/cartoon/SurfaceChemistry Dig10p3_pmod-0{:d}.png"
gs= gridspec.GridSpec(2,3)
for i in range(3):
plt.subplot(gs[0, i])
image = plt.imread(im_path.format(i+1))
plt.imshow(image,interpolation="bilinear",aspect='equal',extent=None)
ax = plt.gca()
ax.axis('off')
for i,c in enumerate(cases):
plt.subplot(gs[1, i])
style = styles[i]
fec_split = Plotting.plot_fec(c,**style)
plt.xlim([-30,650])
# decorate the plot to make it easier to read
plot_x = fec_split.retract.Separation * 1e9
plot_y = fec_split.retract.Force *1e12
slices = fec_split.get_retract_event_slices()
Plotting.top_bars(plot_x,plot_x,slices,colors=style['colors'])
event_idx = [slice_v.stop for slice_v in slices]
if (len(event_idx) > 0):
# remove the last index (just te end of the FEC)
event_idx = event_idx[:-1]
fudge =fudge_pN[i]
Plotting.plot_arrows_above_events(event_idx,plot_x,plot_y,fudge,
**arrow_kwargs)
not_first_plot = i != 0
fmt(remove_y_labels=False,remove_x_labels=False)
if (i == 0):
y_label = r"Force (pN)"
x_label = "Separation (nm)"
else:
y_label = ""
x_label = ""
ax = plt.gca()
PlotUtilities.no_y_label(ax=ax)
PlotUtilities.ylabel(y_label)
PlotUtilities.xlabel(x_label)
PlotUtilities.tick_axis_number(num_x_major=4)