Update app.py
Browse files
app.py
CHANGED
@@ -113,20 +113,20 @@ def predict_and_plot(velocity, temperature, precipitation, humidity):
|
|
113 |
cleaning_times = calculate_cleaning_time(time_intervals, simulated_contamination_levels)
|
114 |
|
115 |
# Lidar names
|
116 |
-
lidar_names = ['
|
117 |
|
118 |
# Plot the graph
|
119 |
fig, ax = plt.subplots(figsize=(12, 8))
|
120 |
|
121 |
for i in range(simulated_contamination_levels.shape[1]):
|
122 |
ax.plot(time_intervals, simulated_contamination_levels[:, i], label=f'{lidar_names[i]}')
|
123 |
-
ax.axhline(y=0.4, color='r', linestyle='--', label='
|
124 |
if i < len(cleaning_times):
|
125 |
ax.scatter(cleaning_times[i], 0.4, color='k') # Mark the cleaning time point
|
126 |
|
127 |
-
ax.set_title('
|
128 |
-
ax.set_xlabel('
|
129 |
-
ax.set_ylabel('
|
130 |
ax.legend()
|
131 |
ax.grid(True)
|
132 |
|
|
|
113 |
cleaning_times = calculate_cleaning_time(time_intervals, simulated_contamination_levels)
|
114 |
|
115 |
# Lidar names
|
116 |
+
lidar_names = ['F/L', 'F/R', 'Left', 'Right', 'Roof', 'Rear']
|
117 |
|
118 |
# Plot the graph
|
119 |
fig, ax = plt.subplots(figsize=(12, 8))
|
120 |
|
121 |
for i in range(simulated_contamination_levels.shape[1]):
|
122 |
ax.plot(time_intervals, simulated_contamination_levels[:, i], label=f'{lidar_names[i]}')
|
123 |
+
ax.axhline(y=0.4, color='r', linestyle='--', label='Contamination Threshold' if i == 0 else "")
|
124 |
if i < len(cleaning_times):
|
125 |
ax.scatter(cleaning_times[i], 0.4, color='k') # Mark the cleaning time point
|
126 |
|
127 |
+
ax.set_title('Contamination Levels Over Time for Each Lidar')
|
128 |
+
ax.set_xlabel('Time (seconds)')
|
129 |
+
ax.set_ylabel('Contamination Level')
|
130 |
ax.legend()
|
131 |
ax.grid(True)
|
132 |
|