home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <plot/plotlib.h>
-
- DATA quadrat(x)
- DATA x;
- {
- return(x*x);
- }
-
- main()
- {
- int erfolg,id;
- char a;
-
- erfolg = open_plot();
- if (!erfolg)
- {
- dis_ploterror();
- exit(5);
- }
-
- id = get_data(quadrat,-4.0,4.0,300);
- if (!id)
- dis_ploterror();
- else
- {
- erfolg = set_axisname(XAXIS,"X");
- if (!erfolg)
- dis_ploterror();
- erfolg = set_axisname(YAXIS,"Y");
- if (!erfolg)
- dis_ploterror();
- erfolg = set_titel("Beispiel 3");
- if (!erfolg)
- dis_ploterror();
- erfolg = set_curvename(id,"y = x^2");
- if (!erfolg)
- dis_ploterror();
- erfolg = display(SCREENOUT,GRAPHNOTSET);
- if (!erfolg)
- dis_ploterror();
- else
- {
- a = getchar();
- erfolg = display(SCREENCLOSE,NULL);
- if (!erfolg)
- dis_ploterror();
- }
- }
- erfolg = close_plot();
- if (!erfolg)
- dis_ploterror();
- exit(0);
- }
-