Use text for tick labels

Is there any way to modify the text of the tick labels? For example, when I have data that all belongs to one group of A, B or C, I’d like to label the ticks A B and C. The only current workaround I can figure out now is to convert the ABC to 1, 2, and 3 and display 1,2 and 3 on the axis

I attempted something like this trying to replicate a bar chart for animated data. I wasn’t able to update the tick labels, so I ended up doing the following which might help. Hope it helps!

    plot = figure(toolbar_location=None,
                  plot_width=800,
                  plot_height=400,
                  x_range=(0, 3),
                  y_range=(0, 10),
                  title='mytitle',
                  min_border=10,
                  min_border_left=50,
                  title_text_font_size='12pt')
    plot.quad(bottom=0, left=[0, 1, 2], right=[1, 2, 3],
              top=[0, 0, 0], color="green", name='mytitle')
    plot.text([.5, 2.5], [.5, .5], text=['Yes', 'No'],
               text_font_size="20pt", text_align='center')
    plot.xaxis.visible = None
    plot.xgrid.grid_line_color = None
    datastore = plot.select_one(dict(name=question)).data_source

``

Then later to update the data I would just do the following:
datastore.data[‘top’] = newtoplist
session.store_objects(datastore)

``

I’m still pretty new to Bokeh so this might not be the right way to do what I was trying to do.

···

On Tuesday, December 15, 2015 at 3:37:41 PM UTC-5, jre…@umn.edu wrote:

Is there any way to modify the text of the tick labels? For example, when I have data that all belongs to one group of A, B or C, I’d like to label the ticks A B and C. The only current workaround I can figure out now is to convert the ABC to 1, 2, and 3 and display 1,2 and 3 on the axis

I'm afraid I don't quite understand the question. Do you mean modify (update) after the plot is displayed, or modify from how they get displayed by default? In any case it sounds like you possibly want to use categorical coordinates and axes:

  http://bokeh.pydata.org/en/latest/docs/user_guide/plotting.html#categorical-axes

Bryan

···

On Dec 15, 2015, at 2:37 PM, [email protected] wrote:

Is there any way to modify the text of the tick labels? For example, when I have data that all belongs to one group of A, B or C, I'd like to label the ticks A B and C. The only current workaround I can figure out now is to convert the ABC to 1, 2, and 3 and display 1,2 and 3 on the axis

--
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/39918602-e18f-414a-a5ae-5de79c1188d0%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Sorry, I didn’t express myself very clearly.

Categorical axes looks exactly like what I’m looking for, thanks.

···

On Thursday, December 17, 2015 at 9:48:32 AM UTC-6, Bryan Van de ven wrote:

I’m afraid I don’t quite understand the question. Do you mean modify (update) after the plot is displayed, or modify from how they get displayed by default? In any case it sounds like you possibly want to use categorical coordinates and axes:

    [http://bokeh.pydata.org/en/latest/docs/user_guide/plotting.html#categorical-axes](http://bokeh.pydata.org/en/latest/docs/user_guide/plotting.html#categorical-axes)

Bryan

On Dec 15, 2015, at 2:37 PM, jre…@umn.edu wrote:

Is there any way to modify the text of the tick labels? For example, when I have data that all belongs to one group of A, B or C, I’d like to label the ticks A B and C. The only current workaround I can figure out now is to convert the ABC to 1, 2, and 3 and display 1,2 and 3 on the axis


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/39918602-e18f-414a-a5ae-5de79c1188d0%40continuum.io.

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

Glad it's working out!

···

On Dec 19, 2015, at 5:16 PM, [email protected] wrote:

Sorry, I didn't express myself very clearly.

Categorical axes looks exactly like what I'm looking for, thanks.

On Thursday, December 17, 2015 at 9:48:32 AM UTC-6, Bryan Van de ven wrote:
I'm afraid I don't quite understand the question. Do you mean modify (update) after the plot is displayed, or modify from how they get displayed by default? In any case it sounds like you possibly want to use categorical coordinates and axes:

        http://bokeh.pydata.org/en/latest/docs/user_guide/plotting.html#categorical-axes

Bryan

> On Dec 15, 2015, at 2:37 PM, jre...@umn.edu wrote:
>
> Is there any way to modify the text of the tick labels? For example, when I have data that all belongs to one group of A, B or C, I'd like to label the ticks A B and C. The only current workaround I can figure out now is to convert the ABC to 1, 2, and 3 and display 1,2 and 3 on the axis
>
> --
> 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/39918602-e18f-414a-a5ae-5de79c1188d0%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/7a3b1849-afb9-404e-9729-12da9cf34cf2%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.