X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcartesian.c;h=cac18400a4e9e85c6b1dc78bc795b3323b76dd4c;hb=5156fa5a8323a16f6b4bbc8950221cdc1d0e023d;hp=a2396abcf765da48037458e03e14c3f5ed2c7f70;hpb=9c01f251cf0e5b5eb3899fc7c62cc595f3d48511;p=pspp-builds.git diff --git a/src/cartesian.c b/src/cartesian.c index a2396abc..cac18400 100644 --- a/src/cartesian.c +++ b/src/cartesian.c @@ -27,7 +27,7 @@ struct dataset { int n_data; - char *label; + const char *label; }; @@ -63,44 +63,6 @@ chart_write_xlabel(struct chart *ch, const char *label) } -/* Set the scale for the abscissa */ -void -chart_write_xscale(struct chart *ch, double min, double max, double tick) -{ - double x; - - ch->x_max = ceil( max / tick ) * tick ; - ch->x_min = floor ( min / tick ) * tick ; - - ch->abscissa_scale = fabs(ch->data_right - ch->data_left) / - fabs(ch->x_max - ch->x_min); - - for(x = ch->x_min ; x <= ch->x_max; x += tick ) - draw_tick (ch, TICK_ABSCISSA, (x - ch->x_min) * ch->abscissa_scale, "%g", x); - -} - - -/* Set the scale for the ordinate */ -void -chart_write_yscale(struct chart *ch, double min, double max, double tick) -{ - double y; - - ch->y_max = ceil( max / tick ) * tick ; - ch->y_min = floor ( min / tick ) * tick ; - - ch->ordinate_scale = - fabs(ch->data_top - ch->data_bottom) / fabs(ch->y_max - ch->y_min) ; - - for(y = ch->y_min ; y <= ch->y_max; y += tick ) - { - draw_tick (ch, TICK_ORDINATE, - (y - ch->y_min) * ch->ordinate_scale, "%g", y); - } - -} - /* Write the ordinate label */ @@ -160,7 +122,7 @@ write_legend(struct chart *chart, const char *heading, /* Plot a data point */ void -chart_datum(struct chart *ch, int dataset, double x, double y) +chart_datum(struct chart *ch, int dataset UNUSED, double x, double y) { const double x_pos = (x - ch->x_min) * ch->abscissa_scale + ch->data_left ;