在Matplotlib上看不到线,看不到点

时间:2019-03-08 10:49:02

标签: python matplotlib plot orbital-mechanics

我正在尝试使用四阶Runge-Kutta方法对轨道建模,该方法有效并且给出了良好的数值输出。我的问题是,当我尝试绘制围绕固定点的轨道时,只有指定每个数据点为一个点,我才能看到它。这段代码如下:

T, X, Y, V_X, V_Y = orbit(x, y, v_x, v_y)
results = [(X, Y)]
results = np.array(results) #converts the results list to an array that can be called upon for the values of x and y for the graph
X = results[:,0] #gets values for x for graph
Y = results[:,1] #gets values for y for graph
pp.axis('equal')
pp.plot(X, Y, 'o') #plots graph of above X and Y with circular points connected by a line.
pp.scatter(0,0, s=1000, color='g')
pp.show()

输出为:

enter image description here

当我摆脱'o'行中的pp.plot时,该行消失了。我唯一的想法是,与图形中的比例相比,厚度非常窄,但是我从来没有遇到过这个问题。

1 个答案:

答案 0 :(得分:1)

仅对此进行测试:

T, X, Y, V_X, V_Y = orbit(x, y, v_x, v_y)
pp.axis('equal')
pp.plot(X, Y) #plots graph of above X and Y with circular points connected by a line.
pp.scatter(0,0, s=1000, color='g')
pp.show()
相关问题