0

EDIT: Additionally, does anyone know if I can still create a toolbar object but not draw it? So I could map the toolbar to my own custom buttons


I'm having trouble display my matplotlib toolbar correctly in my tools window. I have the following objects in my classes __init__

    # upperPane is a PaneWindow of the TopLevel() window self.__child
    self.__upperButtonFrame = Frame(upperPane)
    self.__upperButtonFrame.pack()

    self.__testFrame = Frame(upperPane)

    self.__fig = plt.figure(figsize=(10,7))

    # the main canvas we will be drawing our data to
    self.__drawplotCanvas = FigureCanvasTkAgg(self.__fig, master=drawplotFrame)

    self.__toolbar = NavigationToolbar2TkAgg(self.__drawplotCanvas, self.__testFrame)

    self.__testFrame.columnconfigure(0, minsize=3)
    self.__testFrame.grid(row=0, column=0, columnspan=2)
    self.__testFrame.pack()
    drawplotFrame.pack()

but my toolbar on the right shows up not format, and save is cut off because I cannot get the columns to wrap at 3 buttons:

enter image description here

Does anyone know how to wrap the navigation bar in grid format?

Syntactic Fructose
  • 18,936
  • 23
  • 91
  • 177
  • 1
    There is a blog (http://dalelane.co.uk/blog/?p=778) where they subclass the toolbar and edit as needed. It's wx but should be similar... – Ed Smith Jun 04 '15 at 18:38
  • @EdSmith I've sen that article once before, the problem is I'm not familiar with wx and have no knowledge as to how to port that code into Tkinter – Syntactic Fructose Jun 04 '15 at 18:54
  • @EdSmith would you know how to define this toolbar, but not display it? I could work with that as well – Syntactic Fructose Jun 04 '15 at 19:29
  • Hi, @Syntactic Fructose, I've mainly worked with wx. It seems the toolbar is essentially a frame containing widgets!? (sorry not sure of tkinter terminology). Maybe you can use the advice from http://stackoverflow.com/questions/4073660/python-tkinter-embed-matplotlib-in-gui to adjust – Ed Smith Jun 05 '15 at 09:53

0 Answers0