Graphics solution for Julia based on matploblib, mainly the pyplot module.
The Julia community seems to be having a discussion over which approach should be used as the default graphics solution [1] [2], and it may take a longer time for a mature solution to emerge. I just cannot wait that long, so I started my own.
require("pyplot")
using pyplot
# create new figure
figure()
# generate data
r = linspace(0, pi, 301)
theta = 2 * pi * x
# plot
polar(theta, x)
savefig("demo.png")
- Julia: recent versions (> 2013-01-10) may be needed.
- zmq: version 2.x only due to ZMQ.jl
- daemon
- ipython + matplotlib + pyzmq
- patience :)
In julia session, install module dependencies by
require("Pkg")
Pkg.add("ZMQ")
Install this module by
git clone https://github.com/autozimu/pyplot.jl ~/.julia/pyplot
Now in julia session,
require("pyplot")
pyplot.figure()
If matplotlib window opened up, then it should be a successful installation.
Mostly, the function signature is the same as calling pyplot in python / ipython, except some semantic differences due to Julia's reluctance to support kwargs:
- kwargs: use
:color, "red"
forcolor="red"
- escaping characters: use
\\n
for\n
Demo should be enough for elementary and medium usage.
If any questions or comments, feel free to contact [email protected].