如何在Matplotlib中单独更改factorplot中的linewidth和markersize? 为了单独更改factorplot中的linewidth和markersize,我们可以遵循以下步骤 – 设置图形大小并调整子图之间和周围的填充。 从在线存储库加载示例数据集。 使用 factorplot() 方法和 scale 来更改标记大小。 要显示图形,请使用 show() 方法。 示例 import seaborn as sns from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True exercise = sns.load_dataset("exercise") g = sns.factorplot(x="time", y="pulse", hue="kind", data=exercise, ci=95, markers=['o', '*', 'd'], scale=1, height=7.0) plt.show() PythonCopy 输出