possible to add source on plot.text or Text?

country = Text(x=5, y=50, text='name', text_color="#000000")
    plot.add_glyph(source, country)

``

Hi guys,

is it possible to add source on plot.text or Text? as the code shown above? it does not work . thanks for any suggestions.

Hi,

Yes, Text takes a source just like any other glyph, so those two lines are correct. It's not possible to diagnose what the usage problems without more code.

Thanks,

Bryan

···

On Jun 14, 2018, at 12:23, peng wang <[email protected]> wrote:

country = Text(x=5, y=50, text='name', text_color="#000000")
    plot.add_glyph(source, country)

Hi guys,

is it possible to add source on plot.text or Text? as the code shown above? it does not work . thanks for any suggestions.

--
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/02608a50-2b88-41f2-a8b6-7d57bf112d13%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

thanks a lot , this is my snippet code. something looks wrong here.

subplot_source = ColumnDataSource(data=subplot_dict)

subplot = figure(x_range = [0, 50], y_range = [0, 30], plot_width=100, plot_height=50, toolbar_location=None, sizing_mode=‘scale_width’)

subplot_height = 50

subplot_weight = 100

subplot.rect(x=‘subplot_x’, y=‘subplot_y’, width=subplot_weight, height=subplot_height, color=“B2SColors”,

width_units=“screen”, height_units=“screen”, source=subplot_source)

offBottom_text = Text(x=5.5, y=25, text_font_size=‘8pt’, text=“Offbottom-Active”)

subplot.add_glyph(subplot_source, offBottom_text)

``

···

On Thursday, June 14, 2018 at 1:25:23 PM UTC-6, Bryan Van de ven wrote:

Hi,

Yes, Text takes a source just like any other glyph, so those two lines are correct. It’s not possible to diagnose what the usage problems without more code.

Thanks,

Bryan

On Jun 14, 2018, at 12:23, peng wang [email protected] wrote:

country = Text(x=5, y=50, text=‘name’, text_color=“#000000”)

plot.add_glyph(source, country)

Hi guys,

is it possible to add source on plot.text or Text? as the code shown above? it does not work . thanks for any suggestions.


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/02608a50-2b88-41f2-a8b6-7d57bf112d13%40continuum.io.

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

Hi,

That's still not really enough to say anything. I am afraid the best I can do right now is to point you at a complete working example, which will hopefully lead the way:

  https://github.com/bokeh/bokeh/blob/master/examples/reference/models/Text.py

Thanks,

Bryan

···

On Jun 14, 2018, at 12:29, peng wang <[email protected]> wrote:

thanks a lot , this is my snippet code. something looks wrong here.

subplot_source = ColumnDataSource(data=subplot_dict)
    subplot = figure(x_range = [0, 50], y_range = [0, 30], plot_width=100, plot_height=50, toolbar_location=None, sizing_mode='scale_width')
    subplot_height = 50
    subplot_weight = 100

    subplot.rect(x='subplot_x', y='subplot_y', width=subplot_weight, height=subplot_height, color="B2SColors",
          width_units="screen", height_units="screen", source=subplot_source)
    offBottom_text = Text(x=5.5, y=25, text_font_size='8pt', text="Offbottom-Active")
    subplot.add_glyph(subplot_source, offBottom_text)

On Thursday, June 14, 2018 at 1:25:23 PM UTC-6, Bryan Van de ven wrote:
Hi,

Yes, Text takes a source just like any other glyph, so those two lines are correct. It's not possible to diagnose what the usage problems without more code.

Thanks,

Bryan

> On Jun 14, 2018, at 12:23, peng wang <[email protected]> wrote:
>
> country = Text(x=5, y=50, text='name', text_color="#000000")
> plot.add_glyph(source, country)
>
> Hi guys,
>
> is it possible to add source on plot.text or Text? as the code shown above? it does not work . thanks for any suggestions.
>
>
> --
> 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/02608a50-2b88-41f2-a8b6-7d57bf112d13%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/af5dc43a-0e09-4b9e-b884-64a688b5b8e2%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

I notice plot was used , but I use figure. any difference?

···

On Thursday, June 14, 2018 at 1:25:23 PM UTC-6, Bryan Van de ven wrote:

Hi,

Yes, Text takes a source just like any other glyph, so those two lines are correct. It’s not possible to diagnose what the usage problems without more code.

Thanks,

Bryan

On Jun 14, 2018, at 12:23, peng wang [email protected] wrote:

country = Text(x=5, y=50, text=‘name’, text_color=“#000000”)

plot.add_glyph(source, country)

Hi guys,

is it possible to add source on plot.text or Text? as the code shown above? it does not work . thanks for any suggestions.


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/02608a50-2b88-41f2-a8b6-7d57bf112d13%40continuum.io.

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

Hi,

figure is just a helper function to create a Plot and also default ranges and axes, etc. automatically.

Bryan

···

On Jun 14, 2018, at 12:31, peng wang <[email protected]> wrote:

I notice plot was used , but I use figure. any difference?

On Thursday, June 14, 2018 at 1:25:23 PM UTC-6, Bryan Van de ven wrote:
Hi,

Yes, Text takes a source just like any other glyph, so those two lines are correct. It's not possible to diagnose what the usage problems without more code.

Thanks,

Bryan

> On Jun 14, 2018, at 12:23, peng wang <[email protected]> wrote:
>
> country = Text(x=5, y=50, text='name', text_color="#000000")
> plot.add_glyph(source, country)
>
> Hi guys,
>
> is it possible to add source on plot.text or Text? as the code shown above? it does not work . thanks for any suggestions.
>
>
> --
> 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/02608a50-2b88-41f2-a8b6-7d57bf112d13%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/6a5e50bb-3c8d-4adf-8604-84f96c55d792%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.