Advertisement
Guest User

diagram_phase

a guest
Jan 6th, 2022
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1.  
  2. #+TBLNAME:tab2
  3. | NaCl %wt | Teq, °C | ρ, g/cm3 | n | η, mPa·s |
  4. |----------+-----------+------------+--------+------------|
  5. | 0 | 0 | 0.99984 | 1.333 | 1.002 |
  6. | 0.5 | -0.3 | 10.018 | 13.339 | 1.011 |
  7. | 1 | -0.59 | 10.053 | 13.347 | 1.02 |
  8. | 2 | -1.19 | 10.125 | 13.365 | 1.036 |
  9. | 3 | -1.79 | 10.196 | 13.383 | 1.052 |
  10. | 4 | -2.41 | 10.268 | 1.34 | 1.068 |
  11. | 5 | -3.05 | 1.034 | 13.418 | 1.085 |
  12. | 6 | -3.7 | 10.413 | 13.435 | 1.104 |
  13. | 7 | -4.38 | 10.486 | 13.453 | 1.124 |
  14. | 8 | -5.08 | 10.559 | 1.347 | 1.145 |
  15. | 9 | -5.81 | 10.633 | 13.488 | 1.168 |
  16. | 10 | -6.56 | 10.707 | 13.505 | 1.193 |
  17. | 12 | -8.18 | 10.857 | 13.541 | 1.25 |
  18. | 14 | -9.94 | 11.008 | 13.576 | 1.317 |
  19. | 16 | -11.89 | 11.162 | 13.612 | 1.388 |
  20. | 18 | -14.04 | 11.319 | 13.648 | 1.463 |
  21. | 20 | -16.46 | 11.478 | 13.684 | 1.557 |
  22. | 22 | -19.18 | 1.164 | 13.721 | 1.676 |
  23. | 23.3 | -21.1 | | | |
  24. | 23.7 | -17.3 | | | |
  25. | 24.9 | -11.1 | | | |
  26. | 26.1 | -2.7 | | | |
  27. | 26.28 | 0 | | | |
  28. | 26.32 | 10 | | | |
  29. | 26.41 | 20 | | | |
  30. | 26.45 | 25 | | | |
  31. | 26.52 | 30 | | | |
  32. | 26.67 | 40 | | | |
  33. | 26.84 | 50 | | | |
  34. | 27.03 | 60 | | | |
  35. | 27.25 | 70 | | | |
  36. | 27.5 | 80 | | | |
  37. | 27.78 | 90 | | | |
  38. | 28.05 | 100 | | | |
  39.  
  40. #+BEGIN_SRC python :results file :exports none :var data=tab2
  41. import numpy as np
  42. import matplotlib.pyplot as plt
  43. from matplotlib import ticker
  44. x = np.array([a[0] for a in data[1:]])
  45. y = np.array([a[1] for a in data[1:]])
  46. #x=np.array([0,30,60,90,120,150])
  47. #y=np.array([20,10,5,2.5,1.25,0.625])
  48. #define x as 200 equally spaced values between the min and max of original x
  49. plt.tick_params(
  50. axis='x', # changes apply to the x-axis
  51. which='both', # both major and minor ticks are affected
  52. bottom=False, # ticks along the bottom edge are off
  53. top=False, # ticks along the top edge are off
  54. labelbottom=True)
  55. plt.tick_params(
  56. axis='y', # changes apply to the x-axis
  57. which='both', # both major and minor ticks are affected
  58. left=False, # ticks along the bottom edge are off
  59. top=False, # ticks along the top edge are off
  60. labelbottom=True)
  61.  
  62.  
  63.  
  64.  
  65. #plt.grid(color = 'black', linestyle = '-', linewidth = 0.5)
  66.  
  67. plt.plot(x,y, linestyle='-',color='black')
  68. plt.fill_between(x,y, np.vstack([y]).min(0).clip(min=120),color='yellow',alpha=.3)
  69. plt.fill_between(x,-40, np.vstack([y]).min(0).clip(min=-53.3), where=x<23.5, color='blue',alpha=.3, interpolate=True)
  70. plt.fill_between(x,-40, np.vstack([y]).min(0).clip(max=0),where=x>23., color='blue',alpha=.3)
  71. #plt.fill_between(x,y, np.hstack([y]).min(0).clip(max=00), where = x>35 ,color='red',alpha=.4)
  72. #plt.fill_between(x,np.minimum(y,110),0,color='black', where=x>25, alpha=.3)
  73. #plt.fill_between(x, np.max(y,60),0,color='pink', alpha=.3)
  74.  
  75. plt.xlabel("NaCl em water %(m/v)")
  76. plt.ylabel("Temperatura / C")
  77. plt.xticks([0,50,100])
  78. plt.ylim([-40,100])
  79. filename = "diagram.png"
  80. plt.savefig(filename)
  81. plt.show()
  82. #+END_SRC
  83.  
  84. #+RESULTS:
  85. [[file:diagram.png]]
  86.  
  87.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement