home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / libs / plotlib.lha / Plot_2.lzh / Examples / bsp3.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-08  |  972 b   |  55 lines

  1.             #include <stdio.h>
  2.             #include <plot/plotlib.h>
  3.  
  4.             DATA quadrat(x)
  5.             DATA x;
  6.             {
  7.                 return(x*x);
  8.             }
  9.  
  10.             main()
  11.             {
  12.                 int erfolg,id;
  13.                 char a;
  14.  
  15.                 erfolg = open_plot();
  16.                 if (!erfolg)
  17.                 {
  18.                     dis_ploterror();
  19.                     exit(5);
  20.                 }
  21.  
  22.                 id = get_data(quadrat,-4.0,4.0,300);
  23.                 if (!id)
  24.                     dis_ploterror();
  25.                 else
  26.                 {
  27.                     erfolg = set_axisname(XAXIS,"X");
  28.                     if (!erfolg)
  29.                         dis_ploterror();
  30.                     erfolg = set_axisname(YAXIS,"Y");
  31.                     if (!erfolg)
  32.                         dis_ploterror();
  33.                     erfolg = set_titel("Beispiel 3");
  34.                     if (!erfolg)
  35.                         dis_ploterror();
  36.                     erfolg = set_curvename(id,"y = x^2");
  37.                     if (!erfolg)
  38.                         dis_ploterror();
  39.                     erfolg = display(SCREENOUT,GRAPHNOTSET);
  40.                     if (!erfolg)
  41.                         dis_ploterror();
  42.                     else
  43.                     {
  44.                         a = getchar();
  45.                         erfolg  = display(SCREENCLOSE,NULL);
  46.                         if (!erfolg)
  47.                             dis_ploterror();
  48.                     }
  49.                 }
  50.                 erfolg = close_plot();
  51.                 if (!erfolg)
  52.                     dis_ploterror();
  53.                 exit(0);
  54.             }
  55.