import sys import pandas as pd import matplotlib import matplotlib.pyplot as plt from matplotlib.lines import Line2D def main(): set_plot_options() fig, axs = plt.subplots(1, 2, figsize=(24, 7)) columns = ["Percent", "RequestT", "Rtstdev", "ResponseS", "ResponseT", "ReTstdev"] df = pd.read_csv("check_blockage.csv", usecols=columns) fig.supxlabel('Blocked Bridges (%)') axs[0].set_ylabel('Response Time (ms)') axs[0].plot(df.Percent, df.ResponseT, color='#CC4F1B', label='Response Time for Percentage of Bridges Blocked') axs[0].fill_between(df.Percent, df.ResponseT-df.ReTstdev, df.ResponseT+df.ReTstdev, alpha=0.5, edgecolor='#CC4F1B', facecolor='#FF9848') axs[1].set_ylabel('Response Size (ms)') axs[1].plot(df.Percent, df.ResponseS, color='#CC4F1B', label='Response Size for Percentage of Bridges Blocked') fig.savefig("Performance2.pdf") def set_plot_options(): options = { 'font.size': 12, 'figure.figsize': (4,2), 'figure.dpi': 100.0, 'figure.subplot.left': 0.20, 'figure.subplot.right': 0.97, 'figure.subplot.bottom': 0.20, 'figure.subplot.top': 0.90, 'grid.color': '0.1', 'grid.linestyle': ':', #'grid.linewidth': 0.5, 'axes.grid' : True, #'axes.grid.axis' : 'y', #'axes.axisbelow': True, 'axes.titlesize' : 'x-large', 'axes.labelsize' : 'x-large', 'axes.formatter.limits': (-4,4), 'xtick.labelsize' : 20,#get_tick_font_size_10(), 'ytick.labelsize' : 20,#get_tick_font_size_10(), 'lines.linewidth' : 2.0, 'lines.markeredgewidth' : 0.5, 'lines.markersize' : 10, } for option_key in options: matplotlib.rcParams[option_key] = options[option_key] if 'figure.max_num_figures' in matplotlib.rcParams: matplotlib.rcParams['figure.max_num_figures'] = 100 if 'figure.max_open_warning' in matplotlib.rcParams: matplotlib.rcParams['figure.max_open_warning'] = 100 if 'legend.ncol' in matplotlib.rcParams: matplotlib.rcParams['legend.ncol'] = 100 if __name__ == "__main__": sys.exit(main())