Files
  • main.py
  • data1.csv
  • plot.png
  • plot2.png
  • plot3.png
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import numpy as np
import matplotlib.pyplot as plt
"""
T = np.array([25, 30, 36, 41,  46,  52,  58,  65,   70,   76,   85, 93])+273.5
V = np.array([1, 1.7, 3,  4.2, 5.5, 6.8, 8.5, 10.2, 11.1, 13.2, 15, 16.5])

plt.plot(T,V,"rx")
plt.title("Charles' Law Graph")
plt.ylabel("$\Delta V$ ($cm^3$)")
plt.xlabel("Tempreture ($K$)")
plt.savefig("plot.png")

plt.figure(2)

P = np.array([100.9, 106,111.3,117.9,125.3,132.5,141.5,151,161.9,175.8,193,211,234.8,263,301.5])
V = np.array([20,19,18,17,16,15,14,13,12,11,10,9,8,7,6])

plt.plot(P,V,"rx")
plt.savefig("plot2.png")
"""


plt.figure(3)

from numpy import genfromtxt
my_data = genfromtxt('data1.csv', delimiter=',')

plt.plot(np.transpose(my_data)[0],np.transpose(my_data)[1])
plt.savefig("plot3.png")