Skip to main content
 首页 » 编程设计

python之具有可自定义线宽的 Python 中的隐式绘图

2025年02月15日11langtianya

我们如何增加由 Sympy 的 plot_implicit 生成的绘图的线宽?我也找不到为此 in the API 指定的参数,Google 也不会提供任何权宜之计。

我读过,例如,plot_implicit(Eq(x1**2 + x2**2 - 1))._backend.ax 引用了 Matplotlib 的 Axis 对象,所以我尝试更改从 Sympy 调用 plot_implicit 之前 Matplotlib 的默认线宽,但它没有做任何改变:

from matplotlib import rcParams 
rcParams['lines.linewidth'] = 10 

如果这不可能(很难相信),还有哪些其他选项可以在 Python 中生成隐式函数图,以便调整线宽?

请您参考如下方法:

来自plot_implicit documentation :

plot_implicit, by default, uses interval arithmetic to plot functions. If the expression cannot be plotted using interval arithmetic, it defaults to a generating a contour using a mesh grid of fixed number of points.

这意味着生成的图不是线图,线宽可以任意设置。
放大绘图时也可以观察到网格化效果: