def save(): global file_png # # print(__file__) # pardir = os.path.dirname(__file__) # chart_dir = os.path.join(pardir, "charts", today_str) # if not os.path.exists(chart_dir): # os.mkdir(chart_dir) # file_png = os.path.join(chart_dir, f"{symbol}_{today_str}.png") # print(file_png) with open(file_png, 'wb') as f: fplt.screenshot(f)
def save_plot(self, plot_title, kbars): fplt = self.setup_plot(plot_title, kbars) with open(f'{plot_title}.png', 'wb') as f: fplt.timer_callback(lambda: fplt.screenshot(f), 1, single_shot=True) fplt.show()
def save(): fplt.screenshot(open('screenshot.png', 'wb'))
def update_crosshair_text(x, y, xtext, ytext): global i np_data = fplt.screenshot() ytext = '%s (Close%+.2f)' % (ytext, (y - df.iloc[x].Close)) i += 1 return xtext, ytext