02110-1301, USA. */
#include <config.h>
+
#include <stdio.h>
#include <plot.h>
#include <stdarg.h>
#include <assert.h>
#include <math.h>
-#include "chart-geometry.h"
-#include "plot-chart.h"
-#include "str.h"
-#include "alloc.h"
-#include "manager.h"
-#include "output.h"
-#include "plot-chart.h"
+#include <output/charts/plot-chart.h>
+
+#include <math/chart-geometry.h>
+
+
+
+#include <libpspp/str.h>
+#include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
+#include <output/manager.h>
+#include <output/output.h>
+
const char *data_colour[] = {
"brown",
else if (orientation == TICK_ORDINATE )
pl_flinerel_r(chart->lp, 0, position, -tickSize, position);
else
- assert(0);
+ NOT_REACHED ();
if ( label ) {
char buf[10];
(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);
+}