简体   繁体   English

用 Bokeh 绘制数学函数

[英]Plotting Mathematical Functions with Bokeh

I am currently working on an app where you can interact with the math function, adjust some variables in the function and see how the graph changes.我目前正在开发一个应用程序,您可以在其中与数学 function 进行交互,调整 function 中的一些变量并查看图表如何变化。 Something like this .像这样的东西。

在此处输入图像描述

Try dragging the sliders and the graph will change, which I think suits best with Bokeh.尝试拖动滑块,图表会发生变化,我认为这最适合 Bokeh。
Is there any way to plot a function in Bokeh or should I just split the function into tiny scatters and plug them in the function? Is there any way to plot a function in Bokeh or should I just split the function into tiny scatters and plug them in the function? What do you think is the best possible approach for this?您认为最好的方法是什么?

Huge thanks to Reti43 for the answer.非常感谢Reti43的回答。

It turned out that we can use np.linspace() to generate evenly spaced X-values, and then plug them into the function.事实证明,我们可以使用np.linspace()来生成等间距的 X 值,然后将它们插入 function 中。

You can have a look at the docs that Reti43 has provided for more information!您可以查看Reti43 提供的文档以获取更多信息!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM