Để chèn ký hiệu độ, dùng biểu diễn LaTeX.
Các bước
- Tạo điểm dữ liệu pV, nR, T bằng numpy.
- Vẽ pV, T bằng plot().
- Đặt xlabel cho pV bằng xlabel().
- Đặt nhãn nhiệt độ với ký hiệu độ bằng ylabel().
- Hiển thị bằng show().
Ví dụ
import numpy as np
from matplotlib import pyplot as plt
plt.rcParams["figure.figsize"] = [7.00, 3.50]
plt.rcParams["figure.autolayout"] = True
pV = np.array([3, 5, 1, 7, 10, 9, 4, 2])
nR = np.array([31, 15, 11, 51, 12, 71, 41, 13])
T = np.divide(pV, nR)
plt.plot(pV, T, c="red")
plt.xlabel("Pressure x Volume")
plt.ylabel("Temperature ($^\circ$C)")
plt.show()
Kết quả
