Spaces:
Sleeping
Sleeping
ce-dric
commited on
Commit
·
776951a
1
Parent(s):
bfb3838
update append legend
Browse files
app.py
CHANGED
@@ -23,12 +23,18 @@ if len(uploaded_files) == 3:
|
|
23 |
|
24 |
plt.figure(figsize=(10, 6))
|
25 |
line_styles = ['-', '--', '-.']
|
26 |
-
colors = ['b', 'g', 'r']
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
30 |
plt.xlabel('Pixel Position')
|
31 |
plt.ylabel('Pixel Value')
|
32 |
plt.title('Comparison of Scan Lines Across Images')
|
33 |
plt.legend(loc='upper left')
|
34 |
st.pyplot(plt)
|
|
|
|
23 |
|
24 |
plt.figure(figsize=(10, 6))
|
25 |
line_styles = ['-', '--', '-.']
|
26 |
+
colors = ['b', 'g', 'r']
|
27 |
+
|
28 |
+
for i, scan_line in enumerate(scan_lines):
|
29 |
+
file_name = uploaded_files[i].name
|
30 |
+
style = line_styles[i % len(line_styles)]
|
31 |
+
color = colors[i % len(colors)]
|
32 |
+
|
33 |
+
plt.plot(scan_line, label=file_name, linestyle=style, color=color, alpha=0.7, linewidth=1.5)
|
34 |
+
|
35 |
plt.xlabel('Pixel Position')
|
36 |
plt.ylabel('Pixel Value')
|
37 |
plt.title('Comparison of Scan Lines Across Images')
|
38 |
plt.legend(loc='upper left')
|
39 |
st.pyplot(plt)
|
40 |
+
|