Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. plt.figure(figsize=(12,6))
  2.  
  3. linestyles = [(0,()),
  4.               (0,(1,1,5,3)),
  5.               (0,(4,1)),
  6.               (0,(5,1,1,3)),
  7.               (0,(1,1)),
  8.               (0,(1,1,1,1,5,5)),
  9.               (0,(5,1,1,1,1,5))]
  10. linewidth = 3
  11.  
  12. for j, p in enumerate(reliabilities):
  13.     confidence_of_catching_p_reliable_failures = [frequency_of_catching_subpar_samples[p][n_s] for n_s in n_samples]
  14.     plt.plot(n_samples, confidence_of_catching_p_reliable_failures, label="R = {}".format(p),
  15.              linestyle=linestyles[j], linewidth=linewidth)
  16.     plt.plot(n_samples, 1-p**n_samples, linestyle='-', linewidth=0.5, color='black')
  17. plt.grid()
  18.  
  19. plt.xlim([0,100])
  20. plt.ylim([0,1])
  21. fontsize = 'x-large'
  22. plt.legend(loc='best', fontsize=fontsize)
  23.  
  24. plt.title("Numerical simulation vs analytical $C = 1 - R^{n_s}$ (thin black lines)", fontsize=fontsize)
  25. plt.xlabel("Number of samples tested (-)", fontsize=fontsize)
  26. plt.ylabel("Confidence level (-)", fontsize=fontsize)
  27. plt.xticks(np.arange(0,101,10))
  28. plt.yticks(np.linspace(0,1,11))
  29. plt.tight_layout()
  30. plt.show()