samarthv commited on
Commit
a3f6dd5
1 Parent(s): d3529cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -50,20 +50,18 @@ st.markdown(
50
 
51
  # Display the graphs and table if the submit button is clicked
52
  if display_graphs:
53
- # Create subplots
54
- fig, axes = plt.subplots(3, 1, figsize=(10, 15))
55
 
56
  # Plot 1: Actual and Predicted Stock Prices
57
  axes[0].plot(selected_data['Date'], y, label='Actual')
58
  axes[0].plot(selected_data['Date'], model.predict(X), label='Predicted')
59
- axes[0].set_xlabel('Date')
60
  axes[0].set_ylabel('Stock Price')
61
  axes[0].set_title(f'{selected_dataset} Stock Price Prediction')
62
  axes[0].legend()
63
 
64
  # Plot 2: Volume of Trades
65
  axes[1].plot(selected_data['Date'], selected_data['Volume'])
66
- axes[1].set_xlabel('Date')
67
  axes[1].set_ylabel('Volume')
68
  axes[1].set_title(f'{selected_dataset} Volume of Trades')
69
 
@@ -93,4 +91,3 @@ if display_graphs:
93
  st.subheader("Price Details and Predicted Prices")
94
  price_table = pd.DataFrame({'Date': selected_data['Date'], 'Actual Price': y, 'Predicted Price': model.predict(X)})
95
  st.dataframe(price_table)
96
-
 
50
 
51
  # Display the graphs and table if the submit button is clicked
52
  if display_graphs:
53
+ # Create subplots with increased spacing between subplots
54
+ fig, axes = plt.subplots(3, 1, figsize=(10, 20), sharex=True, gridspec_kw={'hspace': 0.5})
55
 
56
  # Plot 1: Actual and Predicted Stock Prices
57
  axes[0].plot(selected_data['Date'], y, label='Actual')
58
  axes[0].plot(selected_data['Date'], model.predict(X), label='Predicted')
 
59
  axes[0].set_ylabel('Stock Price')
60
  axes[0].set_title(f'{selected_dataset} Stock Price Prediction')
61
  axes[0].legend()
62
 
63
  # Plot 2: Volume of Trades
64
  axes[1].plot(selected_data['Date'], selected_data['Volume'])
 
65
  axes[1].set_ylabel('Volume')
66
  axes[1].set_title(f'{selected_dataset} Volume of Trades')
67
 
 
91
  st.subheader("Price Details and Predicted Prices")
92
  price_table = pd.DataFrame({'Date': selected_data['Date'], 'Actual Price': y, 'Predicted Price': model.predict(X)})
93
  st.dataframe(price_table)