我有一些粒子在走廊中移动并具有封闭边界条件的数据.绘制轨迹会产生锯齿形轨迹.
我想知道如何阻止plot()连接点,粒子回到起点.有些东西比如图片的上半部分,但没有"."
plot()
"."
我的第一个想法是在numpy数组a[:-1]-a[1:]获得positiv 时找到索引.然后从0到该索引的绘图.但是如何获得第一次出现正元素的指数a[:-1]-a[1:]?也许还有其他一些想法.
numpy
a[:-1]-a[1:]
python numpy matplotlib
matplotlib ×1
numpy ×1
python ×1