diff --git a/analysis/map.py b/analysis/map.py index c47520a..4edccc1 100644 --- a/analysis/map.py +++ b/analysis/map.py @@ -300,4 +300,4 @@ if __name__ == "__main__": ## Save Maps ============================================================================================ save_map_as_html(toggle_map, "heat_map_toggle") - save_map_as_html(time_map, "heat_map_time") + save_map_as_html(time_map, "html/heat_map_time") diff --git a/analysis/plots.py b/analysis/plots.py index bc15213..55df4c7 100644 --- a/analysis/plots.py +++ b/analysis/plots.py @@ -73,6 +73,7 @@ def plt_acc_by_day_year(db): animation_frame='year', labels={'weekday': 'Weekday', 'count': 'Number of Accidents'}, category_orders={'weekday': ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']}, + orientation='h' ) fig.update_yaxes(range=[0, 1000]) # Customize the layout to include a slider @@ -137,9 +138,9 @@ def plt_acc_by_daytime(db): result = db.execute_query(acc_weekday_sql) result_df = pd.DataFrame(result) - fig = px.bar(result_df, y='hour', x='count', orientation='h') - fig.write_image("fig/acc_by_day.png") - fig.write_html("html/acc_by_day.html") + fig = px.bar(result_df, y='hour', x='count', orientation='h', title='Accidents by day') + fig.write_image("fig/acc_by_daytime.png") + fig.write_html("html/acc_by_daytime.html") # Time Series charts ================================================================================================== def acc_by_type(db):