[Nix-dev] Is anyone using Julia with PyPlot?
Andreas Herrmann
andreash87 at gmx.ch
Mon Dec 1 18:08:13 CET 2014
> Personally, I use Julia wrong (general purpose data crunching, little
> enough plotting to just use gnuplot).
Nothing wrong with that. ;)
> I currently lack time for learning it, but I guess I could do some quick
> strace-ing if given a step-by step instruction (doing X expected Y
> observed Z).
Thank you, I appreciate that. I don't know what to expect down to the syscall level. But, I can give steps and expectations on the user-interaction level. However, these are my expectations after reading the PyPlot readme file, and according to my memory of how it used to work about half a year ago outside of Nix. Unfortunately, the opensuse package for Julia seems to be broken, so I cannot easily test another Julia installation outside of Nix. (I'm running Nix on openSUSE 13.1 64bit)
So, here it goes: Take the file `default.nix` listed below, and start a nix-shell with it. In that nix-shell execute
sh$ julia
julia> Pkg.add("PyPlot")
julia> using PyPlot
julia> pygui(:qt); using PyPlot
julia> plt.isinteractive() # Should print true
julia> plt.plot([1,2,3], [1,2,4])
julia> plt.show() # Should show a gui window with a line-plot.
``` default.nix
{ nixpkgs ? <nixpkgs>
, system ? builtins.currentSystem }:
with (import nixpkgs { inherit system; });
let py = pkgs.pythonPackages; in
stdenv.mkDerivation {
name = "dummy";
src = ./empty;
buildInputs = with py; [
stdenv python readline ipython julia pyqt4 matplotlib
];
}
```
Best, Andreas
More information about the nix-dev
mailing list