adventofcode/2023/graphs.qmd

38 lines
662 B
Plaintext
Raw Normal View History

2023-12-07 20:02:54 +00:00
```{python}
#| echo: false
#| output: asis
import yaml
from yaml.loader import SafeLoader
import pandas as pd
import seaborn as sns
data = pd.read_json('./benchmark.json',lines=True)
```
```{python}
data = pd.DataFrame(data)
import matplotlib.pyplot as plt
plt.close('all')
#plt.scatter(data['day'],data['persec'])
#plt.show()
import seaborn.objects as so
from matplotlib.ticker import MaxNLocator
data['day'] = data['day'].astype(int)
face_grid = sns.relplot( data=data, x="day", y="persec", hue="language", style="part" )
fig = face_grid.figure
ax = fig.gca()
ax.xaxis.set_major_locator(MaxNLocator(integer=True))
plt.yscale('log')
plt.show()
```