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  
> wrote:
>
>> 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.
>>>
>>
>

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

2016-04-14 Thread Daniel Carrera
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  wrote:

> 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 (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.
>


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

2016-04-12 Thread Steven G. Johnson
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.