Plotting with julia
Sun 26 February 2012
Maybe you've already heard it: There's a new language on the block - Julia. She seems to be a hot contender for the new standard scientific computing language, maybe also replacing R for statistical analysis.
Julia is a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users of other technical computing environments. It provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library.
Of course, it's a very young language, so they standard library is quite small right now. For example, you can also plot to the webinterface, not to real image files. That wasn't enough for me, so I set out to create my own small plotting interface.
Like the rest of Julia, it's very easy to use, just a few characters to plot something:
plot(x -> sin(x), 0, 2pi, "sample.png")
If you wanted a more elaborate plot, you'd do this:
# create new plot of size 800x300 pl = Plot(800, 300) # add functions add(pl, x -> sin(x)) # optionally choose a color add(pl, x -> 2*cos(x), "b") # export to a file paint(pl, "myplot.png")
It's based on MathGL, an awesome plotting library for C/C++. As usual, the source is on GitHub, so feel free to contribute :)
Tags: programming, graphics
italics | surround text with *asterisks* |
bold | surround text with **two asterisks** |
hyperlink | [hyperlink](https://example.com)or just a bare URL |
code | surround text with `backticks` |
surround text with ~~two tilde characters~~ | |
quote | prefix with > |
Loading comments...