diff --git a/gamestonk_terminal/screener/screener_controller.py b/gamestonk_terminal/screener/screener_controller.py index 4c1e8467969..40640cc6d8b 100644 --- a/gamestonk_terminal/screener/screener_controller.py +++ b/gamestonk_terminal/screener/screener_controller.py @@ -4,6 +4,7 @@ __docformat__ = "numpy" import os import argparse from typing import List +import matplotlib.pyplot as plt from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal.helper_funcs import get_flair from gamestonk_terminal.menu import session @@ -237,6 +238,8 @@ def menu(): an_input = input(f"{get_flair()} (scr)> ") try: + plt.close("all") + process_input = scr_controller.switch(an_input) if process_input is not None: diff --git a/gamestonk_terminal/screener/yahoo_finance_view.py b/gamestonk_terminal/screener/yahoo_finance_view.py index 13f5f684eb2..6ad1c6e93bb 100644 --- a/gamestonk_terminal/screener/yahoo_finance_view.py +++ b/gamestonk_terminal/screener/yahoo_finance_view.py @@ -7,7 +7,7 @@ import configparser import yfinance as yf from finvizfinance.screener import ticker from gamestonk_terminal.screener import finviz_view - +from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal.helper_funcs import ( parse_known_args_and_warn, plot_autoscale, @@ -173,6 +173,10 @@ def historical(other_args: List[str], preset_loaded: str): plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2) # ensures that the historical data starts from same datapoint plt.xlim([max(l_min), df_similar_stock.index[-1]]) + + if gtff.USE_ION: + plt.ion() + plt.show() print("")