File size: 2,148 Bytes
44706c2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
plt.rcParams['text.usetex'] = True
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = ['Arial']
alldata = pd.read_csv('')
popgymarcadedata = pd.read_csv('')
fig, axes = plt.subplots(1, 2, figsize=(15, 6), sharex=True, sharey=True)
colors = ['#f394c4', '#f2d580', '#b2b2b2', '#b2d28e', '#ecaf81', '#bab8d9', '#8dcfbb']
sns.set_palette(colors)
sns.lineplot(
data=popgymarcadedata,
x='Num Envs',
y='FPS',
hue='Environment',
marker='o',
markersize=25,
ax=axes[0],
)
axes[0].set_xscale('log', base=2)
axes[0].set_yscale('log', base=10)
axes[0].tick_params(axis='both', which='major', labelsize=20)
axes[0].set_xlabel('')
axes[0].set_ylabel('')
colors = ['#f394c4', '#ecaf81', '#b2b2b2', '#b2d28e', '#8600ec', '#bab8d9', '#8dcfbb']
for i, env in enumerate(alldata['Environment'].unique()):
env_data = alldata[alldata['Environment'] == env]
marker_style = '*' if 'popgym arcade' in env.lower() else 'o'
color = colors[i % len(colors)]
sns.lineplot(
data=env_data,
x='Num Envs',
y='FPS',
label=env,
marker=marker_style,
markersize=25 if marker_style == '*' else 20,
color=color,
ax=axes[1],
)
axes[1].set_xscale('log', base=2)
axes[1].set_yscale('log', base=10)
axes[1].tick_params(axis='both', which='major', labelsize=20)
axes[1].set_xlabel('')
axes[1].set_ylabel('')
axes[0].set_yticks([10000, 1000000, 100000000])
axes[1].set_yticks([10000, 1000000, 100000000])
axes[0].legend(title='', fontsize=12)
axes[1].legend(title='', fontsize=12)
fig.text(0.5, 0.02, 'Number of Parallel Environments', ha='center', fontsize=20)
fig.text(0.04, 0.6, 'Frames per second', va='center', rotation='vertical', fontsize=20)
for ax in axes:
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_linewidth(2)
ax.spines['bottom'].set_linewidth(2)
plt.tight_layout()
plt.subplots_adjust(bottom=0.15, left=0.1, wspace=0.1)
# plt.show()
plt.savefig("fps.pdf") |