diff --git a/discordbot/stocks/dark_pool_shorts/ftd.py b/discordbot/stocks/dark_pool_shorts/ftd.py index 42cf5576475..c8de6a70411 100644 --- a/discordbot/stocks/dark_pool_shorts/ftd.py +++ b/discordbot/stocks/dark_pool_shorts/ftd.py @@ -7,7 +7,7 @@ import yfinance as yf import discordbot.config_discordbot as cfg import discordbot.helpers from discordbot.run_discordbot import gst_imgur - +from gamestonk_terminal.config_plot import PLOT_DPI from gamestonk_terminal.stocks.dark_pool_shorts import sec_model @@ -47,6 +47,7 @@ async def ftd_command(ctx, ticker="", start="", end=""): if cfg.DEBUG: print(ftds_data.to_string()) + plt.figure(dpi=PLOT_DPI) # Output data plt.bar( ftds_data["SETTLEMENT DATE"], diff --git a/discordbot/stocks/due_diligence/pt.py b/discordbot/stocks/due_diligence/pt.py index 71ef2201a8f..25da2da3180 100644 --- a/discordbot/stocks/due_diligence/pt.py +++ b/discordbot/stocks/due_diligence/pt.py @@ -6,6 +6,7 @@ from matplotlib import pyplot as plt import discordbot.config_discordbot as cfg from discordbot.run_discordbot import gst_imgur import discordbot.helpers +from gamestonk_terminal.config_plot import PLOT_DPI from gamestonk_terminal.stocks.due_diligence import business_insider_model @@ -14,7 +15,6 @@ async def pt_command(ctx, ticker="", raw="", start=""): """Displays price targets [Business Insider]""" try: - # Debug if cfg.DEBUG: print(f"!stocks.dd.pt {ticker}") @@ -58,6 +58,7 @@ async def pt_command(ctx, ticker="", raw="", start=""): ) ctx.send(embed=embed) else: + plt.figure(dpi=PLOT_DPI) if start: df_analyst_data = df_analyst_data[start:] @@ -76,7 +77,7 @@ async def pt_command(ctx, ticker="", raw="", start=""): plt.xlabel("Time") plt.ylabel("Share Price") plt.grid(b=True, which="major", color="#666666", linestyle="-") - + plt.gcf().autofmt_xdate() plt.savefig("ta_pt.png") uploaded_image = gst_imgur.upload_image("ta_pt.png", title="something") image_link = uploaded_image.link diff --git a/gamestonk_terminal/stocks/due_diligence/business_insider_view.py b/gamestonk_terminal/stocks/due_diligence/business_insider_view.py index 0b11afaf35c..948ce95e2e5 100644 --- a/gamestonk_terminal/stocks/due_diligence/business_insider_view.py +++ b/gamestonk_terminal/stocks/due_diligence/business_insider_view.py @@ -10,6 +10,8 @@ from gamestonk_terminal.stocks.due_diligence import business_insider_model from gamestonk_terminal.helper_funcs import ( export_data, ) +from gamestonk_terminal.config_plot import PLOT_DPI +from gamestonk_terminal.helper_funcs import plot_autoscale from gamestonk_terminal import feature_flags as gtff register_matplotlib_converters() @@ -62,6 +64,8 @@ def price_target_from_analysts( print(df_analyst_data.head(num).to_string()) else: + plt.subplots(figsize=plot_autoscale(), dpi=PLOT_DPI) + # Slice start of ratings if start: df_analyst_data = df_analyst_data[start:] # type: ignore diff --git a/gamestonk_terminal/stocks/stocks_controller.py b/gamestonk_terminal/stocks/stocks_controller.py index d5e0bda954a..48ac2affa3d 100644 --- a/gamestonk_terminal/stocks/stocks_controller.py +++ b/gamestonk_terminal/stocks/stocks_controller.py @@ -579,8 +579,8 @@ Stocks Menus: self.interval, self.queue, ) - - print("Use 'load ' prior to this command!", "\n") + else: + print("Use 'load ' prior to this command!", "\n") def call_dd(self, _): """Process dd command""" @@ -590,8 +590,8 @@ Stocks Menus: self.queue = dd_controller.menu( self.ticker, self.start, self.interval, self.stock, self.queue ) - - print("Use 'load ' prior to this command!", "\n") + else: + print("Use 'load ' prior to this command!", "\n") def call_ca(self, _): """Process ca command""" @@ -610,8 +610,8 @@ Stocks Menus: self.queue = fa_controller.menu( self.ticker, self.start, self.interval, self.suffix, self.queue ) - - print("Use 'load ' prior to this command!", "\n") + else: + print("Use 'load ' prior to this command!", "\n") def call_bt(self, _): """Process bt command""" @@ -619,8 +619,8 @@ Stocks Menus: from gamestonk_terminal.stocks.backtesting import bt_controller self.queue = bt_controller.menu(self.ticker, self.stock, self.queue) - - print("Use 'load ' prior to this command!", "\n") + else: + print("Use 'load ' prior to this command!", "\n") def call_ta(self, _): """Process ta command"""