#include <math.h> #include <chplot.h> int main() { int numpoints = 36; array double x[numpoints], y[2][numpoints]; int i; class CPlot plot; linspace(x, 0, 360); for(i=0; i < numpoints; i++) { y[0][i] = sin(x[i]*M_PI/180); y[1][i] = cos(x[i]*M_PI/180); } plotxy(x, y, NULL, "xlabel", "ylabel", &plot); plot.legend("sine wave", 0); plot.legend("cosine wave", 1); plot.plotting(); }