analyse py graphique

This commit is contained in:
2026-02-13 15:30:15 +01:00
parent f4201536de
commit 6a23a35f40
5 changed files with 229 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View File

@ -0,0 +1,91 @@
k,n,wc,wr,rate,p,ber,fer,avg_iter
50,100,3,6,0.5000,0.000000,0.00000000,0.00000000,0.00
50,100,3,6,0.5000,0.008571,0.09586000,0.21200000,0.00
50,100,3,6,0.5000,0.017143,0.20772000,0.44500000,0.00
50,100,3,6,0.5000,0.025714,0.28084000,0.58700000,0.00
50,100,3,6,0.5000,0.034286,0.35496000,0.74100000,0.00
50,100,3,6,0.5000,0.042857,0.39766000,0.82200000,0.00
50,100,3,6,0.5000,0.051429,0.42240000,0.87200000,0.00
50,100,3,6,0.5000,0.060000,0.44045000,0.91000000,0.00
50,100,3,6,0.5000,0.068571,0.45518000,0.93500000,0.00
50,100,3,6,0.5000,0.077143,0.47826000,0.97400000,0.00
50,100,3,6,0.5000,0.085714,0.48009000,0.98200000,0.00
50,100,3,6,0.5000,0.094286,0.48391000,0.98600000,0.00
50,100,3,6,0.5000,0.102857,0.48988000,0.99300000,0.00
50,100,3,6,0.5000,0.111429,0.49456000,0.99500000,0.00
50,100,3,6,0.5000,0.120000,0.49429000,0.99700000,0.00
50,75,3,9,0.6667,0.000000,0.00000000,0.00000000,0.00
50,75,3,9,0.6667,0.008571,0.07490667,0.14800000,0.00
50,75,3,9,0.6667,0.017143,0.17278667,0.34600000,0.00
50,75,3,9,0.6667,0.025714,0.27240000,0.54800000,0.00
50,75,3,9,0.6667,0.034286,0.34341333,0.69300000,0.00
50,75,3,9,0.6667,0.042857,0.39881333,0.81500000,0.00
50,75,3,9,0.6667,0.051429,0.43321333,0.88400000,0.00
50,75,3,9,0.6667,0.060000,0.45101333,0.91400000,0.00
50,75,3,9,0.6667,0.068571,0.47332000,0.95300000,0.00
50,75,3,9,0.6667,0.077143,0.46954667,0.96000000,0.00
50,75,3,9,0.6667,0.085714,0.47985333,0.98400000,0.00
50,75,3,9,0.6667,0.094286,0.48470667,0.98600000,0.00
50,75,3,9,0.6667,0.102857,0.49201333,0.99400000,0.00
50,75,3,9,0.6667,0.111429,0.49064000,0.99400000,0.00
50,75,3,9,0.6667,0.120000,0.49248000,0.99800000,0.00
200,400,3,6,0.5000,0.000000,0.00000000,0.00000000,0.00
200,400,3,6,0.5000,0.008571,0.30167250,0.60100000,0.00
200,400,3,6,0.5000,0.017143,0.36523750,0.73200000,0.00
200,400,3,6,0.5000,0.025714,0.43035000,0.86000000,0.00
200,400,3,6,0.5000,0.034286,0.46297500,0.92400000,0.00
200,400,3,6,0.5000,0.042857,0.49018000,0.98000000,0.00
200,400,3,6,0.5000,0.051429,0.49391000,0.98900000,0.00
200,400,3,6,0.5000,0.060000,0.49773500,0.99700000,0.00
200,400,3,6,0.5000,0.068571,0.49869750,0.99700000,0.00
200,400,3,6,0.5000,0.077143,0.50014500,1.00000000,50.00
200,400,3,6,0.5000,0.085714,0.49800500,1.00000000,50.00
200,400,3,6,0.5000,0.094286,0.50103250,1.00000000,50.00
200,400,3,6,0.5000,0.102857,0.50059000,1.00000000,50.00
200,400,3,6,0.5000,0.111429,0.49997500,1.00000000,50.00
200,400,3,6,0.5000,0.120000,0.49996000,1.00000000,50.00
200,300,3,9,0.6667,0.000000,0.00000000,0.00000000,0.00
200,300,3,9,0.6667,0.008571,0.27226333,0.54500000,0.00
200,300,3,9,0.6667,0.017143,0.38370000,0.77100000,0.00
200,300,3,9,0.6667,0.025714,0.45723000,0.91600000,0.00
200,300,3,9,0.6667,0.034286,0.48475000,0.97000000,0.00
200,300,3,9,0.6667,0.042857,0.49562667,0.99200000,0.00
200,300,3,9,0.6667,0.051429,0.49894000,0.99800000,0.00
200,300,3,9,0.6667,0.060000,0.50088333,1.00000000,50.00
200,300,3,9,0.6667,0.068571,0.49815667,1.00000000,50.00
200,300,3,9,0.6667,0.077143,0.50034000,1.00000000,50.00
200,300,3,9,0.6667,0.085714,0.49923333,1.00000000,50.00
200,300,3,9,0.6667,0.094286,0.50140000,1.00000000,50.00
200,300,3,9,0.6667,0.102857,0.49978333,1.00000000,50.00
200,300,3,9,0.6667,0.111429,0.50114333,1.00000000,50.00
200,300,3,9,0.6667,0.120000,0.50025667,1.00000000,50.00
400,800,3,6,0.5000,0.000000,0.00000000,0.00000000,0.00
400,800,3,6,0.5000,0.008571,0.32761250,0.65400000,0.00
400,800,3,6,0.5000,0.017143,0.41412625,0.82000000,0.00
400,800,3,6,0.5000,0.025714,0.46907375,0.92900000,0.00
400,800,3,6,0.5000,0.034286,0.48519375,0.96900000,0.00
400,800,3,6,0.5000,0.042857,0.49841750,0.99300000,0.00
400,800,3,6,0.5000,0.051429,0.50101500,1.00000000,50.00
400,800,3,6,0.5000,0.060000,0.49914250,1.00000000,50.00
400,800,3,6,0.5000,0.068571,0.49955625,1.00000000,50.00
400,800,3,6,0.5000,0.077143,0.49976500,1.00000000,50.00
400,800,3,6,0.5000,0.085714,0.50057750,1.00000000,50.00
400,800,3,6,0.5000,0.094286,0.50094625,1.00000000,50.00
400,800,3,6,0.5000,0.102857,0.50099250,1.00000000,50.00
400,800,3,6,0.5000,0.111429,0.50017125,1.00000000,50.00
400,800,3,6,0.5000,0.120000,0.49992750,1.00000000,50.00
400,600,3,9,0.6667,0.000000,0.00000000,0.00000000,0.00
400,600,3,9,0.6667,0.008571,0.35087667,0.70300000,0.00
400,600,3,9,0.6667,0.017143,0.43971000,0.88200000,0.00
400,600,3,9,0.6667,0.025714,0.48824167,0.97500000,0.00
400,600,3,9,0.6667,0.034286,0.49763833,0.99600000,0.00
400,600,3,9,0.6667,0.042857,0.49956833,1.00000000,50.00
400,600,3,9,0.6667,0.051429,0.49943667,1.00000000,50.00
400,600,3,9,0.6667,0.060000,0.50025667,1.00000000,50.00
400,600,3,9,0.6667,0.068571,0.49899333,1.00000000,50.00
400,600,3,9,0.6667,0.077143,0.49918333,1.00000000,50.00
400,600,3,9,0.6667,0.085714,0.50041833,1.00000000,50.00
400,600,3,9,0.6667,0.094286,0.49998167,1.00000000,50.00
400,600,3,9,0.6667,0.102857,0.50129000,1.00000000,50.00
400,600,3,9,0.6667,0.111429,0.49973500,1.00000000,50.00
400,600,3,9,0.6667,0.120000,0.50078833,1.00000000,50.00
1 k n wc wr rate p ber fer avg_iter
2 50 100 3 6 0.5000 0.000000 0.00000000 0.00000000 0.00
3 50 100 3 6 0.5000 0.008571 0.09586000 0.21200000 0.00
4 50 100 3 6 0.5000 0.017143 0.20772000 0.44500000 0.00
5 50 100 3 6 0.5000 0.025714 0.28084000 0.58700000 0.00
6 50 100 3 6 0.5000 0.034286 0.35496000 0.74100000 0.00
7 50 100 3 6 0.5000 0.042857 0.39766000 0.82200000 0.00
8 50 100 3 6 0.5000 0.051429 0.42240000 0.87200000 0.00
9 50 100 3 6 0.5000 0.060000 0.44045000 0.91000000 0.00
10 50 100 3 6 0.5000 0.068571 0.45518000 0.93500000 0.00
11 50 100 3 6 0.5000 0.077143 0.47826000 0.97400000 0.00
12 50 100 3 6 0.5000 0.085714 0.48009000 0.98200000 0.00
13 50 100 3 6 0.5000 0.094286 0.48391000 0.98600000 0.00
14 50 100 3 6 0.5000 0.102857 0.48988000 0.99300000 0.00
15 50 100 3 6 0.5000 0.111429 0.49456000 0.99500000 0.00
16 50 100 3 6 0.5000 0.120000 0.49429000 0.99700000 0.00
17 50 75 3 9 0.6667 0.000000 0.00000000 0.00000000 0.00
18 50 75 3 9 0.6667 0.008571 0.07490667 0.14800000 0.00
19 50 75 3 9 0.6667 0.017143 0.17278667 0.34600000 0.00
20 50 75 3 9 0.6667 0.025714 0.27240000 0.54800000 0.00
21 50 75 3 9 0.6667 0.034286 0.34341333 0.69300000 0.00
22 50 75 3 9 0.6667 0.042857 0.39881333 0.81500000 0.00
23 50 75 3 9 0.6667 0.051429 0.43321333 0.88400000 0.00
24 50 75 3 9 0.6667 0.060000 0.45101333 0.91400000 0.00
25 50 75 3 9 0.6667 0.068571 0.47332000 0.95300000 0.00
26 50 75 3 9 0.6667 0.077143 0.46954667 0.96000000 0.00
27 50 75 3 9 0.6667 0.085714 0.47985333 0.98400000 0.00
28 50 75 3 9 0.6667 0.094286 0.48470667 0.98600000 0.00
29 50 75 3 9 0.6667 0.102857 0.49201333 0.99400000 0.00
30 50 75 3 9 0.6667 0.111429 0.49064000 0.99400000 0.00
31 50 75 3 9 0.6667 0.120000 0.49248000 0.99800000 0.00
32 200 400 3 6 0.5000 0.000000 0.00000000 0.00000000 0.00
33 200 400 3 6 0.5000 0.008571 0.30167250 0.60100000 0.00
34 200 400 3 6 0.5000 0.017143 0.36523750 0.73200000 0.00
35 200 400 3 6 0.5000 0.025714 0.43035000 0.86000000 0.00
36 200 400 3 6 0.5000 0.034286 0.46297500 0.92400000 0.00
37 200 400 3 6 0.5000 0.042857 0.49018000 0.98000000 0.00
38 200 400 3 6 0.5000 0.051429 0.49391000 0.98900000 0.00
39 200 400 3 6 0.5000 0.060000 0.49773500 0.99700000 0.00
40 200 400 3 6 0.5000 0.068571 0.49869750 0.99700000 0.00
41 200 400 3 6 0.5000 0.077143 0.50014500 1.00000000 50.00
42 200 400 3 6 0.5000 0.085714 0.49800500 1.00000000 50.00
43 200 400 3 6 0.5000 0.094286 0.50103250 1.00000000 50.00
44 200 400 3 6 0.5000 0.102857 0.50059000 1.00000000 50.00
45 200 400 3 6 0.5000 0.111429 0.49997500 1.00000000 50.00
46 200 400 3 6 0.5000 0.120000 0.49996000 1.00000000 50.00
47 200 300 3 9 0.6667 0.000000 0.00000000 0.00000000 0.00
48 200 300 3 9 0.6667 0.008571 0.27226333 0.54500000 0.00
49 200 300 3 9 0.6667 0.017143 0.38370000 0.77100000 0.00
50 200 300 3 9 0.6667 0.025714 0.45723000 0.91600000 0.00
51 200 300 3 9 0.6667 0.034286 0.48475000 0.97000000 0.00
52 200 300 3 9 0.6667 0.042857 0.49562667 0.99200000 0.00
53 200 300 3 9 0.6667 0.051429 0.49894000 0.99800000 0.00
54 200 300 3 9 0.6667 0.060000 0.50088333 1.00000000 50.00
55 200 300 3 9 0.6667 0.068571 0.49815667 1.00000000 50.00
56 200 300 3 9 0.6667 0.077143 0.50034000 1.00000000 50.00
57 200 300 3 9 0.6667 0.085714 0.49923333 1.00000000 50.00
58 200 300 3 9 0.6667 0.094286 0.50140000 1.00000000 50.00
59 200 300 3 9 0.6667 0.102857 0.49978333 1.00000000 50.00
60 200 300 3 9 0.6667 0.111429 0.50114333 1.00000000 50.00
61 200 300 3 9 0.6667 0.120000 0.50025667 1.00000000 50.00
62 400 800 3 6 0.5000 0.000000 0.00000000 0.00000000 0.00
63 400 800 3 6 0.5000 0.008571 0.32761250 0.65400000 0.00
64 400 800 3 6 0.5000 0.017143 0.41412625 0.82000000 0.00
65 400 800 3 6 0.5000 0.025714 0.46907375 0.92900000 0.00
66 400 800 3 6 0.5000 0.034286 0.48519375 0.96900000 0.00
67 400 800 3 6 0.5000 0.042857 0.49841750 0.99300000 0.00
68 400 800 3 6 0.5000 0.051429 0.50101500 1.00000000 50.00
69 400 800 3 6 0.5000 0.060000 0.49914250 1.00000000 50.00
70 400 800 3 6 0.5000 0.068571 0.49955625 1.00000000 50.00
71 400 800 3 6 0.5000 0.077143 0.49976500 1.00000000 50.00
72 400 800 3 6 0.5000 0.085714 0.50057750 1.00000000 50.00
73 400 800 3 6 0.5000 0.094286 0.50094625 1.00000000 50.00
74 400 800 3 6 0.5000 0.102857 0.50099250 1.00000000 50.00
75 400 800 3 6 0.5000 0.111429 0.50017125 1.00000000 50.00
76 400 800 3 6 0.5000 0.120000 0.49992750 1.00000000 50.00
77 400 600 3 9 0.6667 0.000000 0.00000000 0.00000000 0.00
78 400 600 3 9 0.6667 0.008571 0.35087667 0.70300000 0.00
79 400 600 3 9 0.6667 0.017143 0.43971000 0.88200000 0.00
80 400 600 3 9 0.6667 0.025714 0.48824167 0.97500000 0.00
81 400 600 3 9 0.6667 0.034286 0.49763833 0.99600000 0.00
82 400 600 3 9 0.6667 0.042857 0.49956833 1.00000000 50.00
83 400 600 3 9 0.6667 0.051429 0.49943667 1.00000000 50.00
84 400 600 3 9 0.6667 0.060000 0.50025667 1.00000000 50.00
85 400 600 3 9 0.6667 0.068571 0.49899333 1.00000000 50.00
86 400 600 3 9 0.6667 0.077143 0.49918333 1.00000000 50.00
87 400 600 3 9 0.6667 0.085714 0.50041833 1.00000000 50.00
88 400 600 3 9 0.6667 0.094286 0.49998167 1.00000000 50.00
89 400 600 3 9 0.6667 0.102857 0.50129000 1.00000000 50.00
90 400 600 3 9 0.6667 0.111429 0.49973500 1.00000000 50.00
91 400 600 3 9 0.6667 0.120000 0.50078833 1.00000000 50.00

View File

@ -0,0 +1,138 @@
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import sys
from matplotlib.colors import LogNorm
import matplotlib.ticker as ticker
sns.set_theme(style="whitegrid", context="talk")
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['figure.dpi'] = 300
def load_data(filename):
try:
df = pd.read_csv(filename)
df['Label'] = (
"k=" + df['k'].astype(str) +
" | Wc=" + df['wc'].astype(str) +
" | Wr=" + df['wr'].astype(str)
)
df = df.sort_values(by=['k', 'wc', 'wr'])
return df
except FileNotFoundError:
print(f"Erreur : Le fichier '{filename}' est introuvable.")
sys.exit(1)
def plot_1_waterfall_zoomed(df):
print(" -> Génération du Waterfall...")
plt.figure(figsize=(14, 9))
df_zoom = df[df['ber'] > 0].copy()
if df_zoom.empty:
print(" Pas d'erreurs trouvées, impossible de tracer.")
return
sns.lineplot(
data=df_zoom,
x='p',
y='ber',
hue='Label',
style='Label',
markers=True,
dashes=False,
linewidth=2.5,
palette="turbo",
markersize=9
)
plt.yscale('log')
ax = plt.gca()
ax.yaxis.set_major_locator(ticker.LogLocator(base=10.0, numticks=12))
plt.title("Vue Globale : Performance des configurations", fontweight='bold', pad=20)
plt.ylabel("BER [Log Scale]", labelpad=15)
plt.xlabel("Bruit du Canal (p)", labelpad=15)
plt.grid(True, which="both", ls="-", alpha=0.3)
plt.legend(bbox_to_anchor=(1.02, 1), loc='upper left', borderaxespad=0, title="Configuration", fontsize='x-small')
plt.tight_layout()
plt.savefig("Final_1_Waterfall.png")
def plot_2_ranking_bars(df):
print(" -> Génération du Classement...")
means = df.groupby('p')['ber'].mean()
target_p = means[means > 0.0001].first_valid_index()
if target_p is None:
target_p = df['p'].max()
subset = df[df['p'] == target_p].sort_values('ber', ascending=True)
plt.figure(figsize=(12, max(6, len(subset)*0.4)))
barplot = sns.barplot(
data=subset,
y='Label',
x='ber',
palette="viridis",
edgecolor=".2"
)
plt.xscale('log')
plt.title(f"Robustesse p={target_p:.3f} (Gauche = Meilleur)", fontweight='bold', pad=20)
plt.xlabel("BER", labelpad=10)
plt.ylabel("")
for i, container in enumerate(barplot.containers):
barplot.bar_label(container, fmt='%.1e', padding=5, fontsize=11)
plt.grid(True, axis='x', which="both", ls="--", alpha=0.5)
plt.tight_layout()
plt.savefig("Final_2_Classement.png")
def plot_3_heatmap_gradient(df):
print(" -> Génération de la Heatmap...")
pivot = df.pivot(index="Label", columns="p", values="ber")
pivot_log = pivot.replace(0, 1e-9)
plt.figure(figsize=(16, max(6, len(pivot)*0.5)))
ax = sns.heatmap(
pivot_log,
cmap="Spectral_r",
norm=LogNorm(vmin=1e-5, vmax=1),
cbar_kws={'label': 'BER (Log Scale)'},
linewidths=0.5,
linecolor='white'
)
plt.title("Résistance (Bleu=Zone de Confort, Rouge=Zone d'Échec)", fontweight='bold', pad=20)
plt.xlabel("Bruit du Canal (p)", labelpad=10)
plt.ylabel("")
plt.xticks(rotation=45)
plt.tight_layout()
plt.savefig("Final_3_Heatmap.png")
if __name__ == "__main__":
print("Démarrage de l'analyse graphique finale...")
df = load_data("ldpc_analysis_results.csv")
plot_1_waterfall_zoomed(df)
plot_2_ranking_bars(df)
plot_3_heatmap_gradient(df)
print("\nTerminé ! Trois images générées :")
print(" 1. Final_1_Waterfall.png (Courbes détaillées)")
print(" 2. Final_2_Classement.png (Comparatif barres)")
print(" 3. Final_3_Heatmap.png (Vision globale couleur)")