Unanswered
Hi, I Have A Plt Plot That Is Being Automatically Uploaded To A Task And Is Presented In The Plots Section Of The Task As Expected. However, The Plot Itself Isn'T Presented Fully, And I Can Only See The Titles And Some Of The Legend, But Not The Lineplot
` def plot_facetgrid(df, col, x_axis, y_axis, hue_by):
plt.figure(figsize=(10,8), dpi=100)
with mpl.rc_context({"lines.linewidth": 2, "axes.titlesize": 16, "axes.labelsize": 16,
"xtick.labelsize": 16, "ytick.labelsize": 16, "legend.fontsize": 16}):
n_sample = 8
grid = sns.FacetGrid(
df,
margin_titles=True,
col=col,
row=hue_by,
sharex='all',
sharey='row',
# col_wrap=3,
height=3, aspect=1.5,
hue=hue_by,
)
# Draw a line plot to show the trajectory of each random walk
grid.map(sns.lineplot, x_axis, y_axis, marker="o")
grid.map_dataframe(annotate)
grid.map_dataframe(annotate_values)
# grid.add_legend()
grid.set(xticks=list(range(10)))
grid.set_xticklabels(['(1, 0)'] + [''] * n_sample + ['(0, 1)'])
grid.fig.subplots_adjust(top=0.85)
for ax in grid.axes.flat:
ax.yaxis.set_major_formatter(FormatStrFormatter('%.2f'))
grid.figure.suptitle(f'Losses during interpolations- {title_add}')
plt.show()
plot_facetgrid(df, 'type', 'position', 'losses', 'data')
"""
df is a dataframe with the following coloumns:
- type: str ( 3 options of types)
- position: int (it is i for i in range(10))
- losses: float
- data: str (3 options of data) `
166 Views
0
Answers
2 years ago
one year ago