本文整理汇总了Python中Main.sort_dict方法的典型用法代码示例。如果您正苦于以下问题:Python Main.sort_dict方法的具体用法?Python Main.sort_dict怎么用?Python Main.sort_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main.sort_dict方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plot_data
# 需要导入模块: import Main [as 别名]
# 或者: from Main import sort_dict [as 别名]
def plot_data(flood_lst, ahbp_lst, sba_lst, ax):
"""
Plot results of each algorithm
Dictionaries contain connectivity as key and mean value and standart deviation as values
Plot, with errorbars, all in the same axes-object.
Arguments:
flood_lst -- list with the values for flooding
ahbp_lst -- list with the values for the ahbp
sba_lst -- list with the values for the sba
ax -- axes object into which the data will be plotted
mode -- integer for choosing the y-axis label
Return-type:
None
"""
conn_flood, y_flood, flood_err = mn.sort_dict(flood_lst)
conn_ahbp, y_ahbp, ahbp_err = mn.sort_dict(ahbp_lst)
conn_sba, y_sba, sba_err = mn.sort_dict(sba_lst)
ax.errorbar(conn_flood, y_flood, yerr=None, marker='o', markersize=6)
ax.errorbar(conn_ahbp, y_ahbp, yerr=None, color='red', marker='s', markersize=9)
ax.errorbar(conn_sba, y_sba, yerr=None, color='orange', marker='D', markersize=7)
plt.setp(ax.get_xticklabels(), fontsize=21, fontstyle='oblique')
plt.setp(ax.get_yticklabels(), fontsize=21, fontstyle='oblique')