Function: calc-graph-set-styles
calc-graph-set-styles is a byte-compiled function defined in
calc-graph.el.gz.
Signature
(calc-graph-set-styles LINES POINTS &optional YERR)
Source Code
;; Defined in /usr/src/emacs/lisp/calc/calc-graph.el.gz
(defun calc-graph-set-styles (lines points &optional yerr)
(calc-graph-init)
(with-current-buffer calc-gnuplot-input
(or (calc-graph-find-plot nil nil)
(error "No data points have been set!"))
(let ((base (point))
(mode nil) (lstyle nil) (pstyle nil)
start end lenbl penbl errform)
(re-search-forward "[,\n]")
(forward-char -1)
(setq end (point) start end)
(goto-char base)
(if (looking-at "[^,\n]*[^,\n \t]\\([ \t]+with\\)")
(progn
(setq start (match-beginning 1))
(goto-char (match-end 0))
(if (looking-at "[ \t]+\\([a-z]+\\)")
(setq mode (buffer-substring (match-beginning 1)
(match-end 1))))
(if (looking-at "[ \ta-z]+\\([0-9]+\\)")
(setq lstyle (string-to-number
(buffer-substring (match-beginning 1)
(match-end 1)))))
(if (looking-at "[ \ta-z]+[0-9]+[ \t]+\\([0-9]+\\)")
(setq pstyle (string-to-number
(buffer-substring (match-beginning 1)
(match-end 1)))))))
(unless yerr
(setq lenbl (or (equal mode "lines")
(equal mode "linespoints"))
penbl (or (equal mode "points")
(equal mode "linespoints")))
(if lines
(or (eq lines t)
(setq lstyle lines
lenbl (>= lines 0)))
(setq lenbl (not lenbl)))
(if points
(or (eq points t)
(setq pstyle points
penbl (>= points 0)))
(setq penbl (not penbl))))
(delete-region start end)
(goto-char start)
(setq errform
(ignore-errors
(math-contains-sdev-p
(symbol-value
(intern
(concat "var-"
(save-excursion
(re-search-backward ":\\(.*\\)}")
(match-string 1))))))))
(if yerr
(insert " with yerrorbars")
(insert " with "
(if (and errform
(equal mode "dots")
(eq lines t))
"yerrorbars"
(if lenbl
(if penbl "linespoints" "lines")
(if penbl "points" "dots"))))
(if (and pstyle (> pstyle 0))
(insert " ls "
(if (and lstyle (> lstyle 0)) (int-to-string lstyle) "1")
" ps " (int-to-string pstyle))
(if (and lstyle (> lstyle 0))
(insert " ls " (int-to-string lstyle)))))))
(calc-graph-view-commands))