Re: Creating visual graphics

Discussion in 'Perl Misc' started by Jim Gibson, Nov 26, 2012.

  1. Jim Gibson

    Jim Gibson Guest

    In article <>,
    Bernie Cosell <> wrote:

    > I'm VERY new to all this, but I've started fooling around with the GD
    > package on my win7/pro system [using ActiveState Perl] and it seems simple
    > enough that even a dolt like me can manage to do some graphics-generation.
    >
    > What I'm wondering if there's some [not too complicated? :eek:)] package
    > that'd allow "active" graphics. that is, it'd open a window and draw in it
    > in some simple way [ala GD, if not GD::Simple :eek:)], and I could be typing
    > into the command window to mess with things and have the display change.
    > Thanks!


    Any graphics package that is "fast enough" can do "active" graphics,
    even if it means redrawing the entire graph from scratch each time. Of
    course, it depends on how complicated the graphics are, how fast the
    graphics package, and how powerful the hardware.

    For example, I have had success in the past using gnuplot and Perl to
    implement "quasi-active" graphics. My Perl program would open gnuplot
    as a separate process, write plot data to a file, pipe plot commands to
    gnuplot to plot the data in the file, and wait for terminal input. I
    could then type arrow, plus, and minus keys to navigate around the plot
    region and zoom in and out. Even though the program was re-writing the
    entire data file and redrawing the graph each time, it was fast enough
    to be used as an interactive analysis and data visualization tool.

    --
    Jim Gibson
     
    Jim Gibson, Nov 26, 2012
    #1
    1. Advertising

  2. Jim Gibson

    Willem Guest

    Bernie Cosell wrote:
    ) Eli the Bearded <*@eli.users.panix.com> wrote:
    )
    ) } In comp.lang.perl.misc, Bernie Cosell <> wrote:
    ) } > reminder from Willem about Tk::Canvas, but I've used tk in the past and
    ) } > didn't like it a lot. Using a scratch file in temp seems easy enough.
    ) } >
    ) } > It'd still be nice if I could open a window somehow and talk to it with
    ) } > GD... :eek:)
    ) }
    ) } Non Perl response:
    ) }
    ) } On linux, I like feh as an image viewer. You can have feh reload an image
    ) } every (integer) N seconds. Not quite realtime, but good for enough for
    ) } some purposes. I have used it for reloading electoral result maps every
    ) } few minutes.
    )
    ) I was musing about Jim's suggestion about gnuplot and I got to thinking
    ) something similar to that: there must be some image-viewer for Windows that
    ) can be poked to update its image somehow, and then I can use GD to generate
    ) png images and poke whatever-it-is to redisplay them. As mentioned: not
    ) really like a real-time "active" display but it might be fun...

    How about IE, and a small html page with refresh meta tag and a file:// img?


    SaSW, Willem
    --
    Disclaimer: I am in no way responsible for any of the statements
    made in the above text. For all I know I might be
    drugged or something..
    No I'm not paranoid. You all think I'm paranoid, don't you !
    #EOT
     
    Willem, Nov 27, 2012
    #2
    1. Advertising

  3. Jim Gibson

    Jim Gibson Guest

    In article <>,
    Bernie Cosell <> wrote:

    > Jim Gibson <> wrote:
    >
    > } In article <>,
    > } Bernie Cosell <> wrote:
    > }
    > } > What I'm wondering if there's some [not too complicated? :eek:)] package
    > } > that'd allow "active" graphics. that is, it'd open a window and draw in
    > } > it
    > } > in some simple way [ala GD, if not GD::Simple :eek:)], and I could be typing
    > } > into the command window to mess with things and have the display change.
    > } > Thanks!
    > }
    > } Any graphics package that is "fast enough" can do "active" graphics,
    > } even if it means redrawing the entire graph from scratch each time. Of
    > } course, it depends on how complicated the graphics are, how fast the
    > } graphics package, and how powerful the hardware.
    >
    > Interesting approach. I expect it'll be fast enough and I'll look at
    > gnuplot. What did you use to generate the plot data? I appreciate the
    > reminder from Willem about Tk::Canvas, but I've used tk in the past and
    > didn't like it a lot. Using a scratch file in temp seems easy enough.


    I was extracting simulated aircraft trajectories from a simulation log
    file. I could plot X vs. Y and get a ground track, or I could plot
    altitude, speed, etc. vs. time. The data included latitude, longitude,
    speed, altitude, and a bunch of other parameters for each aircraft at
    each second. My Perl program extracted the data for all of the
    aircraft and stored it in data structures, then wrote out a plot.dat
    file with the data for one aircraft, in columns to be plotted by
    Gnuplot. The writing and plotting took way less than a second.

    --
    Jim Gibson
     
    Jim Gibson, Nov 28, 2012
    #3
  4. Jim Gibson

    J. Gleixner Guest

    On 11/27/12 16:19, Willem wrote:
    > Bernie Cosell wrote:
    > ) Eli the Bearded<*@eli.users.panix.com> wrote:
    > )
    > ) } In comp.lang.perl.misc, Bernie Cosell<> wrote:
    > ) }> reminder from Willem about Tk::Canvas, but I've used tk in the past and
    > ) }> didn't like it a lot. Using a scratch file in temp seems easy enough.
    > ) }>
    > ) }> It'd still be nice if I could open a window somehow and talk to it with
    > ) }> GD... :eek:)
    > ) }
    > ) } Non Perl response:
    > ) }
    > ) } On linux, I like feh as an image viewer. You can have feh reload an image
    > ) } every (integer) N seconds. Not quite realtime, but good for enough for
    > ) } some purposes. I have used it for reloading electoral result maps every
    > ) } few minutes.
    > )
    > ) I was musing about Jim's suggestion about gnuplot and I got to thinking
    > ) something similar to that: there must be some image-viewer for Windows that
    > ) can be poked to update its image somehow, and then I can use GD to generate
    > ) png images and poke whatever-it-is to redisplay them. As mentioned: not
    > ) really like a real-time "active" display but it might be fun...
    >
    > How about IE, and a small html page with refresh meta tag and a file:// img?



    Not a perl solution, however Flot, SmoothieCharts, and many
    other Javascript libraries can plot data in real time, using AJAX,
    and display it in a browser.. pretty simple. They also provide
    things like zoom, hide/show lines, etc. a lot of features that
    are very useful and pretty difficult.
     
    J. Gleixner, Dec 3, 2012
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Divvy Ballacks
    Replies:
    1
    Views:
    389
    Divvy Ballacks
    Apr 4, 2006
  2. Aditi Jindal

    graphics in microsoft visual c++

    Aditi Jindal, May 19, 2008, in forum: C++
    Replies:
    5
    Views:
    1,620
    Alberto Bignotti
    May 23, 2008
  3. Robin9876
    Replies:
    0
    Views:
    392
    Robin9876
    May 21, 2008
  4. Robin9876

    Problem with Graphics Server.Net in Visual Studio 2005

    Robin9876, May 21, 2008, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    110
    Robin9876
    May 21, 2008
  5. Willem

    Re: Creating visual graphics

    Willem, Nov 25, 2012, in forum: Perl Misc
    Replies:
    0
    Views:
    224
    Willem
    Nov 25, 2012
Loading...

Share This Page