plot size and aspect ratio

Hello,

I am using bokeh (0.4.2) from within IPython Notebook. I am very happy with the “Resize” tool as it is very convenient. However, I do not know how to achieve two interrelated things. I would like to:

  • change the default size of a plot (so as to make use of the full width of the IPython Notebook by default) and
  • ensure that the coordinate system still has an aspect ratio of 1:1 (i.e. a perfect square in the coordinate system also appears as a square on screen).

I have so far managed to set the aspect ratio to 1:1 at the beginning by doing

plot = curplot()
plot.y_range = plot.x_range.clone()

but I suspect there is a better way to do that. Also, this aspect ratio is destroyed when using the “Resize” tool. It would be great to fix the aspect ratio but simply change the size of the “viewport” when using the Resize tool.

Any hints would be very much appreciated.

Thanks,
Felix

Felix,

Easily handling and controlling the aspect is a feature that needs to be added to Bokeh. It's not there right now, but the good news is that it will not be much work to add. I've created a ticket to cover this you can follow, leave comments to, etc:

  Easily control aspect ratio · Issue #474 · bokeh/bokeh · GitHub

Bryan

···

On Mar 28, 2014, at 4:20 PM, Felix Breuer <[email protected]> wrote:

Hello,

I am using bokeh (0.4.2) from within IPython Notebook. I am very happy with the "Resize" tool as it is very convenient. However, I do not know how to achieve two interrelated things. I would like to:

* change the default size of a plot (so as to make use of the full width of the IPython Notebook by default) and
* ensure that the coordinate system still has an aspect ratio of 1:1 (i.e. a perfect square in the coordinate system also appears as a square on screen).

I have so far managed to set the aspect ratio to 1:1 at the beginning by doing

    plot = curplot()
    plot.y_range = plot.x_range.clone()

but I suspect there is a better way to do that. Also, this aspect ratio is destroyed when using the "Resize" tool. It would be great to fix the aspect ratio but simply change the size of the "viewport" when using the Resize tool.

Any hints would be very much appreciated.

Thanks,
Felix

--
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/e8d7409b-617f-4e51-b42e-85fc9c5e2e58%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.