How to offset a line relative to another

Hi - I have two (or more) lines that have very similar y-values - for visual purposes I want to shift one by a little bit. (and I don’t want to change the data - in other words, I don’t want to add y_shift to each point in the 2nd line).

Here is how I would do it in matplotlib

http://matplotlib.org/users/transforms_tutorial.html

Another way to think about this is two lines plotted on two different axes, overlaid on the same figure, but each one occupies a slightly different physical part of the figure.

In plotly, this is:

  • domain (list)
    default: [0, 1]
    Sets the domain of this axis (in plot fraction).
    Each dict has one or more of the keys listed below.

Thanks!
Sridhar

The next release should have a CustomJSTransform that would make this simple to do:

  CustomJSTransform · Issue #5015 · bokeh/bokeh · GitHub

In the mean time, you'd have to write your own Transform type as a custom extension:

  http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html

Thanks,

Bryan

···

On Feb 13, 2017, at 11:35, Sridhar Anandakrishnan <[email protected]> wrote:

Hi - I have two (or more) lines that have very similar y-values - for visual purposes I want to shift one by a little bit. (and I don't want to change the data - in other words, I don't want to add y_shift to each point in the 2nd line).

Here is how I would do it in matplotlib
http://matplotlib.org/users/transforms_tutorial.html

Another way to think about this is two lines plotted on two different axes, overlaid on the same figure, but each one occupies a slightly different physical part of the figure.
In plotly, this is:
Single-page reference in Python
  • domain (list)
default: [0, 1]
Sets the domain of this axis (in plot fraction).
Each dict has one or more of the keys listed below.

Thanks!
Sridhar

--
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/2cb51a0b-a1a5-4e7d-a33f-4ddff8b22e37%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Thanks, looking forward to the next release…
Sincerely,

Sridhar

···

On Monday, February 13, 2017 at 5:52:49 PM UTC-5, Bryan Van de ven wrote:

The next release should have a CustomJSTransform that would make this simple to do:

    [https://github.com/bokeh/bokeh/issues/5015](https://github.com/bokeh/bokeh/issues/5015)

In the mean time, you’d have to write your own Transform type as a custom extension:

    [http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html](http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html)

Thanks,

Bryan

On Feb 13, 2017, at 11:35, Sridhar Anandakrishnan [email protected] wrote:

Hi - I have two (or more) lines that have very similar y-values - for visual purposes I want to shift one by a little bit. (and I don’t want to change the data - in other words, I don’t want to add y_shift to each point in the 2nd line).

Here is how I would do it in matplotlib

http://matplotlib.org/users/transforms_tutorial.html

Another way to think about this is two lines plotted on two different axes, overlaid on the same figure, but each one occupies a slightly different physical part of the figure.

In plotly, this is:

https://plot.ly/python/reference/#layout-yaxis

    • domain (list)

default: [0, 1]
Sets the domain of this axis (in plot fraction).
Each dict has one or more of the keys listed below.

Thanks!

Sridhar


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/2cb51a0b-a1a5-4e7d-a33f-4ddff8b22e37%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.