-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
Show plots by default in Juno #437
Comments
#438 (I realized this was a really easy PR right after filing the issue...) |
I can't get behind this. Sorry. The recent comment regarding Atom is that On Monday, August 8, 2016, Christopher Rackauckas notifications@github.com
|
What about changing the behavior just for Atom? |
show=true
the default
+1 for current behavior. |
I take it In which case I think @tbreloff's solution can work fine, and this is what Gadfly will do already for example. I realise plotting is inconvenient right now but that's due to lack of developer focus more than anything; once core features like the debugger are more complete, plotting will become a much bigger focus and I think we can have a really nice story there. |
@KristofferC you don't see it as a problem that the same question gets asked almost every day about why plots aren't showing in Juno? Sure a Juno-specific solution would be fine as well instead of changing the Plots.jl default. But I think there's an issue that the same question keeps showing up. |
I also like it when windows don't pop up all of the sudden. One thing that annoys me about working with jupyter notebook over SSH is that I have to specify |
The plan here is to figure out what is called when the results of a line are "shown" in Juno. Is it: Then when Atom is loaded, I'll connect that call instead to |
Consistent with the REPL experience is actually what I was meaning. I'm just hoping that when people throw plot commands into the Juno console it shows a plot. It's odd behavior right now, and my change would've been a heavy-handed way to fix it. |
Juno uses Media.jl for its display system so the method that's called is |
@MikeInnes Does this look right? Atom.Media.render(::Atom.Inline, plt::Plot) = display(PlotsDisplay(), plt) |
Almost, you just need to return something that Juno can display. Try |
That doesn't seem to work... I think it's trying to show text/plain:
|
I'm not sure what's going on there. That looks like part of the new display changes in 0.5 which I haven't played around with at all. If Gadfly is working on 0.5 now I'll give that a go to see if there's anything I need to iron out. |
It's been throwing that error for awhile, but the plots still show with it (when using Plots.gui()). (On "Juno master") |
That warning is a Plots warning @MikeInnes, but I wouldn't expect it to be called. |
also... is there any way to turn off those "Julia Client - Internal Error" message boxes? I feel like one opens every second on average. |
Are Atom and Media both checked out? The internal error suggests something's gone wrong in your setup. I'll be tagging everything this week so it may be easier to hold out. |
I can't even load Atom after checking them out:
I guess I'll revisit this another time. |
You have to checkout a bunch of packages. Just wait for the tags. |
Ref: d595649 |
I take it Plots.jl still doesn't work in the Atom IDE? |
You mean it still does and it always has? You just have had to use (the writemime warning is just a red harring: it's just a warning and Plots still works in versions that have that. But people posted issues since they saw the warning and no plot, thinking that the warning was some error making the plot not exist. In actuality, the answer has always just been "use the gui() command". It has worked since at least January when Juno was still very much alpha, and now it works on v0.4.6, v0.5-rc, and v0.6. But the fact that people still think it doesn't work because of the necessary "gui()" call is why I opened this issue.) |
Oh thanks. NOTE: this has been edited several times. So I did use the gui() command but it didn't work in Atom's ink console. |
gui() is just a Julia command, so it will work in the Julia console of Atom and the script editor, but not Atom's console (which is a Javascript console). To be clear, but the Julia console I mean the one from Packages -> Julia -> Open Console (they should really bring back the keyboard shortcut...). The following should open a plot (in a separate window): using Plots
plot(rand(4,4))
gui() It doesn't work with the plot pane right now. There was a version awhile ago that did, but I had Tom switch off that default (with an environment variable) but it no longer works. There were a lot of developments in Atom since Tom has taken a look at it, so I would highly suspect that it won't work. However, after the debugger is done (i.e. the v0.5 release, and bug fixes), the Juno team is going to be working on the plot pane again (in conjunction with Tom, as you can see in this thread) and so it will be there, and then likely the environment variable will be flipped so that plotting in the plot pane will be default. |
Thanks a lot for this. And sorry for my confusing writing - and the edits above. |
No problem. This is pretty confusing and information which is hidden/scattered around. To use PlotlyJS in its own window, you have to do the install which is described here, i.e. using Blink
Blink.AtomShell.install() and then PlotlyJS will be able to make its own window. When the plot pane for this exists, that should be unnecessary, but it should still be clear in the backend page that this is required. I'll make a PR for the docs. |
Actually the install process shouldn't be necessary within Juno (which is why it no longer happens by default). Blink is able to reuse Atom's electron in that case rather than downloading a new one. |
@tbreloff The Juno packages got tagged, so it may be a good time to pick this back up. |
This should work well now on Julia 0.5, master branch. I'll close until someone convinces me otherwise |
Works well for me. For completeness of the discussion, note that the behavior for Juno is now documented here: https://juliaplots.github.io/output/ . The plot pane is the default by an environment variable, and at any time one can use |
Hey, I hope this question belongs here. Thank you for possible help. |
It shouldn't be necessary to use the gui() function anymore, it should just work. Are you on Julia 0.5 and the most recent versions of juno and Plots? One of the tricky things for newcomers to Julia is that there are many plotting packages, each with their different interfaces. The first command using Plots
plot(rand(4,4)) should work (it will draw lines rather than points, which may surprise some). |
Thank you very much for your quick reply, for language-julia I am on 0.8.0, julia-client is 0.5.6 and uber-juno on 0.1.1 unknown package Plot
Im sorry but I have no idea what is going on right now. Also with the Gadfly it does not work but maybe I am doing it the wrong way or so. |
The package name is Plots, not Plot. On Wednesday, October 5, 2016, TheFourSymbols notifications@github.com
|
To get Gadfly working, try
|
Thank you so much, it worked with the checkout and now I get something for the plot(y=cumsum(randn(1000)), Geom.line) command. |
You should get Plots working as well, it is a lot more convenient and user-friendly IMHO! 😄 |
I don't know why, but now I tried with using Plots and it worked 👍 yeah, thank you so much for your patience. |
The worst programming bugs are usually caused by one wrong character ;) |
I am getting an error similar to TheFourSymbols. I am on Juno for JuliaPro 0.6.0.1. When I execute the following command in the console: using Plots I get : Any[4] and nothing in the Plot pane. If I add"gui()" to the above commands, I get " Can someone please tell me what I am doing wrong? Here is a screenshot: |
That is something different. You should open a separate issue for that. |
on PyPlot... (look at the value of |
Sorry, I opened another issue for it and it is now closed. I was using "Plots" and "PyPlots" package in the code and that interfered with my "plyplot()" command. |
Too many people ask about how to display the plot in Juno (or think it doesn't work). I agree there is a difference making the plot and displaying the plot. However, this difference will matter to users as they become more familiar with the package.
It makes more sense to start using the package and go "well what if I don't want the plots to display, and just save them?" and have this more advanced user search the documentation, than it is to not display the plot to a new user who just used
plot(...)
. I think display by default better matches the line:Edit
For those who are new to the discussion, the idea is that in Juno, the way to plot is:
The
gui()
command is not necessarily shown in the documentation (at least, it's in a special spot and it's only specifically needed when the script is ran in Juno), and many people have been posting issues saying Plots doesn't work in Juno for this very reason. My suggestion is to remove the need for thegui()
command when using Juno to evaluate a script (i.e. act like the REPL).The text was updated successfully, but these errors were encountered: