ce-dric commited on
Commit
776951a
·
1 Parent(s): bfb3838

update append legend

Browse files
Files changed (1) hide show
  1. app.py +10 -4
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
- for i, (line, file) in enumerate(zip(scan_lines, uploaded_files)):
28
- plt.plot(line, label=f'{file.name}', linestyle=line_styles[i % len(line_styles)], color=colors[i % len(colors)], alpha=0.7, linewidth=1.5)
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
+