Skip to content

Commit

Permalink
A bit more clean displot
Browse files Browse the repository at this point in the history
  • Loading branch information
gevtushenko committed May 3, 2023
1 parent 5c7b408 commit 3c1f1d9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions benchmarks/scripts/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def extract_horizontal_space(df):
vertical_val = row[vertical_axis_name]
vertical_id = vertical_axis_ids[vertical_val]
vertical_name = "{}={}".format(vertical_axis_name, vertical_val)
horizontal_id = 0

if len(horizontal_axes) > 0:
horizontal_point = []
Expand All @@ -264,18 +265,24 @@ def extract_horizontal_space(df):
horizontal_name = " / ".join(horizontal_point)
horizontal_id = horizontal_axis_ids[horizontal_name]
ax=axes[vertical_id, horizontal_id]
if vertical_id == (num_rows - 1):
ax.set_xlabel(horizontal_name)
if horizontal_id == 0:
ax.set_ylabel(vertical_name)
else:
ax=axes[vertical_id]
ax.set_ylabel(vertical_name)

sns.histplot(data, ax=ax, kde=True)

if len(horizontal_axes) > 0:
ax=axes[vertical_id, horizontal_id]
if vertical_id == (num_rows - 1):
ax.set_xlabel(horizontal_name)
if horizontal_id == 0:
ax.set_ylabel(vertical_name)
else:
ax.set_ylabel('')

for ax in axes.flat:
ax.set_xticklabels([])
ax.set_yticklabels([])

fig.suptitle(title)
plt.tight_layout()
Expand Down

0 comments on commit 3c1f1d9

Please sign in to comment.