Programming and Graphics

(Kiana) #1

234 Introduction to C++ Programming and Graphics


,labely // y-axis label
,title1 // first plot label
,title2 // second plot label
,title3 // third plot label
);

//-----------------------------
if(Itry==1)
{
vexit();
goto again;
};
//-----------------------------

swapbuffers();

//--- Check the keyboard:

kbd = char(checkkey());

if(kbd==’q’) exit(1); // quit

if(kbd==’s’)
{
cout << "Press p to print a postscript file" << endl;
cout << " any other key to finish" << endl;
kbd = char(getkey());
}

if(kbd ==’p’)
{
char outfile[1];
cout << " Please enter the name of the postscript file " <<endl;
cin >> outfile;
voutput (outfile);

cout << "Please enter:" << endl << endl;
cout <<" 1 for a black/white plot" << endl;
cout <<" 2 for a black/white plot in portrait" << endl;
cout <<" 3 for a color plot" << endl;
cout <<" 4 for a color plot with background color" << endl;
cout <<" 5 for a color plot in portrait" << endl;
cout <<" 6 for a color plot in portrait with background color" << endl;

short Iplot;
cin >> Iplot;

if(Iplot==1) vnewdev("postscript");
if(Iplot==2) vnewdev("ppostscript");
Free download pdf