Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plotting has several issues #4878

Closed
hbauschke opened this issue Nov 21, 2013 · 19 comments
Closed

plotting has several issues #4878

hbauschke opened this issue Nov 21, 2013 · 19 comments

Comments

@hbauschke
Copy link

Hello, using Version 0.2.0 (2013-11-16 23:44 UTC)
on x86_64-apple-darwin12.5.0
and trying to do the plot examples, I have run into several issues:

1/ Winston - essentially works but there are warnings:
Warning: Possible conflict in library symbol dtrtri_
Warning: Possible conflict in library symbol dgetri_
Warning: Possible conflict in library symbol dgetrf_

2/ Gadfly - does not work see below
julia> using Gadfly
Warning: New definition
|(NAtype,Any) at /Users/bauschke/.julia/DataArrays/src/operators.jl:502
is ambiguous with:
|(Any,SynchronousStepCollection) at /Users/bauschke/.julia/BinDeps/src/BinDeps.jl:286.
To fix, define
|(NAtype,SynchronousStepCollection)
before the new definition.
Warning: New definition
|(Any,NAtype) at /Users/bauschke/.julia/DataArrays/src/operators.jl:502
is ambiguous with:
|(SynchronousStepCollection,Any) at /Users/bauschke/.julia/BinDeps/src/BinDeps.jl:283.
To fix, define
|(SynchronousStepCollection,NAtype)
before the new definition.
Warning: using Gadfly.plot in module Main conflicts with an existing identifier.

julia> draw(SVG("output.svg", 6inch, 3inch), plot([sin, cos], 0, 25))
ERROR: no method Curve(Array{Function,1},Int64,Dict{Any,Any})
in plot at /Users/bauschke/.julia/Winston/src/plot.jl:118
in plot at /Users/bauschke/.julia/Winston/src/plot.jl:142

3/ Gaston works - but there are warnings:
julia> using Gaston
Warning: using Gaston.plot in module Main conflicts with an existing identifier.

julia> Gaston.set_terminal("aqua")
WARNING: contains(collection, item) is deprecated, use in(item, collection) instead
in depwarn at deprecated.jl:29
in contains at reduce.jl:247
in validate_terminal at /Users/bauschke/.julia/Gaston/src/gaston_aux.jl:268
in set_terminal at /Users/bauschke/.julia/Gaston/src/gaston_config.jl:8
"aqua"

4/ Pyplot - crashes immediately with a "Fatal error"(? disappears quickly) after doing
using PyPlot

I am now trying to use homebrew to build julia. Is there any version for the Mac (Mavericks) out there that actually does do the examples?

Cheers,

Heinz.

@JeffBezanson
Copy link
Member

using both Winston and Gadfly probably causes problems since they export many of the same identifiers, and there are conflicts.

@hbauschke
Copy link
Author

Thanks - started fresh, but Gadfly still does not plot.
Another fresh start with julia and PyPlot still bombs.

@staticfloat
Copy link
Member

  1. The warnings when using Winston are harmless, you can ignore them. We have not yet come up with a satisfactory solution for silencing them, but see improve ccall symbol lookup #3342 for where we have discussed possible solutions. In any case, you can safely ignore these warnings; they will not impact your computation at all.
  2. Like @JeffBezanson said, you should only import one plotting framework at a time; otherwise, how will julia know which plot() function to use? (It's worse than just that, but you get the gist of what we're saying)
  3. Again, the warnings can be ignored. We just released 0.2 which deprecated the contains() function in favor of the in() function; sometimes it takes package authors a little bit to fix all those warnings.
  4. What version of python are you using? Do you have matplotlib installed in python? (e.g. have you followed the instructions at https://github.com/stevengj/PyPlot.jl)

Compiling with Homebrew won't solve any of these problems. Your Julia installation is fine, it's the graphics packages you're having troubles with.

@staticfloat
Copy link
Member

Thanks - started fresh, but Gadfly still does not plot.

Are you still getting this error:

ERROR: no method Curve(Array{Function,1},Int64,Dict{Any,Any})
in plot at /Users/bauschke/.julia/Winston/src/plot.jl:118
in plot at /Users/bauschke/.julia/Winston/src/plot.jl:142

Because if so, you've still got Winston loaded into your Julia, which shouldn't happing unless you've typed using Winston. If you're getting a different error, what is the error?

@andreasnoack
Copy link
Member

Regarding PyPlot, are you using anaconda? See #4116. I now use pyqt from Homebrew and PyPlot works fine.

@jverzani
Copy link
Member

This error

ERROR: no method Curve(Array{Function,1},Int64,Dict{Any,Any})
in plot at /Users/bauschke/.julia/Winston/src/plot.jl:118
in plot at /Users/bauschke/.julia/Winston/src/plot.jl:142

is in Winston and should be fixed with PR #108

@staticfloat
Copy link
Member

Note that I think John intends to point to JuliaGraphics/Winston.jl#108, which is pull request 108 from the Winston.jl repository.

@hbauschke
Copy link
Author

Hi staticfloat,

1 and 2 and 3: OK, thanks. I have the anaconda python 2.7.5.
4. matplotlib, see below. I wasn't able to do the install from the webpage:
there is no osx installer, and the source file speaks in the INSTALL of the .osx file that is not there.

no more error for Gadfly, but still no output (nothing happens).
I think I have mat lib plot, I get
python -c 'import matplotlib; print matplotlib.version, matplotlib.file'
1.3.1 /Users/bauschke/anaconda/lib/python2.7/site-packages/matplotlib/init.pyc
I then did the Pkg.add in Julia and it says nothing to be done.
Julia still bombs when trying to >using PyPlot

Hi Andreas:
Yes, I think this comes from anaconda. What did you do for homebrew to make it work, exactly?

I wouldn't mind trying to get a brew setup to work, but I don't know what I should do for that setup.
I am trying now to brew install pyqt, but it barked and now I am somewhere in qt -HEAD

Cheers, and thanks!

Heinz.

@andreasnoack
Copy link
Member

They changed some of the formulas for Qt very recently, so I only got it working after a brew update. I installed qt with the --HEAD flag but for pyqt it was just brew install pyqt.

@staticfloat
Copy link
Member

@hbauschke Outside of IJulia, I do not believe Gadfly displays the plots to the user; they are written to file. When you use the line draw(SVG("output.svg", 6inch, 3inch), plot([sin, cos], 0, 25)), you are telling Gadfly to write out to the file output.svg which is created in the current directory.

Can you be more specific when you say "Julia bombs"? Can you invoke julia from a terminal so we can see what exactly happens after Julia exits? To do this, open up a new Terminal window, navigate to where you have stored the julia .app file, and run the julia executable (Note that I assume you have put it on your Desktop):

$ cd ~/Desktop
$ ./Julia-0.2.0.app/Contents/Resources/julia/bin/julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.2.0 (2013-11-16 23:44 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org release
|__/                   |  x86_64-apple-darwin12.5.0

julia> using PyPlot
WARNING: No working GUI backend found for matplotlib.
Warning: Possible conflict in library symbol dtrtri_
Warning: Possible conflict in library symbol dgetri_
Warning: Possible conflict in library symbol dgetrf_

julia> exit()
$

That's what it prints out on my machine.

@JeffBezanson
Copy link
Member

It doesn't look like there is anything to do for this in the core system; reopen if I'm wrong.

@hbauschke
Copy link
Author

Hi Elliot,

I switched to the homebrew variant, and I don't get an error anymore.
I don't even get the warning you have, but brew put me on
0.3.0-prerelease+100.

Thanks!

 Heinz.

On 11/22/2013, 12:05 AM, Elliot Saba wrote:

@hbauschke https://github.com/hbauschke Outside of IJulia, I do not
believe Gadfly displays the plots to the user; they are written to
file. When you use the line |draw(SVG("output.svg", 6inch, 3inch),
plot([sin, cos], 0, 25))|, you are telling Gadfly to write out to the
file |output.svg| which is created in the current directory.

Can you be more specific when you say "Julia bombs"? Can you invoke
julia from a terminal so we can see what exactly happens after Julia
exits? To do this, open up a new Terminal window, navigate to where
you have stored the julia .app file, and run the julia executable
(Note that I assume you have put it on your Desktop):

|$ cd ~/Desktop
$ ./Julia-0.2.0.app/Contents/Resources/julia/bin/julia
_
_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "help()" to list help topics
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 0.2.0 (2013-11-16 23:44 UTC)
/ |_'|||__'| | Official http://julialang.org release
|__/ | x86_64-apple-darwin12.5.0

julia> using PyPlot
WARNING: No working GUI backend found for matplotlib.
Warning: Possible conflict in library symbol dtrtri_
Warning: Possible conflict in library symbol dgetri_
Warning: Possible conflict in library symbol dgetrf_

julia> exit()
$
|

That's what it prints out on my machine.


Reply to this email directly or view it on GitHub
#4878 (comment).

Heinz Bauschke, Ph.D.

Professor of Mathematics
University of British Columbia
bauschke.ca
[email protected]

@hbauschke
Copy link
Author

Sorry, forgot the actual output

~/Dropbox/Shared/springer(shared)/HeinzFinal> julia
_
_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "help()" to list help topics
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 0.3.0-prerelease+100 (2013-11-22
01:03 UTC)
/ |_'|||__'| | Commit e4f31f9* (0 days old master)
|__/ | x86_64-apple-darwin13.0.0

julia> using PyPlot

julia>

On 11/22/2013, 12:05 AM, Elliot Saba wrote:

@hbauschke https://github.com/hbauschke Outside of IJulia, I do not
believe Gadfly displays the plots to the user; they are written to
file. When you use the line |draw(SVG("output.svg", 6inch, 3inch),
plot([sin, cos], 0, 25))|, you are telling Gadfly to write out to the
file |output.svg| which is created in the current directory.

Can you be more specific when you say "Julia bombs"? Can you invoke
julia from a terminal so we can see what exactly happens after Julia
exits? To do this, open up a new Terminal window, navigate to where
you have stored the julia .app file, and run the julia executable
(Note that I assume you have put it on your Desktop):

|$ cd ~/Desktop
$ ./Julia-0.2.0.app/Contents/Resources/julia/bin/julia
_
_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "help()" to list help topics
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 0.2.0 (2013-11-16 23:44 UTC)
/ |_'|||__'| | Official http://julialang.org release
|__/ | x86_64-apple-darwin12.5.0

julia> using PyPlot
WARNING: No working GUI backend found for matplotlib.
Warning: Possible conflict in library symbol dtrtri_
Warning: Possible conflict in library symbol dgetri_
Warning: Possible conflict in library symbol dgetrf_

julia> exit()
$
|

That's what it prints out on my machine.


Reply to this email directly or view it on GitHub
#4878 (comment).

Heinz Bauschke, Ph.D.

Professor of Mathematics
University of British Columbia
bauschke.ca
[email protected]

@schuberm
Copy link

schuberm commented Dec 3, 2013

What is the workaround? On OSX 10.8 with anaconda, I get


   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.2.0 (2013-11-16 23:44 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org release
|__/                   |  x86_64-apple-darwin12.5.0

julia> using PyPlot
WARNING: No working GUI backend found for matplotlib.
Warning: Possible conflict in library symbol dtrtri_
Warning: Possible conflict in library symbol dgetri_
Warning: Possible conflict in library symbol dgetrf_

@staticfloat
Copy link
Member

@schuberm Those possible conflict warnings are just that; warnings. Don't worry about them.

Can you plot from python? E.g. if you open a python shell, does this pop anything up:

import matplotlib.pyplot as plt
plt.plot([4,2,3,1])

@schuberm
Copy link

schuberm commented Dec 3, 2013

@staticfloat plotting in python does nothing. I guess my anaconda installation is messed up too. Turns out I'm good a breaking things.

@staticfloat
Copy link
Member

Don't worry about it; we've all been there. I'm not familiar enough with Anaconda to tell you how to fix it; but the search terms you should be looking for are "matplotlib backends". There are multiple libraries you can use as a backend to matplotlib, macosx is the native one for OSX that I prefer, although there are many others that work just fine.

If you want to "just plot something already", you could try installing Winston:

Pkg.add("Winston")
using Winston
plot([4,2,3,1])

That should pop something up on your screen, and might be all you need to get going.

@schuberm
Copy link

schuberm commented Dec 4, 2013

@staticfloat Python is fine, we were forgetting the plt.show() part. No change on the Julia side.

@staticfloat
Copy link
Member

Aha, I have interactive plotting enabled in my matplotlib rc file, so I don't need the show(). Good to know that python is working for you. So we definitely have a problem with Julia.

I suggest you open an issue on the PyPlot issue tracker, as you will get the attention of the people who are more familiar with how that code works. They will be able to debug the specific issues you're having a lot better than I will.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants