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

Fail to plot with PyPlot on Ubuntu 14.04 #92

Closed
alphilmac opened this issue Sep 25, 2014 · 1 comment
Closed

Fail to plot with PyPlot on Ubuntu 14.04 #92

alphilmac opened this issue Sep 25, 2014 · 1 comment

Comments

@alphilmac
Copy link

The sequence is as follows:

julia> Pkg.add("PyPlot")
INFO: Cloning cache of PyPlot from git://github.com/stevengj/PyPlot.jl.git
INFO: Installing PyPlot v1.3.1
INFO: REQUIRE updated.

julia> using PyPlot
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 14: reading configurations from ~/.fonts.conf is deprecated. please move it to /home/athmig/.config/fontconfig/fonts.conf manually
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 14: reading configurations from ~/.fonts.conf is deprecated. please move it to /home/athmig/.config/fontconfig/fonts.conf manually
Loading help data...
Warning: using PyPlot.plot in module Main conflicts with an existing identifier.

julia> x = linspace(0,2_pi,1000); y = sin(3_x + 4_cos(2_x));

julia> plot(x, y, color="red", linewidth=2.0, linestyle="--")
Evaluation succeeded, but an error occurred while showing value of type FramedPlot:
ERROR: unknown line type --
in set_line_type at /home/athmig/.julia/v0.2/Cairo/src/Cairo.jl:688
in set at /home/athmig/.julia/v0.2/Winston/src/renderer.jl:95
in push_style at /home/athmig/.julia/v0.2/Winston/src/paint.jl:19
in paint at /home/athmig/.julia/v0.2/Winston/src/paint.jl:59
in render at /home/athmig/.julia/v0.2/Winston/src/Winston.jl:2499
in render at /home/athmig/.julia/v0.2/Winston/src/Winston.jl:963
in compose_interior at /home/athmig/.julia/v0.2/Winston/src/Winston.jl:1219
in compose at /home/athmig/.julia/v0.2/Winston/src/Winston.jl:1755
in page_compose at /home/athmig/.julia/v0.2/Winston/src/Winston.jl:1770
in page_compose at /home/athmig/.julia/v0.2/Winston/src/Winston.jl:1758
in anonymous at /home/athmig/.julia/v0.2/Winston/src/tk.jl:27
in draw at /home/athmig/.julia/v0.2/Tk/src/tkwidget.jl:251
in display at /home/athmig/.julia/v0.2/Winston/src/tk.jl:35
in display at /home/athmig/.julia/v0.2/Winston/src/Winston.jl:2710
in display at multimedia.jl:151

julia> title("A sinusoidally modulated sinusoid")
PyObject <matplotlib.text.Text object at 0x7f93c82fba90>

julia> /usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:250: Warning: Source ID 3 was not found when attempting to remove it
gobject.source_remove(self._idle_event_id)

The window does open with the right legend/title but there is no plot in it, only axes.

@stevengj
Copy link
Member

It sounds like you have some other plotting module, e.g. Gadfly, imported, and the error is because the plot functions conflict.

If you need to use both at once, use import PyPlot rather than using, and then use the fully qualified names PyPlot.plot(...) etcetera. (You can shorten this by setting const plt = PyPlot).

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

2 participants