def plot_merge_sim(show=True, save="", show_legend=False, use_text_font=True): results = bu.sim_load('merge_betas') # fonts if (use_text_font): plt.rcParams['mathtext.fontset'] = 'stix' plt.rcParams['font.family'] = 'STIXGeneral' od = OrderedDict(sorted(results.items())) x = np.arange(101) for key, val in od.iteritems(): plt.plot(x, val, linewidth=0.7) if show_legend: plt.legend(od.keys(), loc='upper left') ax = plt.axes() ax.set_xticks([0, 10, 20, 50, 100]) k = 317 plt.yticks([k, 2 * k, 5 * k, 10 * k, 13 * k], ["k", "2k", "5k", "10k", "13k"]) plt.xlabel(r'$t$') if not show_legend: for line, name in zip(ax.lines, od.keys()): y = line.get_ydata()[-1] ax.annotate(name, xy=(1, y), xytext=(6, 0), color=line.get_color(), xycoords=ax.get_yaxis_transform(), textcoords="offset points", size=10, va="center") if show: plt.show() if not show and save != "": plt.savefig(save)
def plot_density_ee(show=True, save="", use_text_font=True): if (use_text_font): plt.rcParams['mathtext.fontset'] = 'stix' plt.rcParams['font.family'] = 'STIXGeneral' od = bu.sim_load('density_results') plt.xlabel(r'$\beta$') plt.ylabel(r'assembly $p$') plt.plot(list(od.keys()), list(od.values()), linewidth=0.7) plt.plot([0, 0.06], [0.01, 0.01], color='red', linestyle='dashed', linewidth=0.7) if show: plt.show() if not show and save != "": plt.savefig(save)
def plot_pattern_com(show=True, save="", use_text_font=True): results = bu.sim_load('pattern_com_iterations') if (use_text_font): plt.rcParams['mathtext.fontset'] = 'stix' plt.rcParams['font.family'] = 'STIXGeneral' od = OrderedDict(sorted(results.items())) plt.plot(od.keys(), od.values(), linewidth=0.7) ax = plt.axes() plt.yticks([0, 0.25, 0.5, 0.75, 1], ["0%", "25%", "50%", "75%", "100%"]) plt.xlabel(r'$t$') if show: plt.show() if not show and save != "": plt.savefig(save)
def plot_association(show=True, save="", use_text_font=True): results = bu.sim_load('association_results') if (use_text_font): plt.rcParams['mathtext.fontset'] = 'stix' plt.rcParams['font.family'] = 'STIXGeneral' od = OrderedDict(sorted(results.items())) plt.plot(od.keys(), od.values(), linewidth=0.7) ax = plt.axes() plt.yticks([0.1, 0.2, 0.3, 0.4, 0.5], ["10%", "20%", "30%", "40%", "50%"]) plt.xlabel(r'$t$') if show: plt.show() if not show and save != "": plt.savefig(save)
def plot_overlap(show=True, save="", use_text_font=True): results = bu.sim_load('overlap_results') if (use_text_font): plt.rcParams['mathtext.fontset'] = 'stix' plt.rcParams['font.family'] = 'STIXGeneral' od = OrderedDict(sorted(results.items())) plt.plot(list(od.keys()), list(od.values()), linewidth=0.7) ax = plt.axes() plt.xticks([0, 0.2, 0.4, 0.6, 0.8], ["", "20%", "40%", "60%", "80%"]) plt.xlabel('overlap (assemblies)') plt.yticks([0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3], ["", "5%", "10%", "15%", "20%", "25%", "30%"]) plt.ylabel('overlap (projections)') if show: plt.show() if not show and save != "": plt.savefig(save)