Function 如何使用flot.js渲染f(x)=1/x?
我正在考虑使用flot.js在3种情况下渲染函数f(x)=1/x:Function 如何使用flot.js渲染f(x)=1/x?,function,math,flot,Function,Math,Flot,我正在考虑使用flot.js在3种情况下渲染函数f(x)=1/x: f(x) = 1/n , f(x) = n/x , and f(x) = 1/x +n 我想让学生能够改变n,看看发生了什么,所以我需要刷新图形以及 我不知道如何呈现函数本身 必须用例如100个值填充数组,然后使用该数组绘制图形。大概是这样的: var f1array = []; for (var i = 1; i <= 100; i++) { f1array.push([0.1 * i, 1 / (0.
f(x) = 1/n ,
f(x) = n/x , and
f(x) = 1/x +n
我想让学生能够改变n,看看发生了什么,所以我需要刷新图形以及
我不知道如何呈现函数本身 必须用例如100个值填充数组,然后使用该数组绘制图形。大概是这样的:
var f1array = [];
for (var i = 1; i <= 100; i++) {
f1array.push([0.1 * i, 1 / (0.1 * i)]);
}
$.plot('#placeholderdiv', [f1array]);
var f1array=[];
对于(var i=1;我非常感谢!直到现在我还没有看到您的答案。如果您的值至少有两个相反的值,则会自动出现这种情况。请参见此。