aboutsummaryrefslogtreecommitdiff
path: root/noao/onedspec/splot/fudgept.x
diff options
context:
space:
mode:
Diffstat (limited to 'noao/onedspec/splot/fudgept.x')
-rw-r--r--noao/onedspec/splot/fudgept.x38
1 files changed, 38 insertions, 0 deletions
diff --git a/noao/onedspec/splot/fudgept.x b/noao/onedspec/splot/fudgept.x
new file mode 100644
index 00000000..c2aa3740
--- /dev/null
+++ b/noao/onedspec/splot/fudgept.x
@@ -0,0 +1,38 @@
+# FUDGEPT -- Fudge a point
+
+procedure fudgept (sh, gfd, x, y, n, wx, wy)
+
+pointer sh
+int gfd
+real x[n]
+real y[n]
+int n
+real wx, wy
+
+int i1, nplot, istart
+double shdr_wl()
+
+begin
+ # Get pixel number
+ i1 = max (1, min (n, nint (shdr_wl (sh, double(wx)))))
+
+ # Replace with Y-value
+ if (i1 > 0 && i1 <= n)
+ y[i1] = wy
+ else
+ return
+
+ # Plot region around new point
+ if (i1 > 1 && i1 < n) {
+ nplot = 3
+ istart = i1 - 1
+ } else if (i1 == 1) {
+ nplot = 2
+ istart = i1
+ } else if (i1 == n) {
+ nplot = 2
+ istart = n - 1
+ }
+
+ call gpline (gfd, x[istart], y[istart], nplot)
+end