diff --git a/gamestonk_terminal/economy/alphavantage_view.py b/gamestonk_terminal/economy/alphavantage_view.py index effef99d1ec..b380b3b23c5 100644 --- a/gamestonk_terminal/economy/alphavantage_view.py +++ b/gamestonk_terminal/economy/alphavantage_view.py @@ -5,6 +5,7 @@ from typing import List, Optional import logging import os +import matplotlib import matplotlib.pyplot as plt from gamestonk_terminal.decorators import check_api_key from gamestonk_terminal.config_terminal import theme @@ -48,6 +49,8 @@ def realtime_performance_sector( # pylint: disable=invalid-sequence-index df_rtp = df_sectors["Rank A: Real-Time Performance"] + df_rtp = df_rtp.apply(lambda x: x * 100) + if raw: print_rich_table( df_rtp.to_frame(), @@ -61,6 +64,7 @@ def realtime_performance_sector( theme.style_primary_axis(ax) ax.set_title("Real Time Performance (%) per Sector") ax.tick_params(axis="x", labelrotation=90) + ax.xaxis.set_major_formatter(matplotlib.ticker.FormatStrFormatter("%.2f")) if external_axes is None: theme.visualize_output() diff --git a/tests/gamestonk_terminal/economy/txt/test_alphavantage_view/test_realtime_performance_sector[True0].txt b/tests/gamestonk_terminal/economy/txt/test_alphavantage_view/test_realtime_performance_sector[True0].txt index 89b478e54b7..9d934acb4c2 100644 --- a/tests/gamestonk_terminal/economy/txt/test_alphavantage_view/test_realtime_performance_sector[True0].txt +++ b/tests/gamestonk_terminal/economy/txt/test_alphavantage_view/test_realtime_performance_sector[True0].txt @@ -1,12 +1,12 @@ Rank A: Real-Time Performance -Consumer Staples 0.0002 -Real Estate -0.0004 -Utilities -0.0018 -Industrials -0.0097 -Health Care -0.0106 -Information Technology -0.0193 -Energy -0.0195 -Financials -0.0202 -Materials -0.0249 -Consumer Discretionary -0.0310 -Communication Services -0.0388 +Consumer Staples 0.02 +Real Estate -0.04 +Utilities -0.18 +Industrials -0.97 +Health Care -1.06 +Information Technology -1.93 +Energy -1.95 +Financials -2.02 +Materials -2.49 +Consumer Discretionary -3.10 +Communication Services -3.88 diff --git a/tests/gamestonk_terminal/economy/txt/test_alphavantage_view/test_realtime_performance_sector[True1].txt b/tests/gamestonk_terminal/economy/txt/test_alphavantage_view/test_realtime_performance_sector[True1].txt index 89b478e54b7..9d934acb4c2 100644 --- a/tests/gamestonk_terminal/economy/txt/test_alphavantage_view/test_realtime_performance_sector[True1].txt +++ b/tests/gamestonk_terminal/economy/txt/test_alphavantage_view/test_realtime_performance_sector[True1].txt @@ -1,12 +1,12 @@ Rank A: Real-Time Performance -Consumer Staples 0.0002 -Real Estate -0.0004 -Utilities -0.0018 -Industrials -0.0097 -Health Care -0.0106 -Information Technology -0.0193 -Energy -0.0195 -Financials -0.0202 -Materials -0.0249 -Consumer Discretionary -0.0310 -Communication Services -0.0388 +Consumer Staples 0.02 +Real Estate -0.04 +Utilities -0.18 +Industrials -0.97 +Health Care -1.06 +Information Technology -1.93 +Energy -1.95 +Financials -2.02 +Materials -2.49 +Consumer Discretionary -3.10 +Communication Services -3.88