python - 如何在 seabron 中使用 facet-grid 更改网格大小
问题描述
我正在绘制分面网格,以便我的 x 轴刻度是日期(dd-mm-yy),它看起来不太好。有没有办法改变网格的大小(比如 figsize)?
g = sns.FacetGrid(c53_grid, col='question',col_wrap = 4,
margin_titles=True)
g = g.map(plt.plot, "submitted_at", "int_value_0")
g = g.map(plot_mean, 'int_value_0', ls=":", c=".5")
g.set_titles("{col_name}")
g.set_xticklabels(rotation = 45)
解决方案
您可以设置height
参数(以英寸为单位的值)和aspect
参数 ( height*aspect=width
)。
在你的情况下:
g = sns.FacetGrid(c53_grid, col='question',col_wrap = 4,
margin_titles=True, height=3, aspect= 1,33) #4/3 ratio
g = g.map(plt.plot, "submitted_at", "int_value_0")
g = g.map(plot_mean, 'int_value_0', ls=":", c=".5")
g.set_titles("{col_name}")
g.set_xticklabels(rotation = 45)
我建议你看看文档
推荐阅读
- filesystems - 从 S3 对象存储读取和写入文件到 winSCP
- oracle - LiquibasePro 不会在 changeLog 文件中生成 package、packagebody 等
- angular - 如何取消订阅角度参数更改的所有订阅
- r - 如何根据日期、团队和竞争在 R 中创建连续(或运行形式)?
- javascript - Firebase 函数。https.onCall 返回 null
- reactjs - 如何使用reactjs在另一个输入字段中显示输入字段值?
- android - 用户注销 React Native 应用程序时如何删除 Firebase 云消息传递令牌?
- uwp - UWP 应用:WebView:如何允许来自应用本地网页中的 window.external.notify
- java - 使用 IntelliJ 在 Java 中创建 config.properties
- angular - TS2339:“行为主题”类型上不存在属性“排序”
我正在寻找使用角度材料创建动态表,我可以在其中动态添加/删除数据。作为 Angular 的新手,我参考了 stackblitz 来创建表格。