Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Wed Jul 15 22:13:03 2015
  4.  
  5. @author: abhinav
  6. """
  7.  
  8. import matplotlib.pyplot as plt
  9. import numpy as np
  10.  
  11. with plt.xkcd():
  12.  
  13. # This initializes the grid
  14. fig = plt.figure()
  15.  
  16. # This is the position of the grid in the screen
  17. ax = fig.add_axes((0.3, 0.3, 0.5, 0.5))
  18.  
  19. # This portion takes care of the colors ofthe Grid Boundary
  20. ax.spines['right'].set_color('blue')
  21. ax.spines['left'].set_color('darkred')
  22. ax.spines['bottom'].set_color('green')
  23. ax.spines['top'].set_color('purple')
  24.  
  25. # The ticks for the axes
  26.  
  27. plt.xticks([])
  28. plt.yticks([])
  29.  
  30. # This sets the limits for the grid
  31. ax.set_ylim([0, 50])
  32. ax.set_xlim([0,100])
  33.  
  34. # This is the arrow which is used to point-out imp. stuff
  35.  
  36. # x = np.linspace(0,1)
  37. # y = np.sin(4*np.pi*x)
  38. # plt.plot(x,y,'r')
  39.  
  40. # x = np.linspace(0,100)
  41. # plt.plot( np.log(x), 'r')
  42.  
  43. # y = np.linspace(-3*np.pi, 3*np.pi)
  44. # plt.plot(np.sin(y))
  45. #
  46. #
  47. # z = np.linspace(20,40)
  48. # plt.plot(np.sqrt(z))
  49.  
  50. # y = np.linspace(-3*np.pi, 2*np.pi)
  51. # x = np.linspace(2*np.pi,20)
  52. # plt.plot(np.sqrt(x))
  53. # plt.plot(np.sin(y))
  54.  
  55. # arr1 = np.arange(0,8,0.5)
  56. # arr2 = np.arange(8,14, 0.2)
  57. # arr3 = np.arange(14,20,0.09)
  58. # data_points = np.append(arr1, arr2)
  59. # plt.plot(data_points, linestyle = ':')
  60.  
  61. arr1 = np.arange(0,8,0.9)
  62. arr2 = np.arange(8,14, 0.4)
  63. arr3 = np.arange(14,20,0.09)
  64. arr4 = np.arange(20, 80, 0.005)
  65. data_points_1 = np.append(arr1, arr2)
  66. data_points_2 = np.append(data_points_1, arr3)
  67. data_points_3 = np.append(data_points_2, arr4)
  68. plt.plot(data_points_3, linestyle = '--', color = "skyblue")
  69. # plt.plot(np.append(np.append(arr1, arr2) + np.append(arr2, arr3))
  70. # plt.plot(np.append(arr1, arr2)) + plt.plot(np.append(arr2, arr3))
  71.  
  72. ax.plot([8],[9],"ro")
  73. plt.annotate(
  74. 'THE STEEP CURVE ENDS\n RIGHT HERE',
  75. xy=(7, 9), arrowprops=dict(arrowstyle='->'),
  76. xytext=(15, 30))
  77.  
  78. ax.plot([26],[15],"ro")
  79. plt.annotate(
  80. 'NOW IT STARTS TO FLATTEN',
  81. xy=(26, 15), arrowprops=dict(arrowstyle='->'),
  82. xytext=(15, -15))
  83.  
  84.  
  85. plt.annotate(
  86. 'THE LONG ROAD TO PERFECTION',
  87. xy=(50, 25),
  88. xytext=(50, 13))
  89.  
  90.  
  91. # These are the labels which are to be placed along the axes
  92. plt.xlabel('Time')
  93. plt.ylabel('The amount of learning')
  94.  
  95. # This is the Subscript banner
  96. fig.text(
  97. 0.5, 0.05,
  98. 'THE LEARNING CURVE',
  99. ha='center')
  100.  
  101. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement