LakshmiHarika commited on
Commit
495565f
·
verified ·
1 Parent(s): 1a2abba

Update pages/Data Collection.py

Browse files
Files changed (1) hide show
  1. pages/Data Collection.py +10 -10
pages/Data Collection.py CHANGED
@@ -321,25 +321,25 @@ elif st.session_state.current_page == "explore_images_video":
321
  height, width = 6, 6
322
  grid = np.random.rand(height, width)
323
 
324
- # Adjust the figure size to make the plot smaller
325
- fig, ax = plt.subplots(figsize=(4, 4)) # Smaller figure size
326
  cax = ax.imshow(grid, cmap='viridis')
327
 
328
  # Annotate the grid with pixel labels
329
  for i in range(height):
330
  for j in range(width):
331
- ax.text(j, i, f'{grid[i, j]:.2f}', ha='center', va='center', color='white', fontsize=6) # Adjusted fontsize
332
 
333
  # Set axis labels and title
334
- ax.set_title("Image as a Grid-Like Structure", fontsize=6) # Adjusted title size
335
- ax.set_xlabel("Width (Pixels)", fontsize=6) # Adjusted label size
336
- ax.set_ylabel("Height (Pixels)", fontsize=6) # Adjusted label size
337
  ax.set_xticks(range(width))
338
  ax.set_yticks(range(height))
339
- ax.set_xticklabels([f'Col {j+1}' for j in range(width)], fontsize=5) # Adjusted label size
340
- ax.set_yticklabels([f'Row {i+1}' for i in range(height)], fontsize=5) # Adjusted label size
341
- ax.grid(color='white', linestyle='-', linewidth=1)
342
- fig.colorbar(cax, ax=ax, orientation='vertical', label='Pixel Value')
343
 
344
  # Display the plot
345
  st.pyplot(fig)
 
321
  height, width = 6, 6
322
  grid = np.random.rand(height, width)
323
 
324
+ # Adjust the figure size to make the plot very small
325
+ fig, ax = plt.subplots(figsize=(3, 3)) # Even smaller figure size
326
  cax = ax.imshow(grid, cmap='viridis')
327
 
328
  # Annotate the grid with pixel labels
329
  for i in range(height):
330
  for j in range(width):
331
+ ax.text(j, i, f'{grid[i, j]:.2f}', ha='center', va='center', color='white', fontsize=4) # Smaller fontsize
332
 
333
  # Set axis labels and title
334
+ ax.set_title("Image as a Grid-Like Structure", fontsize=6) # Smaller title size
335
+ ax.set_xlabel("Width (Pixels)", fontsize=4) # Smaller label size
336
+ ax.set_ylabel("Height (Pixels)", fontsize=4) # Smaller label size
337
  ax.set_xticks(range(width))
338
  ax.set_yticks(range(height))
339
+ ax.set_xticklabels([f'Col {j+1}' for j in range(width)], fontsize=4) # Smaller label size
340
+ ax.set_yticklabels([f'Row {i+1}' for i in range(height)], fontsize=4) # Smaller label size
341
+ ax.grid(color='white', linestyle='-', linewidth=0.5) # Thinner grid lines
342
+ fig.colorbar(cax, ax=ax, orientation='vertical', label='Pixel Value', fontsize=4)
343
 
344
  # Display the plot
345
  st.pyplot(fig)