Flux9665 commited on
Commit
dc6fc47
β€’
1 Parent(s): d3d5ad6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -11,7 +11,7 @@ def plot_scalar_on_scale(scalar_value, distance_type):
11
  scalar_value = np.clip(scalar_value, 0.0, 1.0)
12
 
13
  # Create a figure and axis
14
- fig, ax = plt.subplots(figsize=(10, 3))
15
 
16
  # Create a horizontal gradient (from close to distant)
17
  gradient = np.linspace(0, 1, 256).reshape(1, -1)
@@ -23,11 +23,11 @@ def plot_scalar_on_scale(scalar_value, distance_type):
23
  # Add a dot at the scalar position
24
  ax.plot(scalar_value, 0.5, 'o', color='white', markersize=42)
25
 
26
- ax.text(scalar_value, 0.5, f'{scalar_value:.2f}', color='black', ha='center', va='center', fontsize=16, fontweight='bold')
27
 
28
  # Add labels rotated 90 degrees on the sides
29
- ax.text(-0.03, 0.5, 'Close', ha='center', va='center', fontsize=18, rotation=90)
30
- ax.text(1.03, 0.5, 'Distant', ha='center', va='center', fontsize=18, rotation=270)
31
 
32
  # Customize the axis
33
  ax.set_xticks([]) # Remove x-axis ticks
 
11
  scalar_value = np.clip(scalar_value, 0.0, 1.0)
12
 
13
  # Create a figure and axis
14
+ fig, ax = plt.subplots(figsize=(8, 2))
15
 
16
  # Create a horizontal gradient (from close to distant)
17
  gradient = np.linspace(0, 1, 256).reshape(1, -1)
 
23
  # Add a dot at the scalar position
24
  ax.plot(scalar_value, 0.5, 'o', color='white', markersize=42)
25
 
26
+ ax.text(scalar_value, 0.5, f'{scalar_value:.2f}', color='black', ha='center', va='center', fontsize=14)
27
 
28
  # Add labels rotated 90 degrees on the sides
29
+ ax.text(-0.03, 0.5, 'Close', ha='center', va='center', fontsize=14, rotation=90)
30
+ ax.text(1.03, 0.5, 'Distant', ha='center', va='center', fontsize=14, rotation=270)
31
 
32
  # Customize the axis
33
  ax.set_xticks([]) # Remove x-axis ticks