From 1fe1f8714f844feded883c4473d3f1ea0838e54d Mon Sep 17 00:00:00 2001 From: soggyomelette <85685255+soggyomelette@users.noreply.github.com> Date: Tue, 28 Jun 2022 16:44:50 +0100 Subject: [PATCH] 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 Co-authored-by: JerBouma --- .../due_diligence/finbrain_crypto_view.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/openbb_terminal/cryptocurrency/due_diligence/finbrain_crypto_view.py b/openbb_terminal/cryptocurrency/due_diligence/finbrain_crypto_view.py index 98a33416092..7bbc1cd00b8 100644 --- a/openbb_terminal/cryptocurrency/due_diligence/finbrain_crypto_view.py +++ b/openbb_terminal/cryptocurrency/due_diligence/finbrain_crypto_view.py @@ -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()