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

IJulia display logic #157

Closed
tbreloff opened this issue Mar 8, 2016 · 11 comments
Closed

IJulia display logic #157

tbreloff opened this issue Mar 8, 2016 · 11 comments

Comments

@tbreloff
Copy link
Member

tbreloff commented Mar 8, 2016

I find it annoying that IJulia seems to call multiple display formats, which is a waste and sometimes does the wrong thing. I'll probably want to override this:

https://github.com/JuliaLang/IJulia.jl/blob/master/src/inline.jl#L31-L40

and I might want to wrap it in a @require IJulia.

@tbreloff
Copy link
Member Author

tbreloff commented Mar 8, 2016

@tbreloff
Copy link
Member Author

tbreloff commented Mar 8, 2016

Fixed by ed1cce8

@tbreloff tbreloff closed this as completed Mar 8, 2016
@tbreloff tbreloff mentioned this issue Mar 8, 2016
4 tasks
@jheinen
Copy link
Member

jheinen commented Mar 8, 2016

Great - now it works as expected.
Will solve the GR.savestate / GR.restorestate problem (caused by exceptions) in GR - probably by sth like GR.rewind() => to unwind the attribute stack.

@diegozea
Copy link
Contributor

Hi! The IJulia notebook breaks with huge plots. Will be great to use "png" or format smaller than html/svg with very heavy plots. Thanks!

@tbreloff
Copy link
Member Author

There are a couple possible options... make the display output a keyword argument during plot creation (easy-ish), or add some conditional logic to change based on data size (tricky to do well). I'm open to suggestions... Hard data and benchmarks would be important to drive implementation choices. Also this will be backend-dependent, so even trickier to get right.

On Apr 26, 2016, at 8:36 PM, Diego Javier Zea notifications@github.com wrote:

Hi! The IJulia notebook breaks with huge plots. Will be great to use "png" or format smaller than html/svg with very heavy plots. Thanks!


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub

@diegozea
Copy link
Contributor

I prefer the keyword argument at the moment, since the conditional logic could be included in the future using a function as its default value.

@jheinen
Copy link
Member

jheinen commented Apr 27, 2016

What about function backend(pkg::AbstractBackend, fmt="png"), overwriting the defaultOutputFormat in output.jl?

@diegozea : Do you have such a huge plot example? I'd like to find out what kind of output breaks IJulia (or the browser). I assume you were using the gr() backend, right?

@tbreloff
Copy link
Member Author

What about function backend(pkg::AbstractBackend, fmt="png"), overwriting the defaultOutputFormat in output.jl?

@jheinen you may not realize this, but the convenience method for switching backends takes optional keyword arguments that will be passed through to the default(; kw...) method. This means that you can do something like:

using Plots
gr(fmt = "png")

and it will apply aliases and set default settings for keyword arguments.

The advantage of making it a "plot keyword" is that you can choose the format on a per-plot basis, if you want.

@diegozea
Copy link
Contributor

diegozea commented Apr 27, 2016

I'm working with matrices of ~ 13000x200. I was mainly using PyPlot and PlotlyJS as backends.

It looks as a PyPlot problem. GR and PlotlyJS show fast the huge heatmap, but the PyPlot heatmap doesn't show up with 5000 or more rows (and uses a lot of RAM trying to do it). Even a PyPlot heatmap for a matrix of 1000x200 matrix takes ~ 1m to show up, and uses 0.4G of RAM to do it.

After the plot of the 13000x200 matrix, the RAM increases 0.1G with GR and 0.3G with PlotlyJS. I remember having troubles with PlotlyJS in some IJulia sessions using a smaller computer (not only with PyPlot). PlotlyJS times are a little misleading, since toc() was executed by Ijulia before the plot appears.

PyPlot

Small matrix

image

Large matrix

Takes forever and Ubuntu swaps...

GR

Awesome performance @jheinen !

Small matrix

image

Large matrix

image

PlotlyJS

Small matrix

image

Large matrix

image

Gadfly

Gadfly doesn't support heatmap yet

@jheinen
Copy link
Member

jheinen commented Apr 27, 2016

@diegozea : Thanks for the info. So, there seems to be no need to fix the problem in GR.

@tbreloff 👍 Goot to know:

using Plots
gr(fmt = "png")

@diegozea
Copy link
Contributor

diegozea commented May 4, 2016

@tbreloff The time and memory issue with pyplot can be solved using png. Since pyplot is fast when the display is omitted and the plot is saved into a png as show it using loadfrom Images.jl inside the IJulia notebook.

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

3 participants