353353
354354 if :gravitational ∈ keys (sr. simulation. system. potentials)
355355
356- xlim --> 1.1 * [minimum (solution[1 ,1 : n,:]), maximum (solution[1 ,1 : n,:])]
357- ylim --> 1.1 * [minimum (solution[2 ,1 : n,:]), maximum (solution[2 ,1 : n,:])]
356+ xlims --> 1.1 * [minimum (solution[1 ,1 : n,:]), maximum (solution[1 ,1 : n,:])]
357+ ylims --> 1.1 * [minimum (solution[2 ,1 : n,:]), maximum (solution[2 ,1 : n,:])]
358358
359359 for i in 1 : n
360360 @series begin
@@ -367,22 +367,32 @@ end
367367 positions = get_position (sr, time)
368368 borders = sr. simulation. boundary_conditions
369369 if borders isa PeriodicBoundaryConditions
370- xlim --> 1.1 * [borders[1 ], borders[2 ]]
371- ylim --> 1.1 * [borders[3 ], borders[4 ]]
372- zlim --> 1.1 * [borders[5 ], borders[6 ]]
370+ xlims --> 1.1 * [borders[1 ], borders[2 ]]
371+ ylims --> 1.1 * [borders[3 ], borders[4 ]]
372+ zlims --> 1.1 * [borders[5 ], borders[6 ]]
373373 elseif borders isa CubicPeriodicBoundaryConditions
374- xlim --> 1.1 * [0 , borders. L]
375- ylim --> 1.1 * [0 , borders. L]
376- zlim --> 1.1 * [0 , borders. L]
374+ xlims --> 1.1 * [0 , borders. L]
375+ ylims --> 1.1 * [0 , borders. L]
376+ zlims --> 1.1 * [0 , borders. L]
377377 map! (x -> x -= borders. L * floor (x / borders. L), positions, positions)
378378 end
379379
380+ end
380381
381- seriestype --> :scatter
382- markersize --> 5
383-
384- (positions[1 ,:], positions[2 ,:], positions[3 ,:])
385- # (positions[1,:], positions[2,:])
382+ positions = get_position (sr, time)
383+ seriestype --> :scatter
384+ markersize --> 5
385+
386+ for i in 1 : n
387+ @series begin
388+ label --> " Body no. $i "
389+
390+ if all (positions[3 ,:] .- positions[3 ,1 ] .< 1e-15 )
391+ ([positions[1 ,i]], [positions[2 ,i]])
392+ else
393+ (positions[1 ,:], positions[2 ,:], positions[3 ,:])
394+ end
395+ end
386396 end
387397end
388398
0 commit comments