| import pandas as pd |
| from matplotlib import pyplot as plt, ticker |
|
|
| GUIDED_RESULT = './guided_interact.csv' |
| RANDOM_RESULT = './random_interact.csv' |
|
|
| def format_func(x, pos): |
| return format(int(x), ',').replace(',', ' ') |
|
|
| def main(): |
|
|
| plt.rcParams['font.size'] = 19 |
|
|
| |
| guided_interact = pd.read_csv(GUIDED_RESULT) |
| random_interact = pd.read_csv(RANDOM_RESULT) |
| guided_interact = guided_interact[1:] |
| random_interact = random_interact[1:] |
|
|
| |
| fig, ax1 = plt.subplots() |
|
|
| |
| color = 'tab:red' |
| ax1.set_xlabel('time/min') |
| ax1.set_xticks(guided_interact.index[9::10].astype(int)) |
| ax1.set_xticklabels(guided_interact.index[9::10].astype(int)) |
| ax1.set_ylabel('Rate of Effective Interactions', color=color) |
| |
| lre = ax1.plot(random_interact.index, random_interact['effective_interacts_rate'], color=color, label='Random') |
| ax1.set_xlim(0, guided_interact.index[-1]) |
| ax1.set_ylim(0, 1.05) |
| ax1.tick_params(axis='y', labelcolor=color) |
|
|
| |
| ax2 = ax1.twinx() |
| color = 'tab:blue' |
| ax2.set_ylabel('IVO Coverage', color=color) |
| |
| lrc = ax2.plot(random_interact.index, random_interact['coverage_rate'], color=color, label='Random') |
| ax2.set_xlim(0, guided_interact.index[-1]) |
| ax2.set_ylim(0, 1.05) |
| ax2.tick_params(axis='y', labelcolor=color) |
|
|
| |
| |
|
|
|
|
| plt.savefig('./figure_random.png', dpi=300, bbox_inches='tight') |
|
|
|
|
| if __name__ == '__main__': |
| main() |
|
|