-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVE.py
More file actions
26 lines (20 loc) · 1.06 KB
/
Copy pathVE.py
File metadata and controls
26 lines (20 loc) · 1.06 KB
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
import matplotlib.pyplot as plt
import pandas as pd
# 1. Đọc dữ liệu từ file C++ vừa tạo
df = pd.read_csv('results.csv')
# 2. Khởi tạo biểu đồ
plt.figure(figsize=(10, 6))
# 3. Vẽ các điểm dữ liệu cho trường hợp LUÔN XOAY (Màu Xanh)
plt.scatter(df['NumPlayers'], df['WinRateSpin'], color='blue', label='Người 1 LUÔN XOAY')
plt.plot(df['NumPlayers'], df['WinRateSpin'], color='blue', linestyle='--', alpha=0.3)
# 4. Vẽ các điểm dữ liệu cho trường hợp KHÔNG XOAY (Màu Đỏ)
plt.scatter(df['NumPlayers'], df['WinRateNoSpin'], color='red', label='Người 1 KHÔNG XOAY')
plt.plot(df['NumPlayers'], df['WinRateNoSpin'], color='red', linestyle='--', alpha=0.3)
# 5. Định dạng hệ trục
plt.title('So sánh Tỉ lệ sống sót của Người chơi 1 (Luôn Xoay vs Không Xoay)', fontsize=14)
plt.xlabel('Số lượng người chơi (n)', fontsize=12)
plt.ylabel('Tỉ lệ sống sót (%)', fontsize=12)
plt.grid(True, linestyle=':', alpha=0.6)
plt.legend()
# 6. Hiển thị
plt.show()