updated plot margins, improving arragements.

This commit is contained in:
2025-07-31 13:47:31 +02:00
parent bd18e8f85f
commit c3230e4615

12
app.py
View File

@@ -248,14 +248,14 @@ def create_elevation_plot(df):
fig = go.Figure(data=traces) fig = go.Figure(data=traces)
fig.update_layout( fig.update_layout(
title='Höhenprofil relativ zum Startwert', title=dict(text='Höhenprofil relativ zum Startwert', font=dict(size=16)),
xaxis_title='Zeit', xaxis_title='Zeit',
yaxis_title='Höhe relativ zum Start (m)', yaxis_title='Höhe relativ zum Start (m)',
template='plotly_dark', template='plotly_dark',
paper_bgcolor='#1e1e1e', paper_bgcolor='#1e1e1e',
plot_bgcolor='#111111', plot_bgcolor='#111111',
font=dict(color='white'), font=dict(color='white'),
margin=dict(l=40, r=20, t=50, b=40), margin=dict(l=40, r=40, t=50, b=40),
height=500 height=500
) )
return fig return fig
@@ -273,7 +273,6 @@ def create_deviation_plot(df): #Distanz-Zeit-Diagramm
df, df,
x='time_loc', x='time_loc',
y='del_dist_km_qmean', y='del_dist_km_qmean',
title='Abweichung von integrierter Durchschnittsgeschwindigkeit',
labels={ labels={
'time_loc': 'Zeit', 'time_loc': 'Zeit',
'del_dist_km_qmean': 'Δ Strecke (km)' 'del_dist_km_qmean': 'Δ Strecke (km)'
@@ -281,6 +280,7 @@ def create_deviation_plot(df): #Distanz-Zeit-Diagramm
template='plotly_dark', template='plotly_dark',
) )
fig.update_layout( fig.update_layout(
title=dict(text='Abweichung von integrierter Durchschnittsgeschwindigkeit', font=dict(size=16)),
yaxis_title='Abweichung (km)', yaxis_title='Abweichung (km)',
xaxis_title='Zeit', xaxis_title='Zeit',
height=400, height=400,
@@ -314,7 +314,7 @@ def create_speed_plot(df):
line=dict(color='royalblue') line=dict(color='royalblue')
)) ))
fig.update_layout( fig.update_layout(
title=f'Geschwindigkeit über die Zeit (geglättet) (∅: {mean_speed_kmh:.2f} km/h)', title=dict(text=f'Geschwindigkeit über die Zeit (geglättet) (∅: {mean_speed_kmh:.2f} km/h)', font=dict(size=16)),
xaxis=dict(title='Zeit', tickformat='%H:%M', type='date'), xaxis=dict(title='Zeit', tickformat='%H:%M', type='date'),
yaxis=dict(title='Geschwindigkeit (km/h)', rangemode='tozero'), yaxis=dict(title='Geschwindigkeit (km/h)', rangemode='tozero'),
template='plotly_dark', template='plotly_dark',
@@ -380,7 +380,7 @@ def create_pace_bars_plot(df):
)) ))
fig.update_layout( fig.update_layout(
title='Pace (min/km) je Kilometer', title=dict(text='Pace (min/km) je Kilometer', font=dict(size=16)),
xaxis_title='Distanz (km)', xaxis_title='Distanz (km)',
yaxis_title='Minuten pro km', yaxis_title='Minuten pro km',
barmode='overlay', barmode='overlay',
@@ -395,7 +395,7 @@ def create_pace_bars_plot(df):
), ),
template='plotly_dark', template='plotly_dark',
height=400, height=400,
margin=dict(l=40, r=20, t=20, b=40), margin=dict(l=40, r=40, t=30, b=40),
plot_bgcolor='#111111', plot_bgcolor='#111111',
paper_bgcolor='#1e1e1e', paper_bgcolor='#1e1e1e',
font=dict(color='white') font=dict(color='white')