【发布时间】:2022-06-07 19:50:21
【问题描述】:
我使用来自 statsmodels 的interaction_plot。我想添加一个图例,但interaction_plot 有自己的图例,所以我得到了两个图例。一个例子:
import numpy as np
np.random.seed(12345)
weight = np.random.randint(1,4,size=60)
duration = np.random.randint(1,3,size=60)
days = np.log(np.random.randint(1,30, size=60))
fig = interaction_plot(weight, duration, days,
colors=[\'red\',\'blue\'], markers=[\'D\',\'^\'], ms=10)
import matplotlib.pyplot as plt
fig.legend(loc=\'upper center\', bbox_to_anchor=(0.5, 1.05), fancybox=True, shadow=True)
plt.show()
如何删除原始图例?
标签: python matplotlib statsmodels