如何upsetplot
在 Python 中更改模块中的 figsize?我看到有一个fig
参数,但我不知道如何为它分配一个具有预定义大小的新图形。
问问题
93 次
1 回答
1
您可以使用 matplotlib 定义一个图形,然后将其传递给 uptplot。但是,除非设置了,否则图形大小会由 uptplot 自动重置element_size=None
。
所以请使用类似的东西:
from matplotlib import pyplot as plt
from upsetplot import generate_counts, plot
example = generate_counts()
fig = plt.figure(figsize=(10, 3))
plot(example, fig=fig, element_size=None)
plt.show()
感谢您启发开发有关此主题的示例:自定义元素大小和图形大小
于 2021-07-15T02:10:38.977 回答