You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

stemgraphic库生成茎叶图返回错误数值,如何获取正确结果?

解决stemgraphic生成预期茎叶图的方法
  • 要生成带左侧累计计数且叶按降序排列的茎叶图,调用stem_graphic时需指定两个参数:
    • cumulative=True:开启左侧累计计数显示
    • reverse=True:将叶的排列顺序改为降序(默认是升序)

修改后的代码:

from stemgraphic import stem_graphic
stem_graphic([1, 2], cumulative=True, reverse=True)

执行后生成的茎叶图会符合预期格式,左侧显示累计计数,叶按2、1的顺序排列。

内容的提问来源于stack exchange,提问作者Michael Covell

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 10:59:52