☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

How to offset a line relative to another

Community Support
Sridhar_Anandakrishn
Sridhar_Anandakrishn

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

⌁   Link to post
Bryan
Bryan

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 <sanandak2011@gmail.com> 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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
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\.

⌁   Link to post
Sridhar_Anandakrishn
Sridhar_Anandakrishn

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 sanand...@gmail.com 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 bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

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.

⌁   Link to post

End of archived discussion · Replies are disabled