From 656da533167eba9fb50e4ce3bed06f4103e1e2c4 Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Mon, 23 Jun 2025 11:43:48 +0200 Subject: [PATCH] Aggiunta generazione grafico --- Fotovoltaico.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Fotovoltaico.py b/Fotovoltaico.py index 06188e0..0597aa3 100644 --- a/Fotovoltaico.py +++ b/Fotovoltaico.py @@ -53,7 +53,18 @@ result_ac_energies_to_csv_df = suppress_printing(simulate_unstacked_productivity print("Valore massimo:",max(result_ac_energies_to_csv_df.gen_pv_100_kWp)) # print the maximum value of the generated energy print("Somma totale:",sum(result_ac_energies_to_csv_df.gen_pv_100_kWp)) # print the total sum of the generated energy result_ac_energies_to_csv_df.to_csv(path_export, encoding='utf-8') -os.startfile(path_export) + +# GENERAZIONE GRAFICO +import plotly.express as px +# Supponendo che la colonna di interesse sia 'gen_pv_100_kWp' +fig = px.line( + result_ac_energies_to_csv_df, + x=result_ac_energies_to_csv_df.index, + y='gen_pv_100_kWp', + title='Produttività Fotovoltaica nel Tempo', + labels={'gen_pv_100_kWp': 'Energia [kWh]', 'index': 'Data/Ora'} +) +fig.show() if joePlaying: joe.terminate()