aicodingfun commited on
Commit
08210c1
·
verified ·
1 Parent(s): 1145dc4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -146,7 +146,8 @@ def plot_price_and_sentiment(filtered_df, sentiment_col, sentiment_name, color):
146
  yaxis=dict(title='價格 (USD)', color='deepskyblue'),
147
  yaxis2=dict(title='情緒分數', overlaying='y', side='right', color=color, range=[-1, 1]),
148
  legend=dict(x=0.01, y=0.99, orientation='h'),
149
- template='plotly_dark', paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0.2)'
 
150
  )
151
  return fig
152
 
@@ -157,7 +158,8 @@ def plot_subjectivity_trend(filtered_df):
157
  # title='🧐 每日新聞主觀性趨勢',
158
  xaxis_title='日期',
159
  yaxis=dict(title='主觀性分數 (0=客觀, 1=主觀)', color='lightgreen', range=[0, 1]),
160
- template='plotly_dark', paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0.2)'
 
161
  )
162
  return fig
163
 
@@ -173,7 +175,8 @@ def plot_correlation(filtered_df, sentiment_col, lag_days):
173
  fig.update_layout(
174
  title=f'🔗 情緒與 {lag_days} 天後價格變化的關聯性 (相關係數: {correlation:.3f})',
175
  xaxis_title='每日平均情緒分數', yaxis_title=f'{lag_days} 天後價格變化 (%)',
176
- template='plotly_dark', paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0.2)'
 
177
  )
178
  return fig, correlation, p_value
179
 
 
146
  yaxis=dict(title='價格 (USD)', color='deepskyblue'),
147
  yaxis2=dict(title='情緒分數', overlaying='y', side='right', color=color, range=[-1, 1]),
148
  legend=dict(x=0.01, y=0.99, orientation='h'),
149
+ # template='plotly_dark',
150
+ paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0.2)'
151
  )
152
  return fig
153
 
 
158
  # title='🧐 每日新聞主觀性趨勢',
159
  xaxis_title='日期',
160
  yaxis=dict(title='主觀性分數 (0=客觀, 1=主觀)', color='lightgreen', range=[0, 1]),
161
+ # template='plotly_dark',
162
+ paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0.2)'
163
  )
164
  return fig
165
 
 
175
  fig.update_layout(
176
  title=f'🔗 情緒與 {lag_days} 天後價格變化的關聯性 (相關係數: {correlation:.3f})',
177
  xaxis_title='每日平均情緒分數', yaxis_title=f'{lag_days} 天後價格變化 (%)',
178
+ # template='plotly_dark',
179
+ paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0.2)'
180
  )
181
  return fig, correlation, p_value
182