from tkinter import *
from tkinter import ttk
import numpy as np
import pandas as pd
from pandas_datareader import data as wb
import matplotlib.pyplot as plt
from yahoofinancials import YahooFinancials
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import matplotlib
matplotlib.use('TkAgg')
plt.style.use('dark_background')
class Scr:
def __init__(self, master):
master.geometry('900x900+120+60')
master.configure(background = 'gray9')
self.style = ttk.Style()
self.style.theme_use('clam')
self.style.configure('TFrame',background = 'green')
self.style.configure('TCanvas',background = 'yellow', width=0,height=0,font='serif 10')
self.style.configure('TButton',background = 'blue')
self.style.configure('TLabel', background = 'pink',font = ('Arial', 15))
self.frame_content = ttk.Frame(master)
self.frame_content.pack()
options = ['AAPL']
m = pd.DataFrame()
for o in options :
m[o] = wb.DataReader(o, data_source='yahoo', start='2004-1-1')['Adj Close']
a=m
graph2 = ttk.Frame(master)
graph2.pack()
fig2 = matplotlib.pyplot.Figure(figsize=(6,6))
canvas3 = FigureCanvasTkAgg(fig2, graph2)
canvas3.get_tk_widget().grid(padx=0, pady=0,sticky="nswe")
ax3 = fig2.add_subplot(211)
a.plot(kind='line', legend=True, ax=ax3, color='blue')
def main():
root = Tk()
scr = Scr(root)
root.mainloop()
if __name__ == "__main__":
main()
[Tkinter] how to remove black area around the graph in tkinter ?
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| [Tkinter] Annotating live tkinter graph with matplotlib annotations | joeypyro | 1 | 4,024 |
Nov-10-2024, 04:42 AM Last Post: joeypyro |
|
| [Tkinter] Tkinter Matplotlib Animation Graph not rendering | dimidgen | 3 | 7,616 |
Mar-12-2024, 02:09 PM Last Post: deanhystad |
|
| [Tkinter] TKinter Remove Button Frame | Nu2Python | 8 | 7,498 |
Jan-16-2024, 06:44 PM Last Post: rob101 |
|
| Tkinter - How can I remove the background borders from ttk.Button? | TurboC | 4 | 24,843 |
Oct-18-2020, 10:58 AM Last Post: TurboC |
|
| [PyQt] QPainter issue showing black screen | mart79 | 0 | 3,211 |
May-06-2020, 12:02 PM Last Post: mart79 |
|
| Axis lim and Plotting a graph in Tkinter | KEDivergente | 0 | 2,678 |
May-21-2019, 08:10 PM Last Post: KEDivergente |
|
| Tkinter - Make changes to graph and update it | adriancovaci | 0 | 8,355 |
Apr-08-2019, 09:02 AM Last Post: adriancovaci |
|
| Remove duplicate images - tkinter? | darter | 5 | 8,054 |
Nov-10-2018, 10:54 PM Last Post: Larz60+ |
|
Users browsing this thread: 1 Guest(s)
