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

Interact support #78

Closed
Evizero opened this issue Nov 20, 2015 · 14 comments
Closed

Interact support #78

Evizero opened this issue Nov 20, 2015 · 14 comments

Comments

@Evizero
Copy link
Member

Evizero commented Nov 20, 2015

When using @manipulate the plot doesn't change after the first time it's drawn

I managed to get @manipulate running as expected by directly returning plt.o. This however only works for a gadfly backend AFAIK

@Evizero
Copy link
Member Author

Evizero commented Nov 21, 2015

I am trying to figure out how I could fix this, but I am a little out of my league here. I can't quite pin down what makes Gadfly work with interact that's missing for Plots. Do you have any intuition what the missing piece could be?

@tbreloff
Copy link
Member

I haven't worked with interact... I only have a high level understanding of how it works. I'll dig into it when I have a chance.

On Nov 21, 2015, at 8:21 AM, Christof Stocker [email protected] wrote:

I am trying to figure out how I could fix this, but I am a little out of my league here. I can't quite pin down what makes Gadfly work with interact that's missing for Plots. Do you have any intuition what the missing piece could be?


Reply to this email directly or view it on GitHub.

@tbreloff
Copy link
Member

Looking at this now... it seems like display(plot(...)) should be called on a slider change. This is the "gui mode" call in Plots. I'll try to pin down what does/doesn't work in Plots and fix it all.

@tbreloff
Copy link
Member

I can't even get it to work with Gadfly. This may take longer than I want.

@Evizero
Copy link
Member Author

Evizero commented Nov 21, 2015

My current workaround is by returning plt.o directly. That only works for gadfly.
In the case of having multiple plots I use

Compose.set_default_graphic_size(22cm, 10cm) # have to set this explicitly
Gadfly.hstack(p1.o, p2.o)

@dlfivefifty
Copy link
Contributor

👍🏽 Using

@manipulate for k=1:10
     plot(...).o 
end

works for me

@tbreloff
Copy link
Member

I clearly have something weird with my setup. I tried running this from a fresh IJulia notebook:

using Plots, Interact; gadfly()
@manipulate for k=1:10
    plot(rand(100,k)).o 
end

Based on your posts, I would expect that to work, but the cell just hangs, never finishing or outputting anything.

For Gadfly, a better hack (until we figure out why it doesn't work directly) for subplots would look like:

using Plots, Interact; gadfly()
@manipulate for k=1:10
    getGadflyContext(subplot(rand(100,k))) 
end

This is untested of course because @manipulate just hangs for me.

@dlfivefifty
Copy link
Contributor

Bizarre, your first example works for me. I’m on “master” for Interact, and jupyter 4.0.6.

On 29 Nov 2015, at 12:09 PM, Tom Breloff [email protected] wrote:

I clearly have something weird with my setup. I tried running this from a fresh IJulia notebook:

using Plots, Interact; gadfly()
@manipulate for k=1:10
plot(rand(100,k)).o
end
Based on your posts, I would expect that to work, but the cell just hangs, never finishing or outputting anything.

For Gadfly, a better hack (until we figure out why it doesn't work directly) for subplots would look like:

using Plots, Interact; gadfly()
@manipulate for k=1:10
getGadflyContext(subplot(rand(100,k)))
end
This is untested of course because @manipulate just hangs for me.


Reply to this email directly or view it on GitHub #78 (comment).

@dlfivefifty
Copy link
Contributor

This issue also affects Juno compatibility:

using Plots;gadfly()
plot(1:10,1:10)

puts the plot in the Console, so you need

plot(1:10,1:10).o

to plot inline.

@diegozea
Copy link
Contributor

Plots (using Gadfly as backend) doesn't work with Interact. The plots don't respond to the slider, and two instead of one plot is generated:

image

@dlfivefifty
Copy link
Contributor

Try using

plt.o

In place of the last plt

Sent from my iPhone

On 27 Apr 2016, at 06:18, Diego Javier Zea [email protected] wrote:

Plots (using Gadfly as backend) doesn't work with Interact. The plots don't respond to the slider, and two instead of one plot is generated:


You are receiving this because you commented.
Reply to this email directly or view it on GitHub

@diegozea
Copy link
Contributor

Thanks @dlfivefifty ! It works using .o

@tbreloff
Copy link
Member

I was just looking at this, and Interact seems to work with all backends except plotlyjs (which seems to break the notebook?). Closing this, and I'll add an item to the plotly meta-issue. cc: @spencerlyon2

@sglyon
Copy link
Member

sglyon commented Jun 17, 2016

I believe that things should work quite well with PlotlyJS.

@tbreloff can you confirm? If it is still an issue please tell me about it.

t-bltg pushed a commit that referenced this issue Oct 6, 2022
don't stringify argument to `warn_on_recipe_aliases!` early
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

5 participants