Skip to content

Commit 993860c

Browse files
committed
Plot individual trajectories
1 parent dc065e9 commit 993860c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,12 @@ def main():
237237
show_or_save_fig(args.save_dir, 'path_energy_stochastic', args.extension)
238238

239239
system.plot(title='Stochastic Paths', trajectories=x_t_stoch_no_vel)
240-
show_or_save_fig(args.save_dir, 'paths_stochastic', args.extension)
240+
trajectories_to_plot = 2
241+
colors = plt.rcParams['axes.prop_cycle'].by_key()['color']
242+
idx = jax.random.permutation(jax.random.PRNGKey(args.seed), x_t_stoch_no_vel.shape[0])[:trajectories_to_plot]
243+
for i, c in zip(idx, colors[1:]):
244+
plt.plot(x_t_stoch_no_vel[i, :, 0].T, x_t_stoch_no_vel[i, :, 1].T, c=c)
245+
show_or_save_fig(args.save_dir, 'paths_stochastic_and_individual', args.extension)
241246

242247

243248
if __name__ == '__main__':

0 commit comments

Comments
 (0)