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

Gadfly does not plot? #125

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

Gadfly does not plot? #125

hbauschke opened this issue Nov 21, 2013 · 15 comments

Comments

@hbauschke
Copy link

Hello,

the following seems to give only trouble and unfortunately not plot:

julia> using Gadfly
Warning: Possible conflict in library symbol dtrtri_
Warning: Possible conflict in library symbol dgetri_
Warning: Possible conflict in library symbol dgetrf_

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.

julia> plot([sin,cos],0,30)
Plot(...)

Cheers,
Heinz

[aviks: format code block]

@staticfloat
Copy link
Contributor

Note that you need to explicitly call draw() in order to write out to a file.

@dcjones I think perhaps it might be good to explicitly state in the manual when Gadfly actually pops something up on screen (Only in IJulia I believe?) and when it only writes out to a file (only with explicit calls to draw()?)

@wlbksy
Copy link

wlbksy commented Nov 23, 2013

a weird thing about runing the same code on Win64 is that, the file generated by draw is locked by julia.
Maybe it's the same thing as JuliaLang/julia#4664

@dcjones
Copy link
Collaborator

dcjones commented Nov 27, 2013

@staticfloat Yeah, I should make that more clear. Really it should show the plot somehow when plot is called, I've just gotten so used using ijulia that I haven't bothered.

@wlbksy I made a change recently that may explain that. Is that causing problems?

@wlbksy
Copy link

wlbksy commented Nov 27, 2013

I was expecting the generated figure is available right after call draw . A locked figure can not be open by ImageViewer .

@dcjones
Copy link
Collaborator

dcjones commented Nov 28, 2013

@wlbksy It should be fixed now. I didn't realize windows always locked open files.

@vks
Copy link

vks commented Mar 25, 2014

Just calling plot() does not give any visualization at all. Calling draw() works.

Is this intended? If it is, the documentation does not say anything about it. Having the pictures right after the plot commands suggests that calling plot() would give an interactive window, like in most other plotting packages.

@dcjones
Copy link
Collaborator

dcjones commented Mar 25, 2014

It's probably something that should be added. At one point the behavior was to write a plot to a temporary file and try to open it in a web browser. That was a little clumsy, but it might be preferable to doing nothing. The alternative would be to use Gtk or Tk, which I'm not crazy about either because I want Gadfly to work without depending on external libraries.

Also, plot by itself does show the plot inline in IJulia, which is often a nicer way of doing exploratory data analysis.

@dchudz
Copy link
Contributor

dchudz commented Mar 25, 2014

+1 to "write a plot to a temporary file and try to open it in a web browser"

@vks
Copy link

vks commented Mar 25, 2014

Either way, I think the behavior should be documented in the tutorial. (I.e. "In order to actually see the plots, use draw().")

@dcjones
Copy link
Collaborator

dcjones commented Mar 27, 2014

Now calling plot from the regular REPL will actually display the plot by writing it to a temporary file and opening it.

This respects options set by set_default_plot_size and set_default_plot_format. The default plot format is html, which should open in a new browser tab. Change it to, e.g., png and the plot will open in whatever program png files are associated with, etc.

@dcjones
Copy link
Collaborator

dcjones commented Mar 27, 2014

P.S. I haven't tested this on windows, though it should work. Let me know if it doesn't.

@tkelman
Copy link
Contributor

tkelman commented Apr 17, 2014

@dcjones doesn't look like it. Have you had a chance to address loladiro's comment here? 7a65b77#commitcomment-5922916

@dcjones
Copy link
Collaborator

dcjones commented Apr 18, 2014

I forgot about that. It should work once again now.

@tkelman
Copy link
Contributor

tkelman commented Apr 18, 2014

Thanks, but still didn't seem to work?

julia> Pkg.checkout("Gadfly")
INFO: Checking out Gadfly master...
INFO: Pulling Gadfly latest master...
INFO: No packages to install, update or remove

julia> using Gadfly
Warning: ignoring conflicting import of StatsBase.range into DataFrames

julia> plot(x=collect(1:10), y=sort(rand(10)))
Plot(...)

And nothing opens.

PNG backend works to generate a file, but is more verbose.

@dpo
Copy link

dpo commented Apr 26, 2014

Doesn't work here either. I call set_default_plot_format(:svg). Until recently, the browser would open with the plot, but no more.

EDIT:

p = plot(...)
display(p)

works.

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

8 participants