summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-05 20:51:41 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-06 06:46:05 +0100
commitaf939ee4c882ed08bd5a3f7a72bb5698deb36630 (patch)
tree4a85c51a0fef854a3bec00483833b9b0b00eea6b /profile.c
parentd2edc681a4c5c5818ca3dfe103befcbfb25acb79 (diff)
downloadsubsurface-af939ee4c882ed08bd5a3f7a72bb5698deb36630.tar.gz
Be smarter about printing gas partial pressure text
We always want to print absolute maxima and minima - but not when multiple consecutive data points all have the same value (this happens, for example, when printing a pHe plot on non-helium dives - or when the dive profile includes a brief surface intervall which causes all the partial pressures to be at their minimum). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/profile.c b/profile.c
index d75b24f40..faed6c0d3 100644
--- a/profile.c
+++ b/profile.c
@@ -656,9 +656,9 @@ static void find_points_of_interest(struct plot_info *pi, double (*value_func)(i
data_max[i] = data[j];
}
/* is i the overall minimum or maximum */
- if (data[i] == max)
+ if (data[i] == max && (i == 0 || data[i - 1] != max))
add_index(i, deltax, poip, poip_vpos, BOTTOM);
- if (data[i] == min)
+ if (data[i] == min && (i == 0 || data[i - 1] != min))
add_index(i, deltax, poip, poip_vpos, TOP);
/* is i a spike? */
if (fabs(spk_data[i]) > 0.01 && ! higher_spike(spk_data, i, nr, deltax)) {