/* pendulum_plot.ch */ /* Plotting the output of pendulum.c */ /* Initial values: q1(0) = 90 & q2(0) = 1, 0.5 */ #include #include int main() { class CPlot plot; char *title = "q2 & q1 vs. t w/ q1(0) = 90"; char *xlabel = "time (s)"; char *ylabel = "q2 & q1 (deg)"; plot.dataFile("pendulum_3.1"); plot.dataFile("pendulum_4.1"); plot.legend("q2(0) = 0.5", 0); plot.legend("q2(0) = 1.0", 1); plot.legendLocation(2,1.5); plot.title(title); plot.label(PLOT_AXIS_X, xlabel); plot.label(PLOT_AXIS_Y, ylabel); plot.plotting(); plot.outputType(PLOT_OUTPUTTYPE_FILE, "postscript eps color", "plot_34.eps"); plot.plotting(); return 0; }