Skip to content

Commit

Permalink
small changes in plot_multiple_aggregation_evolution so the data is r…
Browse files Browse the repository at this point in the history
…eindexed before joining
  • Loading branch information
cparcerisas committed Oct 20, 2023
1 parent 17fa191 commit bd99aca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pypam/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ def _prepare_aggregation_plot_data(ds, data_var, aggregation_freq_band=None, agg
aggregation_freq_band=aggregation_freq_band,
freq_coord=freq_coord)
df_plot = ds_copy[data_var].to_dataframe()
df_plot = df_plot.reset_index(drop=True)
df_plot['aggregated_time'] = pd.to_datetime(ds_copy[datetime_coord].values).to_period(aggregation_time).start_time

return df_plot
Expand Down Expand Up @@ -656,7 +657,7 @@ def plot_multiple_aggregation_evolution(ds_dict, data_var, mode, save_path=None,
aggregation_time=aggregation_time, freq_coord=freq_coord,
datetime_coord=datetime_coord)
df_plot['Data series'] = label
total_df = pd.concat([total_df, df_plot])
total_df = pd.concat([total_df, df_plot], ignore_index=True)

kwargs.update({'hue': 'Data series'})
_plot_aggregation_evolution(total_df, data_var, standard_name=ds[data_var].standard_name, units=ds[data_var].units,
Expand Down

0 comments on commit bd99aca

Please sign in to comment.