Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

plot_matrix.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import neo
  2. import quantities as pq
  3. import numpy as np
  4. import matplotlib.pyplot as plt
  5. import matplotlib as mpl
  6. import seaborn as sns
  7. import argparse
  8. from pathlib import Path
  9. if __name__ == '__main__':
  10. CLI = argparse.ArgumentParser()
  11. CLI.add_argument("--input", nargs='?', type=Path)
  12. CLI.add_argument("--output", nargs='?', type=Path)
  13. args, unknown = CLI.parse_known_args()
  14. matrix = np.load(args.input)
  15. np.fill_diagonal(matrix, np.nan)
  16. cmap = sns.color_palette("vlag", as_cmap=True).copy()
  17. cmap.set_bad(color='white')
  18. fig, ax = plt.subplots(ncols=2, figsize=(10,10),
  19. gridspec_kw={'width_ratios':[1,0.02]})
  20. sns.heatmap(matrix, cmap=cmap, center=0, square=True, ax=ax[0],
  21. <<<<<<< HEAD
  22. cbar=True, cbar_ax=ax[1], rasterized=True)
  23. =======
  24. cbar=True, cbar_ax=ax[1])
  25. >>>>>>> refs/remotes/origin/synced/master
  26. ax[0].set_axis_off()
  27. measure = args.input.name.split('.')[0]
  28. ax[1].set_ylabel(measure)
  29. plt.savefig(args.output, bbox_inches='tight')