LakshmiHarika commited on
Commit
e1cfe74
·
verified ·
1 Parent(s): 6708e46

Update pages/Data Collection.py

Browse files
Files changed (1) hide show
  1. pages/Data Collection.py +4 -5
pages/Data Collection.py CHANGED
@@ -314,12 +314,11 @@ elif st.session_state.current_page == "explore_images_video":
314
 
315
 
316
  # Visualization for Grid-Like Structure
317
- st.write("<h4 style='color: #BB3385;'>Image as a Grid Structure</h4>", unsafe_allow_html=True)
318
- height, width = 6,6
319
  grid = np.random.rand(height, width)
320
 
321
  # Adjust the figure size to make the plot very small
322
- fig, ax = plt.subplots(figsize=(3, 3)) # Even smaller figure size
323
  cax = ax.imshow(grid, cmap='viridis', interpolation='nearest')
324
 
325
  # Annotate the grid with pixel labels
@@ -328,7 +327,7 @@ elif st.session_state.current_page == "explore_images_video":
328
  ax.text(j, i, f'{grid[i, j]:.2f}', ha='center', va='center', color='white', fontsize=4) # Smaller fontsize
329
 
330
  # Set axis labels and title
331
- ax.set_title("Image as a Grid-Like Structure", fontsize=6) # Smaller title size
332
  ax.set_xlabel("Width (Pixels)", fontsize=4) # Smaller label size
333
  ax.set_ylabel("Height (Pixels)", fontsize=4) # Smaller label size
334
  ax.set_xticks(range(width))
@@ -338,7 +337,7 @@ elif st.session_state.current_page == "explore_images_video":
338
  ax.grid(color='white', linestyle='-', linewidth=0.5) # Thinner grid lines
339
 
340
  # Color bar setup without fontsize argument
341
- cbar = fig.colorbar(cax, ax=ax, orientation='vertical', label='Pixel Value')
342
  cbar.ax.tick_params(labelsize=4) # Adjust the font size of the color bar
343
 
344
  # Display the plot
 
314
 
315
 
316
  # Visualization for Grid-Like Structure
317
+ height, width = 3,3
 
318
  grid = np.random.rand(height, width)
319
 
320
  # Adjust the figure size to make the plot very small
321
+ fig, ax = plt.subplots(figsize=(2,2)) # Even smaller figure size
322
  cax = ax.imshow(grid, cmap='viridis', interpolation='nearest')
323
 
324
  # Annotate the grid with pixel labels
 
327
  ax.text(j, i, f'{grid[i, j]:.2f}', ha='center', va='center', color='white', fontsize=4) # Smaller fontsize
328
 
329
  # Set axis labels and title
330
+ ax.set_title("Image as a Grid-Like Structure", fontsize=5) # Smaller title size
331
  ax.set_xlabel("Width (Pixels)", fontsize=4) # Smaller label size
332
  ax.set_ylabel("Height (Pixels)", fontsize=4) # Smaller label size
333
  ax.set_xticks(range(width))
 
337
  ax.grid(color='white', linestyle='-', linewidth=0.5) # Thinner grid lines
338
 
339
  # Color bar setup without fontsize argument
340
+ cbar = fig.colorbar(cax, ax=ax, orientation='vertical')
341
  cbar.ax.tick_params(labelsize=4) # Adjust the font size of the color bar
342
 
343
  # Display the plot