python - 更改 uptplot 模块中的 figsize
问题描述
如何upsetplot
在 Python 中更改模块中的 figsize?我看到有一个fig
参数,但我不知道如何为它分配一个具有预定义大小的新图形。
解决方案
您可以使用 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()
感谢您启发开发有关此主题的示例:自定义元素大小和图形大小
推荐阅读
- android - 如何 GPG 签署 aar 并将其直接发布到 Maven Central?
- javascript - 如何随着地图位置的变化更新地图的边界?
- pentaho - 使用 ETL 在 Pentaho 中将表 A 中的数据复制/复制 N 次到表 B
- php - PHP - 如何在运行另一行代码 10 分钟后运行一行代码
- vue.js - (VueJS) TinyMCE 错误:无法读取 null 的属性“getContent”
- sql - 派生列转换中的 DT_DBDATE 日期到 YYYYMMDD
- javascript - JavaScript中逗号分隔语句的含义是什么?
- pip - 显示 pip install 而不是 pip3 install 的包的 PyPi 页面
- r - cumsum 基于列的条件,改变条件再次开始 cumsum
- javascript - 如何使用 JavaScript 返回 JSON 中的每个参数