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

Use nbagg backend in IJulia #137

Open
dpsanders opened this issue Jun 13, 2015 · 4 comments
Open

Use nbagg backend in IJulia #137

dpsanders opened this issue Jun 13, 2015 · 4 comments

Comments

@dpsanders
Copy link

Starting with version 1.4.3 (I believe) of matplotlib, there is an nbagg backend which allows interactive manipulation of figures. EDIT: In IPython, this is available using %matplotlib notebook

Would it be possible to make this available? (At least, I have not worked out how to use it from IJulia.)

@stevengj
Copy link
Member

stevengj commented Jul 7, 2015

Depends on JuliaPy/PyCall.jl#89

@Gregstrq
Copy link

@stevengj,
I've looked through the code for nbagg backend.
The only thing communicating to kernel is CommSocket class object, which is subtype of ipython's Comm class.

It seems that the similar functionality for the IJulia kernel is realised with Comm type and its methods.
The solution I can think of is to create via PyCall NewComm class, which will store reference to IJulia Comm type and transmit python methods to Julia functions, defined for Comm type.
Then somehow make the figure manager instantiate this NewComm class instead of CommSocket in this line.

What do you think about it?
Is it possible to use PyCall to define Python Class which references Julia structures and uses Julia functions?

Also, I am not really sure how can one modify the behaviour of @pyimported PyClass (which is needed to correct figure manager method).
If I were to modify some method of Class, I would think about doing PyClass[:some_method] = new_julia_func. Is it possible? Does it have something to do with monkey-patching you mention in JuliaPy/PyCall.jl#89?

@stevengj
Copy link
Member

Is it possible to use PyCall to define Python Class which references Julia structures and uses Julia functions?

Yes.

If I were to modify some method of Class, I would think about doing PyClass[:some_method] = new_julia_func. Is it possible?

I think so. Or rather, I think you have to modify the instance and not the class. This is monkey patching.

@marius311
Copy link

Is there any hope of someone reviving this? The widget stuff in mpl just keeps getting cooler (https://twitter.com/martinRenou/status/1440617060640247815) and I'd love to be able to use it from Julia.

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

4 participants