Mpavan45 commited on
Commit
c753d85
·
verified ·
1 Parent(s): 6acb70a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -75,6 +75,13 @@ with right_col:
75
  except Exception as e:
76
  st.error(f"Error: {str(e)}")
77
 
 
 
 
 
 
 
 
78
  # Generate plot data
79
  x_vals = np.linspace(-10, 10, 400)
80
  y_vals = [evaluate_function(function_input, x) for x in x_vals]
@@ -122,6 +129,7 @@ plot.update_layout(
122
  yaxis_title="f(x)",
123
  template="plotly_dark",
124
  legend=dict(bgcolor="rgba(255,255,255,0.5)", bordercolor="gray", borderwidth=1),
 
125
  )
126
 
127
  # Display the plot in the right side (with more space now)
 
75
  except Exception as e:
76
  st.error(f"Error: {str(e)}")
77
 
78
+ # Display Iteration and Values below the plot
79
+ st.subheader("Iteration Details")
80
+ st.markdown(f"**Iteration:** {st.session_state.iter_count}")
81
+ st.markdown(f"**Current x Value:** {st.session_state.x_current:.4f}")
82
+ st.markdown(f"**Current Function Value (f(x)):** {st.session_state.y_points[-1]:.4f}")
83
+ st.markdown("---")
84
+
85
  # Generate plot data
86
  x_vals = np.linspace(-10, 10, 400)
87
  y_vals = [evaluate_function(function_input, x) for x in x_vals]
 
129
  yaxis_title="f(x)",
130
  template="plotly_dark",
131
  legend=dict(bgcolor="rgba(255,255,255,0.5)", bordercolor="gray", borderwidth=1),
132
+ height=500, # Reduce the graph height for better fitting
133
  )
134
 
135
  # Display the plot in the right side (with more space now)