gnuplot on Canvas widget

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Blues

    #1

    gnuplot on Canvas widget

    Hey,

    I have used two great models - Tkinter and Gnuplot.py - for a while. I
    can display an image on a Canvas widget using Tkinter and I can also
    generate a gnuplot from Python on the fly in a separate window. Does
    anyone know how to display such a gnuplot on the Canvas widget with an
    image in it? Thanks.

    Michael

  • Jonathan  Ellis

    #2
    Re: gnuplot on Canvas widget

    Blues wrote:[color=blue]
    > I have used two great models - Tkinter and Gnuplot.py - for a while.[/color]
    I[color=blue]
    > can display an image on a Canvas widget using Tkinter and I can also
    > generate a gnuplot from Python on the fly in a separate window. Does
    > anyone know how to display such a gnuplot on the Canvas widget with[/color]
    an[color=blue]
    > image in it? Thanks.[/color]
    [color=blue]
    >From my experience, the Gnuplot module isn't designed to be used in[/color]
    "headless" mode -- it can save to the usual formats, but you have to
    render everything in an x11 window interactively first.
    It might not be hard to modify this, though.

    -Jonathan

    Comment

    • Blues

      #3
      Re: gnuplot on Canvas widget

      Thanks, Jonathan. Can you please give a little more information here?

      Comment

      • Fernando Perez

        #4
        Re: gnuplot on Canvas widget

        Jonathan Ellis wrote:
        [color=blue]
        > Blues wrote:[color=green]
        >> I have used two great models - Tkinter and Gnuplot.py - for a while.[/color]
        > I[color=green]
        >> can display an image on a Canvas widget using Tkinter and I can also
        >> generate a gnuplot from Python on the fly in a separate window. Does
        >> anyone know how to display such a gnuplot on the Canvas widget with[/color]
        > an[color=green]
        >> image in it? Thanks.[/color]
        >[color=green]
        >>From my experience, the Gnuplot module isn't designed to be used in[/color]
        > "headless" mode -- it can save to the usual formats, but you have to
        > render everything in an x11 window interactively first.
        > It might not be hard to modify this, though.[/color]

        That's not correct. I have tons of Gnuplot.py based scripts which write
        directly to EPS output, without ever opening a gui window. Note that Gnuplot
        still tries to initialize the X11 terminal at startup, so they would require
        modifications to run over ssh without X forwarding.

        The default plot() command in Gnuplot.py doesn't make it too convenient to do
        this, but it's possible. The Gnuplot support in ipython
        (http://ipython.scipy.org) extends the syntax of the plot() command to make
        it trivial to render to EPS without a terminal. It shouldn't be hard to
        modify this to render to other formats, while avoiding opening an X11 window.

        Best,

        f

        Comment

        Working...