gpt4 book ai didi

python - 在 python-nvd3 中显示 y 轴上的大数字

转载 作者:行者123 更新时间:2023-12-02 01:18:45 35 4
gpt4 key购买 nike

在 y 轴上显示大数字的一种方法是移动边距:Y axis label not displaying large numbers - Multi-Bar Chart 。如何调整python-nvd3中的margin参数?您可以将指数写在顶部,如 10^6 并将 y 轴标记为 2.5 ,3.0 等,而不是写 25,00,000 、 30,00,000 等。

最佳答案

如果我正确理解你的问题,你想要格式化 y 轴的数字。您可以使用tickFormat选项。

https://github.com/mbostock/d3/wiki/Quantitative-Scales#wiki-linear_tickFormat

类似于:

.tickFormat(function(d) { return d / Math.pow(10,6) }

关于python - 在 python-nvd3 中显示 y 轴上的大数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19647466/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com