我有以下情节:
然而,行和列的标签只是连接和重叠. 我可以调整这些标签吗? 理想情况下,应使用 break line 代替管道.
以下是创建具有相同问题的类似情节的示例代码:
import numpy as np
import pandas as pd
import seaborn as sns
df1 = pd.DataFrame(
np.zeros((6,6)),
columns=['Epoch', 'Correlation', 'PreprocessingStyle', 'Model', 'Dataset', 'Type'],
)
df1['Model'] = 'a' * 26
df1['PreprocessingStyle'] = 'b' * 26
df2 = pd.DataFrame(
np.zeros((6,6)),
columns=['Epoch', 'Correlation', 'PreprocessingStyle', 'Model', 'Dataset', 'Type'],
)
df2['Model'] = 'c' * 26
df2['PreprocessingStyle'] = 'd' * 26
df = pd.concat([df1, df2])
g = sns.relplot(
df,
x='Epoch',
y='Correlation',
col='PreprocessingStyle',
row='Model',
hue='Dataset',
style='Type',
kind='line',
markers=True,
dashes=False,
)