Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #+TBLNAME:tab2
- | NaCl %wt | Teq, °C | ρ, g/cm3 | n | η, mPa·s |
- |----------+-----------+------------+--------+------------|
- | 0 | 0 | 0.99984 | 1.333 | 1.002 |
- | 0.5 | -0.3 | 10.018 | 13.339 | 1.011 |
- | 1 | -0.59 | 10.053 | 13.347 | 1.02 |
- | 2 | -1.19 | 10.125 | 13.365 | 1.036 |
- | 3 | -1.79 | 10.196 | 13.383 | 1.052 |
- | 4 | -2.41 | 10.268 | 1.34 | 1.068 |
- | 5 | -3.05 | 1.034 | 13.418 | 1.085 |
- | 6 | -3.7 | 10.413 | 13.435 | 1.104 |
- | 7 | -4.38 | 10.486 | 13.453 | 1.124 |
- | 8 | -5.08 | 10.559 | 1.347 | 1.145 |
- | 9 | -5.81 | 10.633 | 13.488 | 1.168 |
- | 10 | -6.56 | 10.707 | 13.505 | 1.193 |
- | 12 | -8.18 | 10.857 | 13.541 | 1.25 |
- | 14 | -9.94 | 11.008 | 13.576 | 1.317 |
- | 16 | -11.89 | 11.162 | 13.612 | 1.388 |
- | 18 | -14.04 | 11.319 | 13.648 | 1.463 |
- | 20 | -16.46 | 11.478 | 13.684 | 1.557 |
- | 22 | -19.18 | 1.164 | 13.721 | 1.676 |
- | 23.3 | -21.1 | | | |
- | 23.7 | -17.3 | | | |
- | 24.9 | -11.1 | | | |
- | 26.1 | -2.7 | | | |
- | 26.28 | 0 | | | |
- | 26.32 | 10 | | | |
- | 26.41 | 20 | | | |
- | 26.45 | 25 | | | |
- | 26.52 | 30 | | | |
- | 26.67 | 40 | | | |
- | 26.84 | 50 | | | |
- | 27.03 | 60 | | | |
- | 27.25 | 70 | | | |
- | 27.5 | 80 | | | |
- | 27.78 | 90 | | | |
- | 28.05 | 100 | | | |
- #+BEGIN_SRC python :results file :exports none :var data=tab2
- import numpy as np
- import matplotlib.pyplot as plt
- from matplotlib import ticker
- x = np.array([a[0] for a in data[1:]])
- y = np.array([a[1] for a in data[1:]])
- #x=np.array([0,30,60,90,120,150])
- #y=np.array([20,10,5,2.5,1.25,0.625])
- #define x as 200 equally spaced values between the min and max of original x
- plt.tick_params(
- axis='x', # changes apply to the x-axis
- which='both', # both major and minor ticks are affected
- bottom=False, # ticks along the bottom edge are off
- top=False, # ticks along the top edge are off
- labelbottom=True)
- plt.tick_params(
- axis='y', # changes apply to the x-axis
- which='both', # both major and minor ticks are affected
- left=False, # ticks along the bottom edge are off
- top=False, # ticks along the top edge are off
- labelbottom=True)
- #plt.grid(color = 'black', linestyle = '-', linewidth = 0.5)
- plt.plot(x,y, linestyle='-',color='black')
- plt.fill_between(x,y, np.vstack([y]).min(0).clip(min=120),color='yellow',alpha=.3)
- plt.fill_between(x,-40, np.vstack([y]).min(0).clip(min=-53.3), where=x<23.5, color='blue',alpha=.3, interpolate=True)
- plt.fill_between(x,-40, np.vstack([y]).min(0).clip(max=0),where=x>23., color='blue',alpha=.3)
- #plt.fill_between(x,y, np.hstack([y]).min(0).clip(max=00), where = x>35 ,color='red',alpha=.4)
- #plt.fill_between(x,np.minimum(y,110),0,color='black', where=x>25, alpha=.3)
- #plt.fill_between(x, np.max(y,60),0,color='pink', alpha=.3)
- plt.xlabel("NaCl em water %(m/v)")
- plt.ylabel("Temperatura / C")
- plt.xticks([0,50,100])
- plt.ylim([-40,100])
- filename = "diagram.png"
- plt.savefig(filename)
- plt.show()
- #+END_SRC
- #+RESULTS:
- [[file:diagram.png]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement