How to label twin-ed / secondary axis

Hi,

I couldn’t figure out how to label twin-ed (y axis on the right) axis to label or format the text.

Using “extra_y_ranges”, I was able to see the secondary axis, however, I couldn’t figure out how to label the twin axis

Thanks for any help or direction.

When you create the Axis, you can pass it a "axis_label" parameter, or set ".axis_label" as attribute as on the object later. All of the attributes of Axes are described in the reference guide:

  axes — Bokeh 3.3.2 Documentation

Bryan

···

On Dec 7, 2015, at 1:17 AM, [email protected] wrote:

Hi,

I couldn't figure out how to label twin-ed (y axis on the right) axis to label or format the text.

Using "extra_y_ranges", I was able to see the secondary axis, however, I couldn't figure out how to label the twin axis

Thanks for any help or direction.

--
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/615bf876-db94-459e-8b36-9063bbe9bae7%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi Bryan,

I am sorry I am having bit difficulty to follow what you said as I am not really creating an axis (I think :), I am very new to Bokeh.)

Here’s what I am doing:

left = figure(tools=TOOLS, width=1000, height=400, y_range=(-1,np.max(workedAfter)*1.1), title="← Worked After ← | → Status Changed →")
left.line('x', 'workedAfter', source=source, line_width=3, color=(255,0,0), legend='Worked After')
left.circle('x', 'workedAfter', source=source, radius=.2, color=(255,0,0))
left.yaxis.axis_label = 'Worked After'
left.yaxis.axis_label_text_color = (255,0,0)
left.yaxis.major_label_text_color = (255,0,0)

left.extra_y_ranges ={'statusChanged': Range1d(start=-20, end=np.max(statusChanged)*1.1)}
left.line('x', 'statusChanged', source=source, line_width=3, color=(0,255,0), y_range_name='statusChanged', legend="Status Changed")
left.circle('x', 'statusChanged', source=source, radius=.2, color=(0,255,0), y_range_name='statusChanged')
left.add_layout(LinearAxis(y_range_name='statusChanged'), 'right')

Since I don’t have access to an object say left.extra_yaxis, I am not able to set the properties that you suggested. It feels like we need to create an axis, rather than doing with “left.extra_y_ranges”.

Sorry if it’s something very minor and thanks for assisting.

Musa.

···

On Monday, December 7, 2015 at 7:03:15 AM UTC-7, Bryan Van de ven wrote:

When you create the Axis, you can pass it a “axis_label” parameter, or set “.axis_label” as attribute as on the object later. All of the attributes of Axes are described in the reference guide:

    [http://bokeh.pydata.org/en/latest/docs/reference/models/axes.html](http://bokeh.pydata.org/en/latest/docs/reference/models/axes.html)

Bryan

On Dec 7, 2015, at 1:17 AM, [email protected] wrote:

Hi,

I couldn’t figure out how to label twin-ed (y axis on the right) axis to label or format the text.

Using “extra_y_ranges”, I was able to see the secondary axis, however, I couldn’t figure out how to label the twin axis

Thanks for any help or direction.


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/615bf876-db94-459e-8b36-9063bbe9bae7%40continuum.io.

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

Hi Musa,

You are creating the axis when you call:

  LinearAxis(y_range_name='statusChanged')

in the add_layout(...) call in the last line shown.

Bryan

···

On Dec 7, 2015, at 6:59 PM, [email protected] wrote:

Hi Bryan,

I am sorry I am having bit difficulty to follow what you said as I am not really creating an axis (I think :), I am very new to Bokeh.)

Here's what I am doing:
left = figure(tools=TOOLS, width=1000, height=400, y_range=(-1,np.max(workedAfter)*1.1), title="← Worked After ← | → Status Changed →")
left.line('x', 'workedAfter', source=source, line_width=3, color=(255,0,0), legend='Worked After')
left.circle('x', 'workedAfter', source=source, radius=.2, color=(255,0,0))
left.yaxis.axis_label = 'Worked After'
left.yaxis.axis_label_text_color = (255,0,0)
left.yaxis.major_label_text_color = (255,0,0)

left.extra_y_ranges ={'statusChanged': Range1d(start=-20, end=np.max(statusChanged)*1.1)}
left.line('x', 'statusChanged', source=source, line_width=3, color=(0,255,0), y_range_name='statusChanged', legend="Status Changed")
left.circle('x', 'statusChanged', source=source, radius=.2, color=(0,255,0), y_range_name='statusChanged')
left.add_layout(LinearAxis(y_range_name='statusChanged'), 'right')

Since I don't have access to an object say left.extra_yaxis, I am not able to set the properties that you suggested. It feels like we need to create an axis, rather than doing with "left.extra_y_ranges".

Sorry if it's something very minor and thanks for assisting.

Musa.

On Monday, December 7, 2015 at 7:03:15 AM UTC-7, Bryan Van de ven wrote:
When you create the Axis, you can pass it a "axis_label" parameter, or set ".axis_label" as attribute as on the object later. All of the attributes of Axes are described in the reference guide:

        axes — Bokeh 3.3.2 Documentation

Bryan

> On Dec 7, 2015, at 1:17 AM, dro...@gmail.com wrote:
>
> Hi,
>
> I couldn't figure out how to label twin-ed (y axis on the right) axis to label or format the text.
>
> Using "extra_y_ranges", I was able to see the secondary axis, however, I couldn't figure out how to label the twin axis
>
> Thanks for any help or direction.
>
> --
> 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/615bf876-db94-459e-8b36-9063bbe9bae7%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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/abb93d08-add1-44bf-b14e-2bccc809eef1%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

…wanted to say thank you as it perfectly worked out!

···

On Wednesday, December 9, 2015 at 10:11:24 PM UTC-7, Bryan Van de ven wrote:

Hi Musa,

You are creating the axis when you call:

    LinearAxis(y_range_name='statusChanged')

in the add_layout(…) call in the last line shown.

Bryan

On Dec 7, 2015, at 6:59 PM, [email protected] wrote:

Hi Bryan,

I am sorry I am having bit difficulty to follow what you said as I am not really creating an axis (I think :), I am very new to Bokeh.)

Here’s what I am doing:

left = figure(tools=TOOLS, width=1000, height=400, y_range=(-1,np.max(workedAfter)*1.1), title=“← Worked After ← | → Status Changed →”)

left.line(‘x’, ‘workedAfter’, source=source, line_width=3, color=(255,0,0), legend=‘Worked After’)

left.circle(‘x’, ‘workedAfter’, source=source, radius=.2, color=(255,0,0))

left.yaxis.axis_label = ‘Worked After’

left.yaxis.axis_label_text_color = (255,0,0)

left.yaxis.major_label_text_color = (255,0,0)

left.extra_y_ranges ={‘statusChanged’: Range1d(start=-20, end=np.max(statusChanged)*1.1)}

left.line(‘x’, ‘statusChanged’, source=source, line_width=3, color=(0,255,0), y_range_name=‘statusChanged’, legend=“Status Changed”)

left.circle(‘x’, ‘statusChanged’, source=source, radius=.2, color=(0,255,0), y_range_name=‘statusChanged’)

left.add_layout(LinearAxis(y_range_name=‘statusChanged’), ‘right’)

Since I don’t have access to an object say left.extra_yaxis, I am not able to set the properties that you suggested. It feels like we need to create an axis, rather than doing with “left.extra_y_ranges”.

Sorry if it’s something very minor and thanks for assisting.

Musa.

On Monday, December 7, 2015 at 7:03:15 AM UTC-7, Bryan Van de ven wrote:

When you create the Axis, you can pass it a “axis_label” parameter, or set “.axis_label” as attribute as on the object later. All of the attributes of Axes are described in the reference guide:

    [http://bokeh.pydata.org/en/latest/docs/reference/models/axes.html](http://bokeh.pydata.org/en/latest/docs/reference/models/axes.html)

Bryan

On Dec 7, 2015, at 1:17 AM, [email protected] wrote:

Hi,

I couldn’t figure out how to label twin-ed (y axis on the right) axis to label or format the text.

Using “extra_y_ranges”, I was able to see the secondary axis, however, I couldn’t figure out how to label the twin axis

Thanks for any help or direction.


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/615bf876-db94-459e-8b36-9063bbe9bae7%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.


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/abb93d08-add1-44bf-b14e-2bccc809eef1%40continuum.io.

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