Komplot paging demo
/*This program demonstrates the superpositioning of two graphs (paging) */
#include <stdio.h>
#include <math.h>
#include "komplot.h"
int main()
{
float year[20];
float length [] = {60, 74, 85, 93, 100, 107, 114, 120,
125, 131, 137, 143, 149, 156, 160, 161,
162, 162, 162, 162};
float weight [] = {4, 9.5, 12, 14.5, 16, 18.5, 20.5, 22.5,
25, 28, 31, 35, 40.5, 46, 51, 52,
54, 54.5, 55, 55};
int i;
for (i=0; i<20 ; i++) year[i]= i;
scale_dimensions(0.75);
page_dimensions(20,23);
shift_frame_in_page(0,0);
tick_distances(1.6, 1.5);
sub_intervals(4,5);
frame(16, 0, 20, 21, 50, 190, "Age", "Length (cm)",
"Length and weight of girls");
curve("Length",20, year, length);
shift_frame_in_page(0,0);
axis_intersection(16, 0);
tick_distances(1.8, 2.5);
suppress_border(1);
suppress_axes(1, 0);
reverse_axis_annotation(1,1);
/* 9999 means: add legend entry to legend of previous frame */
legend_position(9999, 0);
frame(16, 0, 20, 21, 0, 84," ", "Weight (kg)", " ");
line_style_nr(2);
curve("Weight", 20, year, weight);
/*
printf (" >>>>>> This program generated KOMPLOT.TMP\n");
printf (" >>>>>> KOMPLOT.TMP is inputfile for komplot\n");
*/
return 0;
}
Last modified: | 04 October 2024 12.42 p.m. |
View this page in: Nederlands