简体   繁体   English

为什么它停在-10? 同情

[英]Why does it stop at -10? sympy

I was using sympy and when I was making a graph, a line stopped painting at -10我正在使用 sympy,当我制作图表时,一条线在 -10 处停止绘制

p5 = plot((10+x)/2, line_color="cyan")

at least in symbolab the same equation continues to infinity How could I make it continue to infinity?至少在 symbolab 中,相同的方程继续无穷大我怎么能让它继续无穷大?

That's because you didn't provide enough information to the plot function, so it used the default range going from -10 to 10.那是因为您没有为plot函数提供足够的信息,所以它使用了从 -10 到 10 的默认范围。

However, it's not possible to specify a range from minus infinity to plus infinity.但是,无法指定从负无穷到正无穷的范围。 The best thing we can do is to specify a sufficiently large range, for example:我们能做的最好的事情是指定一个足够大的范围,例如:

p5 = plot((10+x)/2, (x, -1000, 1000), line_color="cyan")

Please, read the documentation with help(plot) to better understand the available options and see a few more examples.请阅读带有help(plot)的文档以更好地理解可用选项并查看更多示例。

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

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