- return make_np_plot (&dnp_plot_chart_class, np, reader, label);
-}
-
-static void
-np_plot_chart_draw (const struct chart *chart, cairo_t *cr,
- struct chart_geometry *geom)
-{
- const struct np_plot_chart *npp = UP_CAST (chart, struct np_plot_chart,
- chart);
- struct casereader *data;
- struct ccase *c;
-
- chart_write_title (cr, geom, _("Normal Q-Q Plot of %s"), npp->label);
- chart_write_xlabel (cr, geom, _("Observed Value"));
- chart_write_ylabel (cr, geom, _("Expected Normal"));
- chart_write_xscale (cr, geom,
- npp->x_lower - npp->slack,
- npp->x_upper + npp->slack, 5);
- chart_write_yscale (cr, geom, npp->y_first, npp->y_last, 5);
-
- data = casereader_clone (npp->data);
- for (; (c = casereader_read (data)) != NULL; case_unref (c))
- chart_datum (cr, geom, 0,
- case_data_idx (c, NP_IDX_Y)->f,
- case_data_idx (c, NP_IDX_NS)->f);
- casereader_destroy (data);
-
- chart_line (cr, geom, npp->slope, npp->intercept,
- npp->y_first, npp->y_last, CHART_DIM_Y);