gpt4 book ai didi

math - 像 Mathematica 这样的程序是如何绘制图形的?我该如何制作这样的程序?

转载 作者:太空宇宙 更新时间:2023-11-03 19:24:36 25 4
gpt4 key购买 nike

我一直想知道像 mathematica 和 mathlab 等程序如何优雅快速地绘制函数图。任何人都可以向我解释他们是如何做到这一点的,此外,我该如何做到这一点?它与计算机编程或数学的某个方面或类(class)有关吗?那么呢?

最佳答案

好吧,在 belisarius 的一些鼓励下,这是我的评论作为答案:尝试查看 matplotlib .来自主页:

matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. matplotlib can be used in python scripts, the python and ipython shell (ala MATLAB®* or Mathematica®†), web application servers, and six graphical user interface toolkits.

它最初的灵感来自 MATLAB 的绘图功能,尽管从那时起它已经发展了很多。它是可靠的软件 - 而且它是开源的,在 BSD 许可下,所以您不仅可以阅读源代码,还可以破解它并以任何您喜欢的方式使用它。

您可以查看的另一个地方是 gnuplot .它不是常见的开源许可证之一,但它肯定是开源的,具有一些修改权限等。

Gnuplot is a portable command-line driven graphing utility for linux, OS/2, MS Windows, OSX, VMS, and many other platforms. The source code is copyrighted but freely distributed (i.e., you don't have to pay for it). It was originally created to allow scientists and students to visualize mathematical functions and data interactively, but has grown to support many non-interactive uses such as web scripting. It is also used as a plotting engine by third-party applications like Octave. Gnuplot has been supported and under active development since 1986.

它也可以进行 3D 绘图,这是 matplotlib 所不具备的,而且它已经存在了很长时间。我首先想到 matplotlib 的原因是它旨在作为高级语言的库,而不是独立的应用程序,所以我猜它可能更容易阅读。

另一个建议是查看 documentation for Plot,以了解 Mathematica 在幕后所做的各种事情。 .特别是,如果您查看可用的选项,您可以推断出一些东西。

MaxRecursion Automatic the maximum number of recursive subdivisions allowed Method Automatic the method to use for refining curves PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotPoints Automatic initial number of sample points

MaxRecursionPlotPoints 中,您可以看到它正在进行初始采样,然后以某种方式决定哪些区域需要分割(重新采样)以获得准确的 View 剧情。从那时起,它就变得神奇了:为此有一些 Method,还有一个 PerformanceGoal 来指导它......

关于math - 像 Mathematica 这样的程序是如何绘制图形的?我该如何制作这样的程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4772713/

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