Fix: crypto/headlines missing Legend & wrong Chart Title (#1997)

* Update stockanalysis_model.py

* Update etf_controller.py

* Fix tests and linting

* 'Fixing #1978 by switching to check_positive_float'

* 'Fixes #1977 by switching labels'

* Fixes #1992 by modifying finbrain_crypto_view.py

* 'Changed the markers to white to avoid confusion'

Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
Co-authored-by: JerBouma <jer.bouma@gmail.com>
This commit is contained in:
soggyomelette
2022-06-28 16:44:50 +01:00
committed by GitHub
parent 2e7b54205f
commit 1fe1f8714f

View File

@@ -77,23 +77,14 @@ def display_crypto_sentiment_analysis(
(ax,) = external_axes
else:
return
for index, row in sentiment.iterrows():
if float(row["Sentiment Analysis"]) >= 0:
ax.scatter(
index, float(row["Sentiment Analysis"]), s=100, color=theme.up_color
)
else:
ax.scatter(
index,
float(row["Sentiment Analysis"]),
s=100,
color=theme.down_color,
)
ax.scatter(
index, float(row["Sentiment Analysis"]), s=75, color="white", zorder=3
)
ax.axhline(y=0, linestyle="--")
ax.set_xlabel("Time")
ax.set_ylabel("Finbrain's Sentiment Score")
start_date = sentiment.index[-1].strftime("%Y/%m/%d")
start_date = sentiment.index[0].strftime("%Y/%m/%d")
ax.set_title(f"FinBrain's Sentiment Analysis for {coin}-USD since {start_date}")
ax.set_ylim([-1.1, 1.1])
senValues = np.array(pd.to_numeric(sentiment["Sentiment Analysis"].values))
@@ -117,7 +108,6 @@ def display_crypto_sentiment_analysis(
interpolate=True,
)
theme.style_primary_axis(ax)
if external_axes is None:
theme.visualize_output()