Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ flatten-json>=0.1.14
matplotlib>=3.10.0
numpy>=1.26.4
pandas>=2.2.3
seaborn>=0.13.2
86 changes: 86 additions & 0 deletions scripts/plot_chart.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import pandas as pd

from matplotlib.font_manager import fontManager, FontProperties

path = "../assets/fonts/inter.ttf"
fontManager.addfont(path)

prop = FontProperties(fname=path)

sns.set_theme(
font=prop.get_name(),
rc={
'axes.facecolor': '#0c2c14',
'figure.facecolor':'#0c2c14',
"text.color": '#ffffff', # all text fallback
"axes.titlecolor": '#ffffff', # title
"axes.labelcolor": '#ffffff', # x/y labels
"xtick.color": '#ffffffff',
"ytick.color": '#ffffffff',
"axes.edgecolor": 'none',
"patch.edgecolor": 'none',
"grid.color": '#092310',
})
sns.set_palette(["#568a63", "#fd663a", "#9b85b2", "#73762b", "#5a5485"])

# Example wide-form data
df = pd.DataFrame({
"Inline": [3240, 5669, 2316],
"Pipeline": [4433, 5563, 2349],
}, index=["AMD Radeon RX 9070 XT", "NVIDIA Geforce RTX 5070 Ti", "Intel Arc B580"])

print(df)

# Convert wide-form to long-form (tidy)
df_long = df.reset_index().melt(id_vars="index",
var_name="Category",
value_name="Ray Tracing Score")

print(df_long)


# Plot
fig, ax = plt.subplots()
ax = sns.barplot(
data=df_long,
x="index",
y="Ray Tracing Score",
hue="Category",
ax=ax,
)

ax.set_xlabel("")

def change_width(ax, new_value) :
for patch in ax.patches :
current_width = patch.get_width()
diff = current_width - new_value

# we change the bar width
patch.set_width(new_value)

# we recenter the bar
patch.set_x(patch.get_x() + diff * .5)



def change_height(ax, new_value) :
for patch in ax.patches :
current_height = patch.get_height()
diff = current_height - new_value

# we change the bar height
patch.set_height(new_value)

# we recenter the bar
patch.set_y(patch.get_y() + diff * .5)

# plt.xlabel("GPU")
# plt.ylabel("Score")
plt.title("Inline vs Pipeline Ray Tracing")
# plt.legend(title="Evolve Scores")
plt.savefig("test.png")
plt.show()