Hi Shashi, thank you very much for your help.

What is slider_val in your code snippet? I actually have multiple sliders
and other widgets that I want to play with before plotting. Is there any
version of @manipulate where I can pass all sorts of widgets at once?

@manipulate slider, checkbox, togglebuttons, ... withfig() do
 ... plot commands ...
end

-Júlio

2015-08-02 11:51 GMT-07:00 Shashi Gowda <shashigowd...@gmail.com>:

> Hi,
>
> Easiest way to do this is with @manipulate and `withfig` as you have
> discovered.
>
> I'm inclined to remove @lift from reactive since it's hard to implement
> correctly and has caused frustrating problems. (also it's not eval-free)
>
> I recommend you use the lift function instead.
>
> s = slider(1:10)
> display(s)
> lift(x -> greyim(eye(x)), s)
>
> Should do the trick for you.
>
> With PyPlot, this will be:
>
> f = figure()
> lift(s) do slider_val
>    withfig(f) # This basically says "do the drawing on the same plot f."
>    .... plot something with slider_val...
> end
>
>
>
>
>
>
> On Mon, Aug 3, 2015 at 12:06 AM, Júlio Hoffimann <
> julio.hoffim...@gmail.com> wrote:
>
>> Hi,
>>
>> Suppose I have:
>>
>> s = slider(1:10)
>> img = @lift eye(s)
>>
>> How can I create the interactive plot in Jupyter using @lift?
>>
>> @lift imshow(img)
>>
>> I know @manipulate has the withfig() option where we can pass the PyPlot
>> Figure object, what about @lift?
>>
>> -Júlio
>>
>
>

Reply via email to