Adds an arrow annotation to the given chart.
Arguments:
chart -- the chart to annotate
x, y -- the coordinate to add the annotation
Options:
:text -- (default "") text to include at the end of the arrow
:angle -- (default :nw) either a number indicating the angle of the arrow
or a keyword indicating a direction (:north :nw :west :sw :south
:se :east :ne)
Examples:
(use '(incanter core charts))
(def x (range (* -2 Math/PI) (* 2 Math/PI) 0.01))
(def plot (xy-plot x (sin x)))
(view plot)
;; annotate the plot
(doto plot
(add-pointer (- Math/PI) (sin (- Math/PI)) :text "(-pi, (sin -pi))")
(add-pointer Math/PI (sin Math/PI) :text "(pi, (sin pi))" :angle :ne)
(add-pointer (* 1/2 Math/PI) (sin (* 1/2 Math/PI)) :text "(pi/2, (sin pi/2))" :angle :south))
;; try the different angle options
(add-pointer plot 0 0 :text "north" :angle :north)
(add-pointer plot 0 0 :text "nw" :angle :nw)
(add-pointer plot 0 0 :text "ne" :angle :ne)
(add-pointer plot 0 0 :text "west" :angle :west)
(add-pointer plot 0 0 :text "east" :angle :east)
(add-pointer plot 0 0 :text "south" :angle :south)
(add-pointer plot 0 0 :text "sw" :angle :sw)
(add-pointer plot 0 0 :text "se" :angle :se)
Comments top
No comments for add-pointer. Log in to add a comment.