Julia backend: math and other extensions
ClosedPublic

Authored by ivanlakhtanov on Aug 16 2016, 2:18 AM.

Details

Summary

Extensions implementation

* Packaging
* Plot (2D, 3D) with GR library
* Script
* LinearAlgebra

Diff Detail

Repository
R55 Cantor
Lint
Lint Skipped
Unit
Unit Tests Skipped
ivanlakhtanov retitled this revision from to Julia backend: math and other extensions.
ivanlakhtanov updated this object.
ivanlakhtanov edited the test plan for this revision. (Show Details)
ivanlakhtanov set the repository for this revision to R55 Cantor.
ivanlakhtanov added subscribers: Cantor, filipesaraiva.
filipesaraiva added inline comments.Aug 20 2016, 7:42 PM
src/backends/julia/juliaextensions.cpp
133

Could you to provide an example of plot 2d? I tried to use x = [1 2 3 4 5] and used the sin function in the plot2d assistant but I got an error... Maybe I am using it incorrectly.

The command sent by the assistant was:

import GR

GR.xlim((-1, 1))

GR.plot(linspace(-1, 1, 100), [sin for x in linspace(-1, 1, 100)])

The error output was:

error during run:

expected Real or Complex

in plot_args at /home/kdevil/.julia/v0.4/GR/src/jlgr.jl:754

in plot at /home/kdevil/.julia/v0.4/GR/src/jlgr.jl:830

in plot at /home/kdevil/.julia/v0.4/GR/src/GR.jl:1234

in anonymous at no file
155

Do you know if GR is the most common library for plotting in julia land? There are a lot of packages, so it is better for us to implement the most common.

ivanlakhtanov added inline comments.Aug 20 2016, 8:04 PM
src/backends/julia/juliaextensions.cpp
133

About 2d plot. As I understand you should provide sin(x) as a function to assistant, x as variable to plot by and plot range, if you wish (defaults to [-1, 1]).

In you example output is correct, as sin is passed as a function to plot, like "plot me not values but function symbols".

155

I have investigated this. Actually there is about 5-6 plotting libs for Julia. About a half of them is HTML + JS based and don't support saving to image. One of them outputs text-written graph with unicode.

There is one based on Pythons matplotlib. I have struggled with it for 2 days year ago, but it don't work for me even from Julia native REPL. It always fail with incompatible versions of C-part, python-part and julia's PyCall part. Also on install it compiles C-part and requires installation of python-devel package.

GR were the only one that worked simply by Pkg.add("GR") and don't require anything to compile to output .eps graphics. I think if user uses assistant he wants to get graph as fast as possible with minimal effort. Of course, more advanced users are free to choose library they like and tweak plotting parameters.

I haven't seen any statistics on different libs usage.

filipesaraiva accepted this revision.Aug 21 2016, 3:32 AM
filipesaraiva edited edge metadata.
This revision is now accepted and ready to land.Aug 21 2016, 3:32 AM
This revision was automatically updated to reflect the committed changes.