def graph_data(paths):
    """
        Graphs the data with matplotlib. Will display on screen for user to screenshot.

        Parameters:
            paths - Contains the paths to each data file. Check function description of 
                    get_file_locations() to see how paths is structured. 

        Return:
            None
    """
    for data in extract_data(paths):
        # Unpack data packet
        env = data['env']
        seeds = data['seeds']

        pfbs = [pfb_x_mean, _, _, pfb_y_mean, pfb_y_low, pfb_y_high] = [[] for _ in range(6)]
        sbs = [sb_x_mean, _, _, sb_y_mean, sb_y_low, sb_y_high] = [[] for _ in range(6)]
        for i, data_type in enumerate(['x_mean', 'x_low', 'x_high', 'y_mean', 'y_low', 'y_high']):
            pfbs[i] = data['ppo_for_beginners'][data_type]
            sbs[i] = data['stable_baselines'][data_type]
        
        pfb_x_mean, _, _, pfb_y_mean, pfb_y_low, pfb_y_high = pfbs
        sb_x_mean, _, _, sb_y_mean, sb_y_low, sb_y_high = sbs

        # Handle specific case with mountaincarcontinuous
        if env == 'MountainCarContinuous-v0':
            plt.ylim([-70, 100])

        # Plot points
        plt.plot(sb_x_mean, sb_y_mean, 'b', alpha=0.8)
        plt.plot(pfb_x_mean, pfb_y_mean, 'g', alpha=0.8)
        # Plot errors
        plt.fill_between(sb_x_mean, sb_y_low, sb_y_high, color='b', alpha=0.3)
        plt.fill_between(pfb_x_mean, pfb_y_low, pfb_y_high, color='g', alpha=0.3)
        # Set labels
        plt.title(f'{env} on Random Seeds {seeds}')
        plt.xlabel('Average Total Timesteps So Far')
        plt.ylabel('Average Episodic Return')
        plt.legend(['Stable Baselines PPO3', 'PPO for Beginners'])
        # Show graph so user can screenshot
        plt.show()
Graphs the data with matplotlib. Will display on screen for user to screenshot.

Parameters:
paths - Contains the paths to each data file. Check function description of
get_file_locations() to see how paths is structured.

Return:
None
part4/make_graph.py