-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Generating ElectronPlot/ saving plots from Jupyter Notebook #88
Comments
Hi @piever I'm sorry it has been giving you issues. Ideally this is what should be happening when you call
All of these steps are executing, but for some reason somewhere along the pipeline things get stuck. At not point it was working correctly, but one of the involved technologies must have made a change that is causing the issues we are seeing. I did try this, however, and it worked for me from within the notebook: _p = ElectronPlot(p)
display(_p)
savefig(_p, "my_file.pdf")
close(_p) Note that this will bring up an electron window for a few seconds while the file data was extracted from electron. I believe there are other packages in development right now that should make this processes much smoother. |
I see, thanks for looking into this. I was trying something similar, and at least on my machine if
is the last line of code in the block, the program would freeze, whereas
works. I was actually seeing something similar when trying it from Juno. I'm not sure I understand what it is, is it some sort of "REPL-like" behaviour of the notebook? Your solution works on my machine as well (except if I try to do it repeatedly with plots with a different number of traces, for some reason). |
That's very strange. I believe this is an issue in Blink.jl or one of its dependencies. I'm pretty sure these issues will get attention soon -- so I think we'll just have to hang in there for now. (sorry, not a great answer -- but I don't have the extra time right now to implement a proper fix) |
On current latest tagged with _p = ElectronPlot(p)
display(_p)
savefig(_p, "Yield vs config.svg")
close(_p) I'm getting
Has the recommended method of doing this changed? |
Hmm that is strange. The recommended way for saving a plot to a file is still the same. I recently merged a fairly large set of changes. It is possible that this will work again on the current master branch. If you want to try it out now you can do Otherwise I will try to find time to put together a new release soon. |
I needed to manually build after checking out the latest master, but now I'm seeing something different -- running the code snippet above spawns an Electron window but then the process stalls out with Julia + two Electron processes taking up a full core. I actually saw this on the PlotlyJS latest tagged after I checked out the ImageMagick master and updating everything (which got rid of the error above). |
Hmm, that is very strange. I can't reproduce that locally. Sorry I'm not more help with that right now. I'm in the middle of preparing a release based on the latest master (with a few more updates/fixes). I'll post here when that happens and kindly ask you to please try again. |
Sounds good, thanks! |
Ok the new version has been tagged. Can you try Pkg.free("PlollyJS")
Pkg.upate()
Pkg.build("PlotlyJS") And then your test script. Thank you -- fingers crossed that it works! |
I'm seeing the same thing on the latest tagged. I am using ImageMagick master due to some requirements issues if that makes any difference. The script stalls out at the There's a small chance this is related to some corporate proxy issue with the communication between the electron window and Julia but I don't think so -- Blink.jl seems to be working OK. I'll check at home this evening just to be sure. |
Closing due to inactivity. Please re-open if this is still an issue we can help with |
Just FYI, things like using PlotlyJS
function bar1()
data = bar(;x=["giraffes", "orangutans", "monkeys"],
y=[20, 14, 23])
plot(data)
end
p = bar1()
savefig(p, "Test.svg") now work without any issues on latest tagged from a Juypter notebook! |
Excellent! Thanks for the report. |
First of all, thanks for this amazing package. I'm using it mainly from Jupyter Notebook: it works very well but I'm having trouble saving the plots with savefig in any format except html. This works:
whereas any other format to save the file, i. e.
tries opening an electron plot and then crashes. The issues seems to be opening the electronplot, as I get the same behavior if I try:
So I wanted to ask: is there any way of creating ElectronPlot from jupyter and if there isn't, what is the recommended way of getting the svg/ pdf version of the plot?
The text was updated successfully, but these errors were encountered: