Updating plot_width/plot_height from a Notebook

Hi all,

I’m trying to modify a plot width & height from a Jupyter notebook.

According to the ‘push_notebook’ documentation, and as far as I understand it properly, everything changed since the last call to ‘show’ or ‘push_notebook’ is supposed to be updated by a call to ‘push_notebook’. I consequently, don’t understand why the following doesn’t work:

kwargs = {}

kwargs[‘title’] = “test”

kwargs[‘plot_width’] = 950

kwargs[‘plot_height’] = 250

plt = figure(**kwargs,)

hdl = show(plt, notebook_handle=True)

``

plt.plot_height = 400

plt.plot_width = 400

push_notebook(handle=hdl)

``

The plot area remains the same (i.e. the initial one).

Any idea?

Thanks.

N.

Hi,

My guess is that these two properties in particular are not wired up to be responsive to any changes after initialization. The layout system is quite complicated, and many aspects can only be computed on the BokehJS side of things, necessitating some compromises. And that's just in the single plot case, if you have a plot in a layout and just want to resize one thing it's not necessarily always clear even in principle what the "right" thing to do to adjust the overall layout is. It's possible that something could be done to make the plot sizes dynamically updatable (maybe at least in some specific cases, like "single plot") but that would be new development, so the first step would be a feature request on GitHub.

Thanks,

Bryan

···

On Jan 11, 2017, at 2:49 AM, Nicolas Leclercq <[email protected]> wrote:

Hi all,

I'm trying to modify a plot width & height from a Jupyter notebook.
According to the 'push_notebook' documentation, and as far as I understand it properly, everything changed since the last call to 'show' or 'push_notebook' is supposed to be updated by a call to 'push_notebook'. I consequently, don't understand why the following doesn't work:

kwargs = {}
kwargs['title'] = "test"
kwargs['plot_width'] = 950
kwargs['plot_height'] = 250
plt = figure(**kwargs,)
hdl = show(plt, notebook_handle=True)

plt.plot_height = 400
plt.plot_width = 400
push_notebook(handle=hdl)

The plot area remains the same (i.e. the initial one).
Any idea?
Thanks.
N.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/dc69a3dc-0ef0-4fb9-ae71-8e6676ff627b%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.