On-the-fly graphics

(The book CGI Programming has a nice section on graphics for the web.)

Since we now know how to run processes from perl, on-the-fly graphics are simple.

You simply run a process that generates a .gif document, and create some html code that has a link to that .gif.

For example:

$plot_file = "/tmp/$$my_plot.gif";
open(GRAPH, "|/disk/my-graphics-program > $plot_file");
print GRAPH <<"EOI"
(commands for the graphics program go here)
...
EOI
Then, you create some html document that has this html tag in it:
<img src="$plot_file">
The newly-created plot will appear at that place in the html document.

In this way, you can use any graphics package, for instance IDL, AVS, postscript, NCAR graphics, or anything else.


Last modified: Wed May 15 16:11:10 DST 1996