[julia-users] Re: ImageView very slow

2016-10-27 Thread Josef Heinen
Paul: Would be helpful to see the real data (file) you want to visualize 
and the plot you are expecting.



[julia-users] Re: ImageView very slow

2016-10-26 Thread Josef Heinen
Using GR (for the image display) should be fast enough:

using TestImages
using GR

img = testimage("cameraman")
intensities = reshape(reshape(float(img.data[:]), 512, 512)

for i in 1:10
tic(); imshow(intensities, colormap=GR.COLORMAP_GRAY); toc() 
end


% julia img.jl 

elapsed time: 1.190862896 seconds

elapsed time: 0.007231715 seconds

elapsed time: 0.013265573 seconds

elapsed time: 0.00677057 seconds

elapsed time: 0.012534283 seconds

elapsed time: 0.010761427 seconds

elapsed time: 0.00731559 seconds

elapsed time: 0.009606974 seconds

elapsed time: 0.007050752 seconds

elapsed time: 0.008927604 seconds

The first call is slower because the window has to be set up.




On Sunday, October 16, 2016 at 6:45:00 PM UTC+2, Paul B. wrote:
>
> Hello, all.  Starting out with Julia.
>
> I need to display some pseudo-color images so I'm playing around with the 
> ImageView package.  It seems to be running very slowly.  Displaying one of 
> the images from TestImages can take nearly a minute:
> img = testimage( "cameraman" )
> Gray Images.Image with:
>   data: 512×512 Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2
> }
>   properties:
> colorspace: Gray
> spatialorder:  x y
>
> julia> tic(); ImageView.view( img ); toc();
> elapsed time: 50.552471225 seconds
> Zooming and other interaction with the mouse is similarly sluggish.
>
> I didn't expect this for a 512x512 grayscale image.  I am running Julia 
> version 0.5.1-pre+2 and ImageView is running into some issues with 
> deprecated functionality and namespace conflicts.  However, the above did 
> not generate any warnings at all but still took 50 seconds to display.  
> This is all under Linux.  Any ideas why this is happening or if I could be 
> doing something wrong?
>


[julia-users] Re: Status of Plots.jl?

2016-10-20 Thread Josef Heinen
GR v0.16.0 should be available soon. I made a PR 
<https://github.com/JuliaLang/METADATA.jl/pull/6817> this morning ...


On Tuesday, October 18, 2016 at 4:46:42 AM UTC+2, missp...@gmail.com wrote:
>
> Thanks a lot Chris and Josef
>
> I was missing the inline("atom")
> I hope GR helps me on plotting faster than PyPlot.
>
> thanks,
>
> On Monday, October 17, 2016 at 6:22:51 AM UTC-7, Josef Heinen wrote:
>>
>> You should probably test (plain) GR first:
>>
>> using GR
>> inline("atom")
>> histogram(randn(1))
>>
>>
>> Did you checkout GR master and download the latest run-time?
>>
>> Pkg.checkout("GR") 
>> ENV["GRDIR"]=""
>> Pkg.build("GR")
>>
>>
>> On Sunday, October 16, 2016 at 6:45:07 PM UTC+2, missp...@gmail.com 
>> wrote:
>>>
>>> Hi folks,
>>>
>>> I don't seem to be able to have the display of a graph in GR. I'm 
>>> calling the instructions using Atom. 
>>>
>>> could someone post a Hello World example?
>>>
>>> thanks, 
>>>
>>> On Thursday, March 10, 2016 at 5:11:57 AM UTC-8, Daniel Carrera wrote:
>>>>
>>>> Hello,
>>>>
>>>> Does anyone know the status of Plots.jl? It seems to have come a long 
>>>> way. At least the documentation makes it look pretty complete:
>>>>
>>>> http://plots.readthedocs.org/en/latest/
>>>>
>>>> I'm looking at the backends. Does anyone know what "Gr", "Qwt", and 
>>>> "unicodeplots" are? Apparently support for Winston was dropped?
>>>>
>>>> https://github.com/tbreloff/Plots.jl/issues/152
>>>>
>>>> I don't use Winston, but I'm curious to know what happened. Was Winston 
>>>> hard to support?
>>>>
>>>> I am currently using PyPlot because I need the maturity of Matplotlib, 
>>>> but I am happy to see all the effort that's going into making a native 
>>>> plotting library for Julia.
>>>>
>>>> Cheers,
>>>> Daniel.
>>>>
>>>

[julia-users] Re: GR error

2016-10-20 Thread Josef Heinen
This has been fixed some time ago. This morning, I tagged a new GR version 
(v0.16.0), but the PR  
has not been merged yet.


On Thursday, October 20, 2016 at 12:09:31 PM UTC+2, Henri Girard wrote:
>
> I am trying to run Animated view of the Riemann Zeta function 
> 
>
> from GR framework, on julia 0.5 ubuntu 16.04
>
> The last :
>
> f = zeta
> for n = 5:30
> plot_domain(domain_colors, 
> f, re=(-6, 6), im=(-20, 20), N=15, n=n)
> end
>
> gives me this error ?
>
> UndefVarError: Uint32 not defined
>
>  in #plot_domain#3(::Tuple{Int64,Int64}, ::Tuple{Int64,Int64}, ::Int64, 
> ::Int64, ::Function, ::#domain_colors, ::Function) at ./In[6]:9
>  in (::#kw##plot_domain)(::Array{Any,1}, ::#plot_domain, ::Function, 
> ::Function) at ./:0
>  in macro expansion; at ./In[7]:3 [inlined]
>  in anonymous at ./:?
>
>
> Any help ? Is it not working on 64 bits ?
> Regards
> Henri
>
> ​
>
>

[julia-users] Wrap Julia docstrings in Atom

2016-10-18 Thread Josef Heinen
Is there a way to wrap Julia docstrings in Atom? The editor currently 
displays two lines, one containing the method signature (first line) and 
one containing the following lines of the docstring. How can I configure 
Atom to wrap the second line?





[julia-users] Re: Status of Plots.jl?

2016-10-17 Thread Josef Heinen
You should probably test (plain) GR first:

using GR
inline("atom")
histogram(randn(1))


Did you checkout GR master and download the latest run-time?

Pkg.checkout("GR") 
ENV["GRDIR"]=""
Pkg.build("GR")


On Sunday, October 16, 2016 at 6:45:07 PM UTC+2, missp...@gmail.com wrote:
>
> Hi folks,
>
> I don't seem to be able to have the display of a graph in GR. I'm calling 
> the instructions using Atom. 
>
> could someone post a Hello World example?
>
> thanks, 
>
> On Thursday, March 10, 2016 at 5:11:57 AM UTC-8, Daniel Carrera wrote:
>>
>> Hello,
>>
>> Does anyone know the status of Plots.jl? It seems to have come a long 
>> way. At least the documentation makes it look pretty complete:
>>
>> http://plots.readthedocs.org/en/latest/
>>
>> I'm looking at the backends. Does anyone know what "Gr", "Qwt", and 
>> "unicodeplots" are? Apparently support for Winston was dropped?
>>
>> https://github.com/tbreloff/Plots.jl/issues/152
>>
>> I don't use Winston, but I'm curious to know what happened. Was Winston 
>> hard to support?
>>
>> I am currently using PyPlot because I need the maturity of Matplotlib, 
>> but I am happy to see all the effort that's going into making a native 
>> plotting library for Julia.
>>
>> Cheers,
>> Daniel.
>>
>

[julia-users] Re: Status of Plots.jl?

2016-10-17 Thread Josef Heinen
You should probably test (plain) GR first:
```

using GR

inline("atom")

histogram(randn(1))
```

Did you ``Pkg.checkout("GR") and download the latest run-time?
```
ENV["GRDIR"]=""
Pkg.build("GR")
```

On Sunday, October 16, 2016 at 6:45:07 PM UTC+2, missp...@gmail.com wrote:
>
> Hi folks,
>
> I don't seem to be able to have the display of a graph in GR. I'm calling 
> the instructions using Atom. 
>
> could someone post a Hello World example?
>
> thanks, 
>
> On Thursday, March 10, 2016 at 5:11:57 AM UTC-8, Daniel Carrera wrote:
>>
>> Hello,
>>
>> Does anyone know the status of Plots.jl? It seems to have come a long 
>> way. At least the documentation makes it look pretty complete:
>>
>> http://plots.readthedocs.org/en/latest/
>>
>> I'm looking at the backends. Does anyone know what "Gr", "Qwt", and 
>> "unicodeplots" are? Apparently support for Winston was dropped?
>>
>> https://github.com/tbreloff/Plots.jl/issues/152
>>
>> I don't use Winston, but I'm curious to know what happened. Was Winston 
>> hard to support?
>>
>> I am currently using PyPlot because I need the maturity of Matplotlib, 
>> but I am happy to see all the effort that's going into making a native 
>> plotting library for Julia.
>>
>> Cheers,
>> Daniel.
>>
>

Re: [julia-users] Re: Interactive Animated PyPlot in IJulia

2016-07-30 Thread Josef Heinen
The first animation (slide 10) updates a 3d surface frame by frame - the 
noise added could also be the result of an intensive calculation or a 
real-time signal. There is a demo in the GR example section showing a 3d 
power spectrum calculated from the microphone audio input ...

On Saturday, July 30, 2016 at 11:12:43 AM UTC+2, Thomas Hudson wrote:
>
> This isn't quite what I want: as with the discussion above, while 
> the example code has a sequence of predetermined graphs to be plotted, what 
> I'm really interested in is plotting the results of a more 
> intensive calculation frame by frame as it runs, rather than doing the 
> calculation of the entire trajectory, and plotting a manipulable plot after 
> the fact.
>
> Nevertheless, it's useful to know that you can do some fancy plot 
> manipulation in this way!
>
> On Saturday, 30 July 2016, Josef Heinen <j.he...@me.com > 
> wrote:
>
>> This 
>> <https://www.google.com/url?q=https%3A%2F%2Ftwitter.com%2Fjosef_heinen%2Fstatus%2F702885176385380352=D=1=AFQjCNEJK8hXL6FHoVnKwwDh6beMFSxM5w>
>>  is 
>> probably what you are looking for. If you need special Matplotlib features, 
>> you can even mix GR and PyPlot (see slides 10 and 13 from my 
>> <http://www.google.com/url?q=http%3A%2F%2Fpgi-jcns.fz-juelich.de%2Fpub%2Fdoc%2FSciPy_2016%2Fhtml=D=1=AFQjCNGc29rCC-bHqkKzSLgCf7DP3t0iFQ>
>>  SciPy 
>> 2016 talk which demonstrate the performance and interoperability)
>>
>> On Friday, July 29, 2016 at 5:03:11 PM UTC+2, Christoph Ortner wrote:
>>>
>>> Thanks for figuring this out, Tom.  I'd also be interested in a Reactive 
>>> and Interact solution.
>>>
>>
>>

[julia-users] Re: Interactive Animated PyPlot in IJulia

2016-07-30 Thread Josef Heinen
This 

 is 
probably what you are looking for. If you need special Matplotlib features, 
you can even mix GR and PyPlot (see slides 10 and 13 from my 

 SciPy 
2016 talk which demonstrate the performance and interoperability)

On Friday, July 29, 2016 at 5:03:11 PM UTC+2, Christoph Ortner wrote:
>
> Thanks for figuring this out, Tom.  I'd also be interested in a Reactive 
> and Interact solution.
>



[julia-users] Re: Interactive Animated PyPlot in IJulia

2016-07-30 Thread Josef Heinen
This  is 
probably what you are looking for. If you need special Matplotlib features, 
you can even mix GR and PyPlot (see slides 10 and 12 this 
 SciPy 2016 talk)

On Friday, July 29, 2016 at 5:03:11 PM UTC+2, Christoph Ortner wrote:
>
> Thanks for figuring this out, Tom.  I'd also be interested in a Reactive 
> and Interact solution.
>


[julia-users] Re: GR subplots

2016-07-24 Thread Josef Heinen
The usage of the subplot() command should be the same as in MATLAB, e.g.

using GR

x = linspace(-3.8, 3.8)

y_cos = cos(x)

y_poly = 1 - x.^2./2 + x.^4./24

subplot(2, 2, 1)

plot(x, y_cos)

subplot(2, 2, 2)

plot(x, y_poly, "g")

subplot(2, 2, [3, 4])

plot(x, y_cos, "b", x, y_poly, "g")


... will produce the following plot: 





On Saturday, July 23, 2016 at 8:58:10 PM UTC+2, Ted E wrote:
>
> Hi,
>
> I am having a bit of trouble figuring out how to use the subplots function 
> in GR.jl (awesome package btw!)
> Does anyone have an example of how arrange plots on a grid using the 
> function?
>
> Best,
>
> Ted 
>


[julia-users] Re: A Very Simple Benchmark for Brutal-force Loops in Several Languages: Julia far from approaching C++ speed - any suggestions?

2016-07-11 Thread Josef Heinen
Put a function around the code and everything works as expected:

function perf()

nsamples = 100;


x = linspace(0, 5, nsamples);

y = zeros(nsamples);

noise = zeros(nsamples);



a = rand(); a = cos(0.0); a = 1.5*2.5; a = 1.5+2.5;



println("\nBrutal-force loops, 100 times:")

for m = 1:100

morenoise = rand();

for n = 1:nsamples

noise[n] = rand();

y[n] = cos(2*x[n]+5) + noise[n] + morenoise;

end

end

end


@time(perf())


*Brutal-force loops, 100 times:*

*  2.964993 seconds (151.75 k allocations: 21.837 MB, 0.68% gc time)*


On Monday, July 11, 2016 at 8:57:05 AM UTC+2, Zhong Pan wrote:
>
> Hi,
>
> For work I really desired a language for numerical / data processing 
> that's as easy and capable as Python but still fast running loops. That's 
> why I am very excited when I noticed Julia. First allow me to me say, 
> fabulous work! I really appreciate the effort of those who make open-source 
> software great for everyone.
>
> I did a simple & naive benchmark involving brutal-force loops with some 
> floating-point calculations on Windows (have to use Windows for work). I 
> measured execution time in Python, Julia, VC++, C#.NET, Java, and Matlab. 
> To my surprise, Julia is not only much slower than VC++ in this test, but 
> it's much slower than C#.NET, Java, and even Matlab.
>
> Please see details of the test in the attached PDF file. Could someone 
> help me out here - did I make an amateur mistake or miss something? Was 
> Julia slow because of Windows? Or was it just the loops that's slow (as 
> this "benchmark" really didn't test anything else)? I really want to make 
> Julia my go-to language in work, so any suggestion is appreciated.
>
> Cheers.
> -Zhong
>
>
>

[julia-users] Re: Julia version of Matplotlib griddata?

2016-07-09 Thread Josef Heinen
You can use the GR framework, e.g.

srand(0)
xd = -2 + 4 * rand(100)
yd = -2 + 4 * rand(100)
zd = [Float64(xd[i] * exp(-xd[i]^2 - yd[i]^2)) for i = 1:100]

using GR
contour(xd, yd, zd, colormap=44)



If you only need the gridded data, use the GR gridit function, e.g. (to 
obtain a 200 x 200 grid):

x, y, z = GR.gridit(xd, yd, zd, 200, 200)


On Saturday, July 9, 2016 at 12:57:51 AM UTC+2, Kaj Wiik wrote:
>
> Is there a Julia version of irregularly spaced data gridding that does
> zi = griddata(x,y,z,xi,yi), i.e. all arguments are 1d vectors? It seems 
> that Julia interp and contour packages require x, y, z[x,y].
>
>
> https://scipy.github.io/old-wiki/pages/Cookbook/Matplotlib/Gridding_irregularly_spaced_data.html
>
> Thanks,
> Kaj
>
>

[julia-users] Re: Julia version of Matplotlib griddata?

2016-07-09 Thread Josef Heinen
You can use the GR framework, e.g.

srand(0)

xd = -2 + 4 * rand(100)

yd = -2 + 4 * rand(100)

zd = [Float64(xd[i] * exp(-xd[i]^2 - yd[i]^2)) for i = 1:100]


using GR

contour(xd, yd, zd)




If you only need the mesh data, use the gridit function, e.g. (for a 200 x 
200 grid):


x, y, z = GR.gridit(xd, yd, zd, 200, 200)



On Saturday, July 9, 2016 at 12:57:51 AM UTC+2, Kaj Wiik wrote:
>
> Is there a Julia version of irregularly spaced data gridding that does
> zi = griddata(x,y,z,xi,yi), i.e. all arguments are 1d vectors? It seems 
> that Julia interp and contour packages require x, y, z[x,y].
>
>
> https://scipy.github.io/old-wiki/pages/Cookbook/Matplotlib/Gridding_irregularly_spaced_data.html
>
> Thanks,
> Kaj
>
>

[julia-users] Re: How do I plot into an ITerm2 window?

2016-07-08 Thread Josef Heinen
GR.jl works fine with Julia 0.5-dev:




On Friday, July 8, 2016 at 5:10:31 AM UTC+2, Randy Lai wrote:
>
> In case anyone needs it (Julia 0.5-dev).
>
> julia> using TerminalExtensions
>
> julia> f = open("/Users/Randy/Pictures/116.png");
> julia> d = read(f);
>
> julia> Base.show(b::Base64EncodePipe, ::MIME"image/png", x) = write(b, x)
>
> julia> display(TerminalExtensions.iTerm2.InlineDisplay(), 
> MIME("image/png"),d)
>


[julia-users] Re: What is the recommended way to update Julia in OS X with Julia.app?

2016-07-05 Thread Josef Heinen
You can simply replace the existing Julia.app.
The packages are installed in a separate folder $HOME/.julia.

On Monday, July 4, 2016 at 10:18:34 PM UTC+2, Garret Linn wrote:
>
> Hi
>
> Julia noob here
>
> What is the proper way to update Julia in OS X with Julia.app?
>
> I would like to update without having to re-install all packages.
>
> thanks in advance
> GL
>
>

[julia-users] Interact.jl + ipywidgets 5.x.x

2016-06-13 Thread Josef Heinen
Did anyone manage to get Interact.jl working with an up-to-date version of 
ipywidgets? I had to setup a special environment containing ipywidgets 
v4.1.1 and notebook v4.2.0 to use Interact.jl in Jupyter with a Julia 0.4.5 
kernel by overwriting the PYTHONPATH before starting jupyter notebook:

export PYTHONPATH=/usr/local/envs/ipywidgets-4.1.1:${PYTHONPATH}


[julia-users] Re: Any up-to-date Julia package for nonlinear regression?

2016-05-27 Thread Josef Heinen
What about LsqFit? Here is an example for a similar model (Lorentz fit):

using LsqFit

x = -16:0.5:35
y = 19.4./((x - 7).^2 + 15.8) + randn(size(x))./10;  

model(x, p) = p[1]./((x-p[2]).^2+p[3]) 

fit = curve_fit(model, x, y, [25.,10.,10.]) 
p = fit.param 
f = p[1]./((x-p[2]).^2+p[3]) 

using GR 
plot(x, y, "d", x, f, "-", linewidth=2)


... and the result:






On Friday, May 27, 2016 at 12:18:16 AM UTC+2, Jan Drugowitsch wrote:
>
> Hi all,
>
> I have some nonlinear regression problems that I'd like to solve. 
> Unfortunately, NLreg.jl doesn't seem to work on my Julia 0.4.5 
> installation, but instead fails on the README example code with
>
> julia> const sd1 = readtable(Pkg.dir("NLreg","data","sd1.csv.gz"));
>
>
> julia> nl = fit(BolusSD1(CONC ~ TIME, sd1))
> WARNING: [a,b] concatenation is deprecated; use [a;b] instead
>  in depwarn at deprecated.jl:73
>  in oldstyle_vcat_warning at /Applications/Julia-0.4.5.app/Contents/
> Resources/julia/lib/julia/sys.dylib
>  in call at /Users/jandrugowitsch/.julia/v0.4/NLreg/src/plreg.jl:119
>  in fit at /Users/jandrugowitsch/.julia/v0.4/NLreg/src/plreg.jl:204
> while loading no file, in expression starting on line 0
> ERROR: type Array has no field data
>  in gpinc at /Users/jandrugowitsch/.julia/v0.4/NLreg/src/plreg.jl:143
>  in gpfit at /Users/jandrugowitsch/.julia/v0.4/NLreg/src/plreg.jl:159
>  in fit at /Users/jandrugowitsch/.julia/v0.4/NLreg/src/plreg.jl:204
>
>
> In general, NLreg.jl hasn't been updated since 2014. Are there any more 
> up-to-date Julia packages for nonlinear regression?
>
> I know that I could always use optimizers, but then I won't get all the 
> extra statistics that I would need.
>
> Thanks,
> Jan
>


Re: [julia-users] Re: Need help with GR and PyPlot

2016-04-14 Thread Josef Heinen
Both problems are solved with the latest build. Please rebuild (or 
re-install) the GR.jl master branch.

It seems, that the (new) Cairo backend needs some more testing :-)

Regards,
Josef

On Thursday, April 14, 2016 at 8:59:37 AM UTC+2, Daniel Carrera wrote:
>
> Hello Josef,
>
> Thanks for the help. I am now back in front of my Macbook and I tried your 
> instructions. savefig() still doesn't work but the message is different now:
>
> julia> savefig("plot.png")
> GKS: dlopen(/Users/daniel/.julia/v0.4/GR/deps/gr/lib/cairoplugin.so, 1): 
> Library not loaded: 
> /Users/jheinen/src/gr/3rdparty/cairo/../build/lib/libcairo.2.dylib
>
> Referenced from: /Users/daniel/.julia/v0.4/GR/deps/gr/lib/cairoplugin.so
> Reason: image not found
>
> It seems to have "/Users/jheinen/..." hard-coded in somewhere. I checked, 
> and this is only a problem with OS X. On my Ubuntu workstation savefig() 
> works fine. While we are on the subject of experimenting with GR, I noticed 
> that xlabel() and ylabel() do not display text in parenthesis. For example:
>
>
> xlabel("Time (ms)")
> ylabel("Height (km)")
>
> On the plot, these will show as just "Time" and "Height". This happens on 
> both OSX and Ubuntu.
>
> I will try the PyPlot patch later. I'd like to see how the plots look. 
> Thanks for your work on GR and making the backend for Matplotlib.
>
> Cheers,
> Daniel.
>
>
> On 13 April 2016 at 13:57, Josef Heinen <j.he...@me.com > 
> wrote:
>
>> To solve the PyPlot backend problem, I made a PR (Add support for the GR 
>> backend #207 <https://github.com/stevengj/PyPlot.jl/pull/207>) . This 
>> patch solved the problem for me.
>>
>> To fix the savefig() problem, please checkout the GR.jl master ( Pkg.
>> checkout("GR")) and/or rebuild the package.
>> There was a configuration error on my build system (for OS X) which I 
>> didn't realize. Sorry!
>>
>> Regards,
>> Josef
>>
>> On Wednesday, April 13, 2016 at 1:34:31 AM UTC+2, Daniel Carrera wrote:
>>>
>>> Hello,
>>>
>>> So... GR is a new plotting framework that is faster than Matplotlib and 
>>> can be used as a backend for Matplotlib, including Julia's PyPlot package.
>>>
>>> https://github.com/jheinen/gr
>>> http://gr-framework.org/tutorials/matplotlib.html
>>>
>>> I have installed GR,
>>>
>>> > Pkg.add("GR")
>>>
>>> and my reading of the second link is that all I have to do to get 
>>> Matplotlib to use GR is change an environment variable:
>>>
>>> export MPLBACKEND="module://gr.matplotlib.backend_gr"
>>>
>>>
>>> So I did that, but that doesn't seem to have changed anything in PyPlot:
>>>
>>> julia> using PyPlot
>>>
>>> julia> plt[:get_backend]()
>>> "TkAgg"
>>>
>>> julia> plt[:switch_backend]()
>>>
>>> ERROR ... valid backends are ['pdf', 'pgf', 'Qt4Agg', 'Gtk' ...] 
>>>
>>>
>>> So it looks like I'm missing some steps. I don't know whether the 
>>> problem is on the Julia side or the Python side. Does anyone know how to 
>>> get PyPlot to work with GR?
>>>
>>>
>>> On a related note, I tried using GR on its own. It went well until I 
>>> tried to save.
>>>
>>> julia> using GR
>>> ...
>>> julia> savefig("plot.png")
>>> GKS: Ghostscript support not compiled in
>>>
>>>
>>> Since GKS was installed by `Pkg.add()`, I don't know how I'm supposed to 
>>> recompile it with Ghostscript support. Does anyone know?
>>>
>>>
>>> Thanks for the help.
>>>
>>> Cheers,
>>> Daniel.
>>>
>>
>

[julia-users] Re: Need help with GR and PyPlot

2016-04-13 Thread Josef Heinen
To solve the PyPlot backend problem, I made a PR (Add support for the GR 
backend #207 ) . This patch 
solved the problem for me.

To fix the savefig() problem, please checkout the GR.jl master ( Pkg.
checkout("GR")) and/or rebuild the package.
There was a configuration error on my build system (for OS X) which I 
didn't realize. Sorry!

Regards,
Josef

On Wednesday, April 13, 2016 at 1:34:31 AM UTC+2, Daniel Carrera wrote:
>
> Hello,
>
> So... GR is a new plotting framework that is faster than Matplotlib and 
> can be used as a backend for Matplotlib, including Julia's PyPlot package.
>
> https://github.com/jheinen/gr
> http://gr-framework.org/tutorials/matplotlib.html
>
> I have installed GR,
>
> > Pkg.add("GR")
>
> and my reading of the second link is that all I have to do to get 
> Matplotlib to use GR is change an environment variable:
>
> export MPLBACKEND="module://gr.matplotlib.backend_gr"
>
>
> So I did that, but that doesn't seem to have changed anything in PyPlot:
>
> julia> using PyPlot
>
> julia> plt[:get_backend]()
> "TkAgg"
>
> julia> plt[:switch_backend]()
>
> ERROR ... valid backends are ['pdf', 'pgf', 'Qt4Agg', 'Gtk' ...] 
>
>
> So it looks like I'm missing some steps. I don't know whether the problem 
> is on the Julia side or the Python side. Does anyone know how to get PyPlot 
> to work with GR?
>
>
> On a related note, I tried using GR on its own. It went well until I tried 
> to save.
>
> julia> using GR
> ...
> julia> savefig("plot.png")
> GKS: Ghostscript support not compiled in
>
>
> Since GKS was installed by `Pkg.add()`, I don't know how I'm supposed to 
> recompile it with Ghostscript support. Does anyone know?
>
>
> Thanks for the help.
>
> Cheers,
> Daniel.
>


[julia-users] Re: Need help with GR and PyPlot

2016-04-13 Thread Josef Heinen
To solve the PyPlot backend problem, I made a PR. This patch solved the 
problem for me.

To fix the ``savefig`` problem, please checkout the GR.jl master 
(``Pkg.checkout("GR")``) and/or rebuild the package.
There was a configuration error on my build system (for OS X) which I 
didn't realize. Sorry!

Regards,
Josef

On Wednesday, April 13, 2016 at 1:34:31 AM UTC+2, Daniel Carrera wrote:
>
> Hello,
>
> So... GR is a new plotting framework that is faster than Matplotlib and 
> can be used as a backend for Matplotlib, including Julia's PyPlot package.
>
> https://github.com/jheinen/gr
> http://gr-framework.org/tutorials/matplotlib.html
>
> I have installed GR,
>
> > Pkg.add("GR")
>
> and my reading of the second link is that all I have to do to get 
> Matplotlib to use GR is change an environment variable:
>
> export MPLBACKEND="module://gr.matplotlib.backend_gr"
>
>
> So I did that, but that doesn't seem to have changed anything in PyPlot:
>
> julia> using PyPlot
>
> julia> plt[:get_backend]()
> "TkAgg"
>
> julia> plt[:switch_backend]()
>
> ERROR ... valid backends are ['pdf', 'pgf', 'Qt4Agg', 'Gtk' ...] 
>
>
> So it looks like I'm missing some steps. I don't know whether the problem 
> is on the Julia side or the Python side. Does anyone know how to get PyPlot 
> to work with GR?
>
>
> On a related note, I tried using GR on its own. It went well until I tried 
> to save.
>
> julia> using GR
> ...
> julia> savefig("plot.png")
> GKS: Ghostscript support not compiled in
>
>
> Since GKS was installed by `Pkg.add()`, I don't know how I'm supposed to 
> recompile it with Ghostscript support. Does anyone know?
>
>
> Thanks for the help.
>
> Cheers,
> Daniel.
>


[julia-users] Re: Need help with GR and PyPlot

2016-04-13 Thread Josef Heinen
I made a PR (Add support for the GR backend #207 
) to enable GR support for 
the PyPlot library. It would be nice if the changes could be merged.

I don't know, why showing the plot should freeze everything else.

Changing the backend to GR did speed-up the following animation example by 
a factor > 3:

ENV["MPLBACKEND"] = "module://gr.matplotlib.backend_gr"

import PyPlot

x = collect(0:0.01:2*pi)
line, = PyPlot.plot(x, sin(x))

for i = 1:200
line[:set_ydata](sin(x + i / 10.0))
PyPlot.draw()
PyPlot.pause(0.0001)
end


Thanks in advance,

Josef


On Wednesday, April 13, 2016 at 5:11:21 AM UTC+2, Steven G. Johnson wrote:
>
> The PyPlot library doesn't currently support the GR backend, mainly 
> because it doesn't know how to do event loops for this backend (which is 
> important for interactive plotting, so that showing the plot doesn't freeze 
> everything else). 
>
> As I understand it, GR can use Qt or wx for the UI?  In which case PyCall 
> does implement these event loops, and PyPlot just needs to be able to 
> figure out which event loop to start.
>


Re: [julia-users] Re: Status of Plots.jl?

2016-03-25 Thread Josef Heinen
Which platform are you using? Please try to checkout the master branch: 
Pkg.checkout("GR")


On Wednesday, March 23, 2016 at 8:24:27 AM UTC+1, Dupont wrote:

> Hi,
>
> I tried your dev branch as suggested,
>
> julia> Pkg.status("Plots")
>  - Plots 0.5.3+ dev
>
>
>
>  but when typing in Atom:
>
> using Plots
> Plots.gr()
> Plots.plot(rand(100))
>
>
> nothing appeared. Do I have to do something else?
>


Re: [julia-users] Re: Status of Plots.jl?

2016-03-13 Thread Josef Heinen
GR supports the wxWidgets and Qt4 toolkits. Last week I added support for 
Cairo graphics, which can be used as a drawing library for GTK+. So, 
support for the GTK+ toolkit is on my radar ...

On Saturday, March 12, 2016 at 6:53:21 PM UTC+1, jonatha...@alumni.epfl.ch 
wrote:
>
> GR seems pretty good, can it uses Gtk to display plots ?
>


Re: [julia-users] Re: Status of Plots.jl?

2016-03-11 Thread Josef Heinen
The convenience layer is WIP, so you have to checkout the GR master branch: 
Pkg.checkout("GR")

On Friday, March 11, 2016 at 8:43:09 PM UTC+1, Philippe Roy wrote:
>
> Thanks,
>
> However, I get the "scatter is not defined" by typing your example inside 
> Juno/Atom and Juno/LT.
>


Re: [julia-users] Re: Status of Plots.jl?

2016-03-11 Thread Josef Heinen
GR.jl is also supported inside Atom, either standalone (see screenshot), or 
as a backend for Plots.jl or PyPlot.jl (Matplotlib).




On Friday, March 11, 2016 at 3:35:07 PM UTC+1, Philippe Roy wrote:
>
> Hi! Nice package Tom. Is this supposed to work inside Atom with the julia 
> "IDE" ? The plots seems to work, but I really don't know where they appear! 
> they're not in the plots pane (I think only Gadfly is supported as of now 
> inside Atom).
>
> Thanks for any help!
>
> Le jeudi 10 mars 2016 14:08:23 UTC-5, Tom Breloff a écrit :
>>
>> You should read up more on PlotlyJS: http://spencerlyon.com/PlotlyJS.jl/
>>
>> Or from the Plots docs:
>>
>> Plotly / PlotlyJS
>>> These are treated as separate backends, though they share much of the 
>>> code and use the Plotly javascript API.  plotly() is the only 
>>> dependency-free plotting option, as the required javascript is bundled with 
>>> Plots. It can create inline plots in IJulia, or open standalone browser 
>>> windows when run from the Julia REPL.
>>> plotlyjs() is the preferred option, and taps into the great 
>>> functionality of Spencer Lyon's PlotlyJS.jl. Inline IJulia plots can be 
>>> updated from any cell... something that makes this backend stand out. From 
>>> the Julia REPL, it taps into Blink.jl and Electron to plot within a 
>>> standalone GUI window... also very cool.
>>
>>
>> On Thu, Mar 10, 2016 at 2:03 PM, Daniel Carrera  
>> wrote:
>>
>>> On 10 March 2016 at 18:23, Tom Breloff  wrote:
>>>

 On Thu, Mar 10, 2016 at 12:08 PM, j verzani  wrote:

> As someone who has watched his calculus students struggle with what 
> should be a trivial task -- the installation of `Plots` on `juliabox`, 
> I've 
> wished it were part of base. 
>

 While in my (very biased) opinion I think Plots should be the first 
 package new users install, I don't think it belongs in base.  (please 
 don't 
 make me rebuild julia to hack on Plots ;)

>>>
>>>
>>> I think Plots could be part of the "standard library" (to borrow a term 
>>> from Python). So it would not be in Base, but it could be pre-installed. 
>>> Plotting is one of the most common things that scientists and engineers do. 
>>> Maybe not right now, but when Plots is more mature.
>>>
>>> Speaking of which, I'm also having trouble with PlotlyJS.
>>>
>>>
>>> julia> plotlyjs()
>>> Plots.PlotlyJSPackage()
>>>
>>> julia> plot(Plots.fakedata(50,5),w=3)
>>> [Plots.jl] Initializing backend: plotlyjs
>>> INFO: Precompiling module Blink...
>>> INFO: Recompiling stale cache file 
>>> /home/daniel/.julia/lib/v0.4/Nettle.ji for module Nettle.
>>> ERROR: Cannot find Electron. Try `AtomShell.install()`.
>>>  in electron at 
>>> /home/daniel/.julia/v0.4/Blink/src/AtomShell/process.jl:49
>>>  ...
>>>
>>>
>>> For some reason, PlotlyJS seems to think that I am running it from Atom. 
>>> :-(
>>>
>>>
>>>
>>

[julia-users] Re: 3D scatter / meshed surface color map

2016-03-03 Thread Josef Heinen
I could re-produce the problem on a fresh Windows installation.
Removing the downloaded archive leads to a chmod error, although I don't 
use this function in build.jl.
Will have to use another method to delete the file.

Nevertheless, the package should be installed 

On Thursday, March 3, 2016 at 3:13:33 PM UTC+1, J Luis wrote:
>
> But unfortunately on Windows
>
> INFO: Downloading pre-compiled GR 0.17.3 binary
> =[ ERROR: GR 
> ]==
>
> LoadError: chmod: no such file or directory (ENOENT)
> while loading C:\j\.julia\v0.4\GR\deps\build.jl, in expression starting 
> on line 25
>
>

[julia-users] Re: 3D scatter / meshed surface color map

2016-03-03 Thread Josef Heinen
Which version are you using?

=> *Pkg.installed("GR")*


On Thursday, March 3, 2016 at 3:13:33 PM UTC+1, J Luis wrote:
>
> But unfortunately on Windows
>
> INFO: Downloading pre-compiled GR 0.17.3 binary
> =[ ERROR: GR 
> ]==
>
> LoadError: chmod: no such file or directory (ENOENT)
> while loading C:\j\.julia\v0.4\GR\deps\build.jl, in expression starting 
> on line 25
>
>
>
> quinta-feira, 3 de Março de 2016 às 08:26:20 UTC, Josef Heinen escreveu:
>>
>> *Pkg.add("GR")*
>>
>> *using GR*
>> *z = peaks()*
>> *surface(z)*
>>
>>
>> <https://lh3.googleusercontent.com/-2CSDxUlOqeM/Vtf1BpM3awI/ACE/gUeA-pQotpQ/s1600/surface.png>
>>
>>
>>
>> On Thursday, March 3, 2016 at 5:10:52 AM UTC+1, mauri...@gmail.com wrote:
>>>
>>> Hello Julia users, 
>>>
>>> I would like to know if anyone knows how we can have 3D scatter plots or 
>>> meshed surfaces color plots using Julia.  
>>>
>>> My problem is based on four variables, so I'm trying to visualize the 
>>> data according to these options. 
>>>
>>> Any idea or example code will be really helpful. 
>>>
>>> Thanks!
>>>
>>

[julia-users] Re: 3D scatter / meshed surface color map

2016-03-03 Thread Josef Heinen
*Pkg.add("GR")*

*using GR*
*z = peaks()*
*surface(z)*





On Thursday, March 3, 2016 at 5:10:52 AM UTC+1, mauri...@gmail.com wrote:
>
> Hello Julia users, 
>
> I would like to know if anyone knows how we can have 3D scatter plots or 
> meshed surfaces color plots using Julia.  
>
> My problem is based on four variables, so I'm trying to visualize the data 
> according to these options. 
>
> Any idea or example code will be really helpful. 
>
> Thanks!
>


[julia-users] Re: [ANN] GLVisualize

2016-02-29 Thread Josef Heinen

>
> >I wonder if it will be the Matplotlib of Julia
>
 

While possible, it will need quite a bit of work :) Offering the 
> flexibility and usability of Matplotlib is no easy task! 
> Right now the strength rather lies in interactivity and easy means to 
> visualize animated and large data sets.
>
 

But there could be shortcuts like implementing a backend for Matplotlib 
> first.


@Simon: Matplotlib is probably too slow to produce graphics output for a 
library like Glvisualize. I had the same idea - after I finished writing a 
GR backend for MPL, I was really disappointed when I realized, that most of 
the time  (>95%) was spent in Matplotlib's artist layer.

Your shaders would probably be bored or fall asleep ;-)


[julia-users] GR.jl plotting enhancements

2016-02-29 Thread Josef Heinen
I finally found some time to upgrade the GR framework 
. It can now be used as a further alternative 
backend for Plots.jl , a wrapper for 
several plotting packages. The results can be seen here 
. In addition there 
are now also several convenience functions allowing to use GR quite similar 
to MATLAB's plot functions.

So, with the recent version, there's even more interoperability with 
different plotting environments, e.g.

   - use GR as a backend for Matplotlib (Demos 
   )
   - use GR as a backend for Plots.jl (Demo 
   )
   - user interaction by means of Interact.jl (Demo 
   )
   - use GR native MATLAB-like plot functions (Link 
   )

The latter is still incomplete, but I will add more  functions ASAP.

May be, there is also a chance to combine GR with Simon's powerful 
GLvisualize.jl  library - we are open to 
anything.


Re: [julia-users] How to unpack a .tar file in Julia?

2016-02-02 Thread Josef Heinen
Thanks for the info.

The problem is solved (in the meantime). See GR.jl commit 889f9d0



On Tuesday, February 2, 2016 at 12:34:45 AM UTC+1, Tony Kelman wrote:
>
> Check the BinDeps package for unpack_cmd
>
>
> On Monday, February 1, 2016 at 4:34:13 AM UTC-8, Aslak Grinsted wrote:
>>
>>
>> I have a problem that i do not have tar on my windows machine, and for 
>> that reason Pkg.build("GR") fails. I tried fixing it using 7zip as that was 
>> present in my julia bin folder by replacing 
>>
>> run(`tar xzf downloads/$tarball`)
>>
>> with 
>>
>> run(pipeline(`7z x -so downloads/$tarball`,`7z x -aoa -si -ttar -o"."`))
>>
>> --- That worked fine on my windows machine, but fails on travis: 
>> https://travis-ci.org/jheinen/GR.jl/jobs/106192456
>>
>> Any tips are welcome. 
>>
>>
>>
>>
>>
>>
>>
>>
>> On Tuesday, March 10, 2015 at 9:33:06 PM UTC+1, Stefan Karpinski wrote:
>>>
>>> I would just shell out to the tar command and then work with the 
>>> untarred directory.
>>>
>>> On Tue, Mar 10, 2015 at 4:05 PM, Weijian Zhang  
>>> wrote:
>>>
 Hello,

 I have a .tar.gz file. With GZip.jl, I can write code to unzip it to a 
 .tar file.
 But how can I unpack this .tar file in Julia?

 Thanks,

 Weijian


>>>

[julia-users] How to obtain package version

2015-07-23 Thread Josef Heinen
Is there another way to obtain the version of a package other than 
``Pkg.installed()``? Right now, I'm using the following code:

try

  if isinteractive()

import IJulia

if Pkg.installed(IJulia)  v0.2.5

  ...

end

  end

end

But, as we are using Julia in a managed desktop environment (for OS X and 
Linux) with the package root set to a common directory (export 
JULIA_PKGDIR=/usr/local/lib/julia),  the users don't habe write access to 
this directory and the Pkg.installed() command fails.



[julia-users] Re: How to obtain package version

2015-07-23 Thread Josef Heinen
Hi Andreas,

this is the error message ...

*julia **Pkg.installed(IJulia)*

*ERROR: failed process: Process(`git 
--work-tree=/usr/local/lib/julia/v0.3/IJulia 
--git-dir=/usr/local/lib/julia/v0.3/IJulia/.git update-index -q 
--really-refresh`, ProcessExited(128)) [128]*

* in error at 
/usr/local/Applications/Julia-0.3.10.app/Contents/Resources/julia/lib/julia/sys.dylib*

* in pipeline_error at process.jl:502*

* in success at pkg/git.jl:28*

* in iscommit at pkg/git.jl:54*

* in installed_version at 
/usr/local/Applications/Julia-0.3.10.app/Contents/Resources/julia/lib/julia/sys.dylib*

* in installed at pkg/entry.jl:100*

* in anonymous at pkg/dir.jl:28*

* in cd at 
/usr/local/Applications/Julia-0.3.10.app/Contents/Resources/julia/lib/julia/sys.dylib*

* in __cd#229__ at 
/usr/local/Applications/Julia-0.3.10.app/Contents/Resources/julia/lib/julia/sys.dylib*

* in installed at pkg.jl:26*

Regards,
Josef


On Thursday, July 23, 2015 at 10:00:12 AM UTC+2, Andreas Lobinger wrote:

 Hello colleague,

 1) please post the error message
 2) think about filing an issue on githup, asking Pkg for information 
 should not need write access (imho, maybe some caching attached here)




[julia-users] Julia operating mode (Juno, Jupyter)

2015-06-26 Thread Josef Heinen
Can anybody tell me, how to find out, whether we are running in a simple 
terminal session or in a GUI environment (Juni, Jupyter, ...) ?


[julia-users] Re: Julia operating mode (Juno, Jupyter)

2015-06-26 Thread Josef Heinen
Hi,

isdefined(:Juno) || isdefined(:IJulia) || ... seems to work fine. Thanks 
for your help ...

Right now, when using the GR framework (GR.jl), the user has to decide, 
whether the software should produce inline graphics (in Jupyter or Juno) or 
open a new canvas (X / GDI / Cocoa - depending on the OS) using the 
GR.inline() function. It would be more convenient, if the software could 
detect whether we are in a GUI environment or in a simple terminal session 
and set a reasonable operation mode as default ...

Here are some examples:

   - Matplotlib animation example 
   http://pgi-jcns.fz-juelich.de/pub/doc/JuliaCon_2015/anim.html
   - A molecular dynamics example 
   http://pgi-jcns.fz-juelich.de/pub/doc/JuliaCon_2015/700K_460.html


Thanks,
Josef


On Friday, June 26, 2015 at 9:50:00 AM UTC-4, Josef Heinen wrote:

 Can anybody tell me, how to find out, whether we are running in a simple 
 terminal session or in a GUI environment (Juni, Jupyter, ...) ?



[julia-users] Re: Julia operating mode (Juno, Jupyter)

2015-06-26 Thread Josef Heinen
Well, at the time, when I want to use such a function, the display stack is 
empty. GR has its own graphics backends and can be used as a substitute for 
Gadfly, PyPlot, etc.

On Friday, June 26, 2015 at 9:50:00 AM UTC-4, Josef Heinen wrote:

 Can anybody tell me, how to find out, whether we are running in a simple 
 terminal session or in a GUI environment (Juni, Jupyter, ...) ?