javascript - 在 Plotly Js 上将绝对值更改为相对值
问题描述
我在 JS Plotly 中有上面的直方图,我需要将最大绝对频率更改为相对值。我正在努力将最大绝对频率更改为 100%。
我看到一些直方图功能使值的总和等于 100%,但在我的例子中,只有最高值是 100%,其余的是基于这个值的结果。
这是我正在处理的一些代码...
let air_temp_data = [1,2,n,+1000]
let graphicData = [
{
x: air_temp_data,
marker: { color: '#2222AA' },
type: 'histogram',
xbins: {
end: 50,
size: graph_intervals,
start: -50
}
}
];
let graphicLayout = {
width: 900,
height: 500,
title: 'Critical Lines Frequency',
bargap: 2,
yaxis: {
title: 'Frequency (%)',
titlefont: {
size: 16,
color: 'rgb(107, 107, 107)'
}
},
xaxis: {
title: 'Air Temperature',
titlefont: {
size: 16,
color: 'rgb(107, 107, 107)'
}
}
Plot.newPlot('criticalAmpacity', graphicData, graphicLayout);
有任何想法吗?谢谢!
解决方案
推荐阅读
- c# - 如何在 dotnet 核心中使用 XmlAttributes 覆盖 XmlChoiceIdentifierAttribute
- websocket - 为什么 Websocket 不广播对浏览器中所有选项卡的更改?
- javascript - 如果选中复选框,如何自动发送电子邮件
- arrays - Powershell 将数组转换为 json 会产生意想不到的结果
- python - 如何在熊猫中按日期交叉表或计算数据框行
- vbscript - 使用 VB 脚本最大化 Citrix 应用程序窗口
- laravel - Laravel 多态关系(morphMany)不起作用
- swift - 如何使用淡入淡出在一个标签中显示多个值
- reactjs - 向后端 Next.js - Next-Auth 发送 POST 请求时如何通过 cookie 验证用户?
- prometheus - 验证 prometheus 指标是否已更新