in reply to gnuplot output to tkcanvas

Its some kind of timing issue, you'll have to sleep before you do "plot.z";

You'll also have to

print IN "\nexit\n";