devendergarg14 commited on
Commit
cdd703d
·
verified ·
1 Parent(s): e8edd35

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -155,7 +155,8 @@ def interpolate_and_plot(x_input, y_input, x_predict, method, plot_title, x_labe
155
  x_predict = float(x_predict)
156
  if x_predict < min(x) or x_predict > max(x):
157
  error_msg = f"Error: Prediction x value must be between {min(x)} and {max(x)}."
158
- return f'<p style="color: red;">{error_msg}</p>'
 
159
  #return create_error_plot(error_msg), f'<p style="color: red;">{error_msg}</p>'
160
 
161
  y_predict = np.interp(x_predict, x_interp, y_interp)
 
155
  x_predict = float(x_predict)
156
  if x_predict < min(x) or x_predict > max(x):
157
  error_msg = f"Error: Prediction x value must be between {min(x)} and {max(x)}."
158
+ fig = create_and_edit_plot(x, y, x_interp, y_interp, method, plot_title, x_label, y_label, legend_position, label_size, log_x)
159
+ return fig, f'<p style="color: red;">{error_msg}</p>'
160
  #return create_error_plot(error_msg), f'<p style="color: red;">{error_msg}</p>'
161
 
162
  y_predict = np.interp(x_predict, x_interp, y_interp)