Skip to ContentSkip to Navigation
Society/business Center for Information Technology Research and Innovation Support Virtual Reality and Visualisation

Color postscript

								
#include <stdio.h>
#include <math.h>
#include "komplot.h"

int main()
{
 float x[10], y[10];
 float xb[]={1, 6, 6, 1};
 float yb[]={1, 1, 4, 4};
 int i;

/*  parameter_dump_short(1); */
/* MIND the single quotes of the switch character $ */
 font_switch_character('$');
 ps_define_font("B","Albertus");
 ps_define_font("C","Symbol");
 ps_background(3);
 gridlines(1,1);
 ps_grid_attributes(0.04, 2);
 suppress_ticks(1,1);
 suppress_axislines(1,1);
 clip_at_axes(1);
 ps_frame_attributes(0.04, 2);
 frame(10, 0, 10, 10, 0, 10,"$BXlab$A","$BYLAB$A", "$BUse of color in PostScript$A");

 for(i=1 ; i < 11 ; i++)
  {
   x[i-1]=i;
   y[i-1]=0.1*i*i;
  }
 ps_graph_attributes(0.2, 2);
 polyline(" ",10,x,y);
 for(i=1 ; i < 11 ; i++)
  {
   y[i-1]=0.1*i*i + 1.0;
  }
 ps_graph_attributes(0.1, 2);
 line_style_nr(2);
 polyline(" ",10,x,y);
 ps_graph_attributes(0.02, 4);
 ps_fill_area(" ", 4,xb, yb);
 ps_graph_attributes(0.02, 3);
 gstrng(2,3,0.4, 0,"C"); 
 gstrng(999, 2.9, -0.3, 0, "2" );
 gstrng(999, 3, -0.4, 0, "H");
 gstrng(999, 2.9, -0.3, 0, "5" );

 gstrng(2, 2, -0.3, 0, "$Ca$A = 1.0 , $CF$A = 2.0");


 printf (" >>>>>> This program generated KOMPLOT.TMP\n");
 printf (" >>>>>> KOMPLOT.TMP is inputfile for komplot\n");

/*
 komplot(40,"pscl.ps");
 system("xv pscl.ps"); 
*/
 return 0;

}


							
Last modified:02 October 2015 10.22 p.m.