Plot in Tkinter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • katrien202
    New Member
    • Mar 2010
    • 3

    Plot in Tkinter

    Hi,
    I want to put plots using pyplot in a Tkinter window, a frame. I want to have the options I usually have in pyplot figures: the user has to be able to zoom, save,... so a photo of the image will not satisfy.
    Does anyone now how to do this?
    Thanks
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    Can the plot be recreated using lines, arcs, polygons, etc.? Create a canvas and you can create the graphics on the canvas. You can also create a canvas window to display other widgets. You can bind the canvas to an event to redraw the canvas at a different scale.

    Comment

    • katrien202
      New Member
      • Mar 2010
      • 3

      #3
      No, unfortunately the plot can not be recreated with those attributes, they are data I'm reading and these data are complicated.

      Comment

      • bvdet
        Recognized Expert Specialist
        • Oct 2006
        • 2851

        #4
        Perhaps you should check out the pyplot documentation found here.

        Comment

        • katrien202
          New Member
          • Mar 2010
          • 3

          #5
          Hi,
          thanks.
          Actually matplotlib uses Tkinter to show plots. But, I don't know the code behind matplotlib. If matplotlib can plot it in a new Tkinter window, I assume it can also do it in an existing one...

          Comment

          • bvdet
            Recognized Expert Specialist
            • Oct 2006
            • 2851

            #6
            I do not know for sure, but I am guessing that pyplot wraps the API so the user does not have to worry about it. If the author(s) of pyplot can do it...........

            BV

            Comment

            Working...