Work In Progress and Proof Of Concept
I like Racket drawing packages, such as pict
, plot
and 2htdp/image
, they
are easy and fun to use, you can manipulate images like ordinary values, for
example, the following creates two images then append them vertically:
;; Racekt
(vc-append (circle 100) (text "Moon"))
It would be nice if we can have this kind of pacakges for Emacs. This repo uses
PLplot via Emacs dynamic module, it lets you plot in Emacs
Lisp, for example, this plot y = sin(x)
, x
within [-pi, pi]
:
;; Emacs Lisp
(insert-image-file (plplot #'sin (- pi) pi))
You're going to need PLplot to build the dynamic module, you should be able to install it with your OS package manager, for example, macOS/Homebrew users can use:
$ brew install plplot
Build the dynamic module:
$ make
cc -Wall -shared -fpic -lplplot plplot-module.c -o plplot-module.so
Setup load-path
and load the package:
(add-to-list 'load-path "~/src/plplot.el")
(require 'plplot)
Use-package users can achieve the above with:
(use-package plplot
:load-path "~/src/plplot.el")
Plot y=FUNC(x)
from X-MIN
to X-MAX
.
Plot ys
in bar chart.
- Emacs 25