Quick questions on Fractals notebook...

203 views
Skip to first unread message

Fernando Perez

unread,
Sep 25, 2013, 9:47:51 PM9/25/13
to juli...@googlegroups.com
Hi folks,

I'm giving a talk tomorrow at LBL about IPython, and wanted to demo
IJulia with Jeff's notebook, but I'm having trouble both with pyplot
and compose:

1. I ran

julia> Pkg2.add("PyPlot")
INFO: Cloning cache of PyPlot from git://github.com/stevengj/PyPlot.jl.git
INFO: Cloning cache of Color from git://github.com/JuliaLang/Color.jl.git
INFO: Installing PyPlot v1.0.11
INFO: Installing Color v0.2.6
INFO: REQUIRE updated.

and in the notebook the pyplot code all runs fine, but the imshow call
just gives me this:

In [4]: imshow(m, cmap="RdGy", extent=[-1.5,1.5,-1,1])

Out[4]:
PyObject <matplotlib.image.AxesImage object at 0x7aa8a90>


with no figure displayed at all.


2. I installed compose with:

julia> Pkg2.add("Compose")
INFO: Cloning cache of Compose from git://github.com/dcjones/Compose.jl.git
INFO: Cloning cache of DataFrames from
git://github.com/JuliaStats/DataFrames.jl.git
INFO: Cloning cache of Blocks from git://github.com/tanmaykm/Blocks.jl.git
INFO: Cloning cache of GZip from git://github.com/kmsquire/GZip.jl.git
INFO: Cloning cache of Mustache from git://github.com/jverzani/Mustache.jl.git
INFO: Cloning cache of SortingAlgorithms from
git://github.com/JuliaLang/SortingAlgorithms.jl.git
INFO: Cloning cache of Stats from git://github.com/JuliaStats/Stats.jl.git
INFO: Installing Compose v0.1.11
INFO: Installing DataFrames v0.3.12
INFO: Installing Blocks v0.0.0
INFO: Installing GZip v0.2.5
INFO: Installing Mustache v0.0.0
INFO: Installing SortingAlgorithms v0.0.0
INFO: Installing Stats v0.2.7
INFO: REQUIRE updated.


but in that cell I get this:

In [5]: using Compose

Iterators not found
at /home/fperez/.julia/Compose/src/Compose.jl:3
at In[5]:1
in require at loading.jl:46
in include at boot.jl:238


This is all using a Julia build from today:

Version 0.2.0-prerelease+3843
Commit 61f8aba* 2013-09-25 23:47:55 UTC

and where I completely nuked my ~/.julia directory before starting.


Any thoughts/pointers? I can always use something else for a demo,
and I have some older examples with Julia, but I thought it would be
nice to use this one that really shows the native Julia machinery in
its full glory.

Thanks!

f


--
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail

Jeff Bezanson

unread,
Sep 25, 2013, 10:17:11 PM9/25/13
to juli...@googlegroups.com
Iterators seems to be missing from the package metadata for Compose.
Doing Pkg.add("Iterators") should fix item 2.

Item 1 is a bug I used to see, but is fixed for me in the latest
version of PyPlot, so I'm not sure about that one yet. Maybe Steve has
some ideas.

Daniel Jones

unread,
Sep 25, 2013, 10:22:09 PM9/25/13
to juli...@googlegroups.com

The compose issue is because I forgot to add the dependency on the Iterators package, so it wasn't installed. Installing it manually with Pkg.add("Iterators") should fix that. I'll update METADATA to fix it as well.

Fernando Perez

unread,
Sep 25, 2013, 10:28:23 PM9/25/13
to juli...@googlegroups.com
Hi Jeff,

On Wed, Sep 25, 2013 at 7:17 PM, Jeff Bezanson <jeff.b...@gmail.com> wrote:
> Iterators seems to be missing from the package metadata for Compose.
> Doing Pkg.add("Iterators") should fix item 2.

Indeed, though I used Pkg2 instead of Pkg. All OK now.

> Item 1 is a bug I used to see, but is fixed for me in the latest
> version of PyPlot, so I'm not sure about that one yet. Maybe Steve has
> some ideas.

If I go into ~/.julia/PyPlot, I see this as the last commit:

commit 59c19c7078985dd98e97d99a0fc4abda2f2f0ec7
Author: Steven G. Johnson <ste...@mit.edu>
Date: Mon Sep 23 11:06:13 2013 -0400

Are you on that same one? If you have an earlier one that works, I can
roll back...

Thanks for the help!

f

Steven G. Johnson

unread,
Sep 25, 2013, 10:32:31 PM9/25/13
to juli...@googlegroups.com
I haven't seen the problem with PyPlot that Jeff mentioned....

There have been occasional problems with buggy SVG support in browsers (IJulia sends both the SVG and the PNG version of the plot to IPython).  If you are using Chrome, can you try Firefox?

Fernando Perez

unread,
Sep 25, 2013, 10:34:15 PM9/25/13
to juli...@googlegroups.com
Same with either firefox or chrome... The return value is shown, but no figures.

Fernando Perez

unread,
Sep 25, 2013, 10:39:15 PM9/25/13
to juli...@googlegroups.com
I also made sure to revert to IPython 1.0.0 (I was testing with
master), just in case the issue was on our side. No difference.

Cheers,

f

Fernando Perez

unread,
Sep 25, 2013, 10:47:31 PM9/25/13
to juli...@googlegroups.com
It seems something is borked between ijulia and ipython in how images are being either sent from the julia side, or understood on the ipython one.  I tried this code:

@pyimport IPython.display as d
d.Image(url="http://127.0.0.1:8998/static/base/images/ipynblogo.png")

which in a native IPython notebook works fine:

Inline image 1
but in the IJulia session produces:

In [13]:

@pyimport IPython.display as d

d.Image(url="http://127.0.0.1:8998/static/base/images/ipynblogo.png")
Out[13]:

PyObject <IPython.core.display.Image object at 0xb0c9b50>


I'm not sure if that helps you guys much, but it seems to indicate that the issue isn't pyplot itself as much as something in ijulia regarding image transport.

Cheers,

f
image.png

Steven G. Johnson

unread,
Sep 25, 2013, 11:07:30 PM9/25/13
to juli...@googlegroups.com


On Wednesday, September 25, 2013 10:47:31 PM UTC-4, Fernando Perez wrote:
It seems something is borked between ijulia and ipython in how images are being either sent from the julia side, or understood on the ipython one.  I tried this code:

Hi Fernando, PyCall currently does not automatically call the `_repr_png_` etcetera display methods of Python objects (http://nbviewer.ipython.org/url/github.com/ipython/ipython/raw/master/examples/notebooks/Custom%20Display%20Logic.ipynb), so Python objects imported via PyCall will not automatically display graphically in IJulia.

Jeff Bezanson

unread,
Sep 25, 2013, 11:13:39 PM9/25/13
to juli...@googlegroups.com
I'm on the same commit.

I had seen this problem before this commit:

commit 0dd8c565b848400734eb829aa7ce90d273417225
Author: Steven G. Johnson <ste...@mit.edu>
Date: Mon Sep 16 16:33:16 2013 -0400

always monkeypatch, even if no gui backend is available (thanks @loladiro)


There I believe it was caused by display getting turned off if no
local gui library was found.

Steven G. Johnson

unread,
Sep 25, 2013, 11:26:38 PM9/25/13
to juli...@googlegroups.com

Jeff Bezanson

unread,
Sep 25, 2013, 11:30:16 PM9/25/13
to juli...@googlegroups.com
There must be some other problem with Fernando's setup though, since
imshow() works fine for me.

On Wed, Sep 25, 2013 at 11:26 PM, Steven G. Johnson
<steve...@gmail.com> wrote:
> See https://github.com/stevengj/PyCall.jl/issues/43

Fernando Perez

unread,
Sep 25, 2013, 11:30:03 PM9/25/13
to juli...@googlegroups.com
Ah, OK. That makes sense.

Then the origin of the problem remains a mystery, esp. given Jeff is on the same commit as I am.

I'll demo plotting via the %julia magics in IPython, where that works fine, and we can sort out what's going on with ijulia later.

It would be good to know if I'm the only one seeing the problem, or if anyone else can replicate it.

Cheers,

Fernando Perez

unread,
Sep 25, 2013, 11:33:26 PM9/25/13
to juli...@googlegroups.com
On Wed, Sep 25, 2013 at 8:30 PM, Jeff Bezanson <jeff.b...@gmail.com> wrote:
There must be some other problem with Fernando's setup though, since
imshow() works fine for me.

Very odd.  I wondered if it could be my matplotlib version (I was using git master), so I downgraded to 1.2.1 (the offiical one from ubuntu 13.04), and still getting the same.

Mmm... 

Fernando Perez

unread,
Sep 25, 2013, 11:36:15 PM9/25/13
to juli...@googlegroups.com
Ah, no, scratch that! I ran the wrong test...

OK, having downgraded matplotlib did the trick!

Great, I can now finish my talk :)

We can investigate later what the issue with mpl git master is...

Cheers,

f

Fernando Perez

unread,
Sep 25, 2013, 11:42:05 PM9/25/13
to juli...@googlegroups.com
OK, I can confirm after re-running a more careful test: mpl 1.2.1 works OK, but git master of matplotlib does NOT.

Here's the notebook to run a quick test:


When using 1.2.1, it showed the plots for me just fine.

At least now we know where the issue is coming from, and we can try to track it down before mpl 1.4 is released.

Thanks for all the help!

f

Jeff Bezanson

unread,
Sep 25, 2013, 11:46:55 PM9/25/13
to juli...@googlegroups.com
Very glad to hear it!
Reply all
Reply to author
Forward
0 new messages