5.6.2 Creating a Postscript File

We have seen at the beginning of this chapter that the simplest way to get a Postscript file containing a Scilab plot is :

-->driver('Pos')
 
-->xinit('foo.ps')
 
-->plot3d1();
 
-->xend()
 
-->driver('Rec')
 
-->plot3d1()
 
-->xbasimp(0,'foo1.ps')

The Postscript files (foo.ps or foo1.ps ) generated by Scilab cannot be directly sent to a Postscript printer, they need a preamble. Therefore, printing is done through the use of Unix scripts or programs which are provided with Scilab. The program Blpr is used to print a set of Scilab Graphics on a single sheet of paper and is used as follows :

 Blpr string-title file1.ps file2.ps > result

You can then print the file result with the classical Unix command :

lpr -Pprinter-name result

or use the ghostview Postscript interpreter on your Unix workstation to see the result.

You can avoid the file result with a pipe, replacing > result by the printing command | lpr or the previewing command | ghostview -.

The best result (best sized figures) is obtained when printing two pictures on a single page.