1.2.3-SNAPSHOT Arrow_down_16x16

add-latex

incanter.latex

  • (add-latex chart x y latex-str & options)
Adds an LaTeX equation annotation to the chart at the given x,y coordinates.

Arguments:
chart -- the chart to add the polygon to.
x, y -- the coordinates to place the image
latex-str -- a string of latex code


Options:
:color (default java.awt.Color/darkGray) -- the text color


Examples:
(use '(incanter core charts stats latex))

(doto (function-plot pdf-normal -3 3)
(add-latex 0 0.1 "f(x)=\\frac{1}{\\sqrt{2\\pi \\sigma^2}} e^{\\frac{-(x - \\mu)^2}{2 \\sigma^2}}")
view)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/latex.clj:83 top

(defn add-latex
" Adds an LaTeX equation annotation to the chart at the given x,y coordinates.

  Arguments:
    chart -- the chart to add the polygon to.
    x, y -- the coordinates to place the image
    latex-str -- a string of latex code


  Options:
    :color (default java.awt.Color/darkGray) -- the text color


  Examples:
    (use '(incanter core charts stats latex))   

      (doto (function-plot pdf-normal -3 3)
        (add-latex 0 0.1 \"f(x)=\\\\frac{1}{\\\\sqrt{2\\\\pi \\\\sigma^2}} e^{\\\\frac{-(x - \\\\mu)^2}{2 \\\\sigma^2}}\")
        view)

"
  ([chart x y latex-str & options]
    (let [opts (apply hash-map options)
	  color (or (:color opts) java.awt.Color/darkGray)
	  img (latex latex-str :color color)
	  anno (org.jfree.chart.annotations.XYImageAnnotation. x y img)]
      (.addAnnotation (.getPlot chart) anno)
      chart)))
Vars in incanter.latex/add-latex: defn let
Used in 0 other vars

Comments top

No comments for add-latex. Log in to add a comment.