Skip to content

bensadeghi/pyplot.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What

Graphics solution for Julia based on matploblib, mainly the pyplot module.

Why

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.

Example

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")

screenshot

Prerequirements

Setup

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.

Usage

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" for color="red"
  • escaping characters: use \\n for \n

Demo should be enough for elementary and medium usage.

Support and Contact

If any questions or comments, feel free to contact [email protected].

About

Graphics solution for Julia based on pyplot from matplotlib.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Julia 81.6%
  • Python 18.4%