X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcharts%2Fplot-chart.c;h=497251f07eda20677029b3066196a9aa13250a15;hb=573068f2bdcd3f8796e9646668fed910a90f890b;hp=6b91045273122af627eeba060f163d3a90cc1283;hpb=745a5487c9da077893a46d26d64e911246640a7b;p=pspp-builds.git diff --git a/src/output/charts/plot-chart.c b/src/output/charts/plot-chart.c index 6b910452..497251f0 100644 --- a/src/output/charts/plot-chart.c +++ b/src/output/charts/plot-chart.c @@ -28,7 +28,6 @@ #include #include -#include #include #include @@ -177,3 +176,38 @@ chart_write_yscale(struct chart *ch, double smin, double smax, int ticks) (y - ch->y_min) * ch->ordinate_scale, "%g", y); } } + + +/* Write the abscissa label */ +void +chart_write_xlabel(struct chart *ch, const char *label) +{ + if ( ! ch ) + return ; + + pl_savestate_r(ch->lp); + + pl_move_r(ch->lp,ch->data_left, ch->abscissa_top); + pl_alabel_r(ch->lp,0,'t',label); + + pl_restorestate_r(ch->lp); + +} + + + +/* Write the ordinate label */ +void +chart_write_ylabel(struct chart *ch, const char *label) +{ + if ( ! ch ) + return ; + + pl_savestate_r(ch->lp); + + pl_move_r(ch->lp, ch->data_bottom, ch->ordinate_right); + pl_textangle_r(ch->lp, 90); + pl_alabel_r(ch->lp, 0, 0, label); + + pl_restorestate_r(ch->lp); +}