+static void plot_depth_text(struct dive *dive, cairo_t *cr,
+ double topx, double topy, double maxx, double maxy)
+{
+ double scalex, scaley;
+ int maxtime, maxdepth;
+ int i;
+
+ /* Get plot scaling limits */
+ maxtime = round_seconds_up(dive->duration.seconds);
+ maxdepth = round_feet_up(to_feet(dive->maxdepth));
+
+ scalex = maxtime;
+ scaley = maxdepth;
+
+ cairo_set_font_size(cr, 14);
+ cairo_set_source_rgb(cr, 1, 0.2, 0.2);
+ i = 0;
+ while ((i = next_minmax(dive, i, 1)) != 0) {
+ struct sample *sample = dive->sample+i;
+ int sec = sample->time.seconds;
+ int depth = to_feet(sample->depth);
+
+ plot_text(cr, SCALE(sec, depth), "%d ft", depth);
+ i = next_minmax(dive, i, 0);
+ if (!i)
+ break;
+ }
+}
+
+static void plot_depth_profile(struct dive *dive, cairo_t *cr,