#define DATASETS 2
-static const struct dataset dataset[DATASETS] =
+static const struct dataset dataset[DATASETS] =
{
{ 13, "male"},
{ 11, "female"},
void
chart_datum(struct chart *ch, int dataset UNUSED, double x, double y)
{
- if ( ! ch )
+ if ( ! ch )
return ;
{
- const double x_pos =
- (x - ch->x_min) * ch->abscissa_scale + ch->data_left ;
+ const double x_pos =
+ (x - ch->x_min) * ch->abscissa_scale + ch->data_left ;
- const double y_pos =
+ const double y_pos =
(y - ch->y_min) * ch->ordinate_scale + ch->data_bottom ;
- pl_savestate_r(ch->lp);
-
+ pl_savestate_r(ch->lp);
+
pl_fmarker_r(ch->lp, x_pos, y_pos, 6, 15);
- pl_restorestate_r(ch->lp);
+ pl_restorestate_r(ch->lp);
}
}
/* Draw a line with slope SLOPE and intercept INTERCEPT.
between the points limit1 and limit2.
- If lim_dim is CHART_DIM_Y then the limit{1,2} are on the
+ If lim_dim is CHART_DIM_Y then the limit{1,2} are on the
y axis otherwise the x axis
*/
void
-chart_line(struct chart *ch, double slope, double intercept,
+chart_line(struct chart *ch, double slope, double intercept,
double limit1, double limit2, enum CHART_DIM lim_dim)
{
double x1, y1;
double x2, y2 ;
- if ( ! ch )
+ if ( ! ch )
return ;
- if ( lim_dim == CHART_DIM_Y )
+ if ( lim_dim == CHART_DIM_Y )
{
x1 = ( limit1 - intercept ) / slope ;
x2 = ( limit2 - intercept ) / slope ;
x1 = (x1 - ch->x_min) * ch->abscissa_scale + ch->data_left ;
x2 = (x2 - ch->x_min) * ch->abscissa_scale + ch->data_left ;
- pl_savestate_r(ch->lp);
+ pl_savestate_r(ch->lp);
pl_fline_r(ch->lp, x1, y1, x2, y2);
- pl_restorestate_r(ch->lp);
-
+ pl_restorestate_r(ch->lp);
+
}