2017-08-06 142 views
1

如果我運行顯示此我想多線(劇情,Contourseries)

from sympy import * 
from sympy.plotting import * 
from sympy.plotting.plot import * 

x, y = symbols('x y') 
f = Function('f') 
g = Function('g') 

f = 1/((x+0.3)**2 + y**2) - 1/((x-0.3)**2 + y**2) 
g = 1/sqrt((x+0.3)**2 + y**2) - 1/sqrt((x-0.3)**2 + y**2) 

p0 = Plot(ContourSeries(f,(x,-1.5,1.5),(y,-1.5,1.5))) 
p1 = Plot(ContourSeries(g,(x,-1.5,1.5),(y,-1.5,1.5))) 

p0.show() 

p1.show() 

enter image description here

只有狹窄的區域。

我想顯示廣泛的區域和更多的線條。

我該如何解決? (圖片爲p0)

+0

你是什麼意思與「狹窄的區域」有這裏沒有顯示的行? –

回答

0

您將x和y的限制設置爲[-1.5; 1.5]。選擇x和y更一致的時間間隔:

p0 = Plot(ContourSeries(f,(x,-.4,.4),(y,-.01,.01))) 
p1 = Plot(ContourSeries(g,(x,-.4,.4),(y,-.01,.01))) 

enter image description here

+0

我的意思是,該行不出現在x = -0.4,x = -1,x = -1.3 ... –