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 <[email protected]> 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.
>>
>

Reply via email to