My_canvas.create_window((0, 0), window=canvas_frame, anchor="nw") # Create a Frame inside my_canvas with the same size as my_canvasĬanvas_frame = tk.Frame(my_canvas, width=my_canvas.winfo_width(), height=my_canvas.winfo_height()) # canvas_widget.get_tk_widget().pack(fill=tk.BOTH, expand=True) # Configure the canvas widget to expand and fill the canvas frameĬanvas_widget.get_tk_widget().place(relx=0, rely=0, relwidth=1, relheight=1) # Create a canvas widget to display the figureĬanvas_widget = FigureCanvasTkAgg(fig_home, master=my_canvas) # at each figure update, just before the canvas idget is created.This will ensure that the # To ensure that the labels are displayed correctly, you can call fig_home.tight_layout() # y - limits of the first(0 - indexed)subplot in a figure. # In Matplotlib, fig_ylim is a method call that sets the Show_options=True, title=None, show=False, block=False, highpass=None, lowpass=None,įiltorder=4, clipping=1.5, show_first_samp=False, proj=True, group_by='type',ĭecim='auto', noise_cov=None, event_id=None, show_scrollbars=True, show_scalebars=True, # mpl.rcParams = įig_home = raw.plot(events=None, duration=12.0, start=start_var, n_channels=20, bgcolor='w', color=None,īad_color=(0.8, 0.8, 0.8), event_color='cyan', remove_dc=True, order=None, # Load raw data from file path using MNE-Python # this says the start point in scrollbar plot() is zero (left) when reading EEG Tk.messagebox.showerror("Error", f"File path does not exist.") # create an instance of the EEGPlot classĮeg_ot_eeg_canvas(my_canvas, file_path)ĭef plot_eeg_canvas(self, my_canvas,file_path): Pass def plot_eeg(self, my_canvas, file_path): Now, when raw EEG plots in canvas inside a tk.Frame, the plot has its inferior part outside (bigger than) canvas, then I move gui a little or go canvas fullscreen the plot resizes correctly. Python 3.9, tkinter gui, matplotlib, windows11.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |