* Packaging * Plot (2D, 3D) with GR library * Script * LinearAlgebra
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
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.
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".
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.