☰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

Does rect accept source?

Community Support
Josh_Wasserstein
Josh_Wasserstein

When I try to update bar plots (using rect) in an app with Bokeh, I get error the following error, why?

bar_data = Instance(ColumnDataSource)

figure = figure(title_text_font_size=“12pt”,

						  plot_height=300,

							plot_width=300,

							tools=toolset,

							title='I/O throughput',

							logo=None)

figure.rect(‘x’, ‘y’, source=obj.bar_data, width=0.5, height=value, color = “#ff1200”)

and then, in an update_data(self) callback:

def update_data(self):

…

self.bar_data.data = dict(x=‘foo’, y=6)

…

I get:

plots[‘bar’].rect(‘x’, ‘y’, source=obj.bar_data, width=0.5, height=value, color = “#ff1200”)

NameError: name ‘value’ is not defined

ERROR:tornado.access:500 GET /bokeh/flight_match_rate/ (127.0.0.1) 122.41ms

Josh

⌁   Link to post
Josh_Wasserstein
Josh_Wasserstein

Sorry – That was really silly. I found the problem (value was of course not defined)

Thanks!

···

On Thu, Feb 26, 2015 at 5:50 PM, Josh Wasserstein ribonucleico@gmail.com wrote:

When I try to update bar plots (using rect) in an app with Bokeh, I get error the following error, why?

bar_data = Instance(ColumnDataSource)

figure = figure(title_text_font_size=“12pt”,

  					  plot_height=300,
  						plot_width=300,
  						tools=toolset,
  						title='I/O throughput',
  						logo=None)

figure.rect(‘x’, ‘y’, source=obj.bar_data, width=0.5, height=value, color = “#ff1200”)

and then, in an update_data(self) callback:

def update_data(self):

…

self.bar_data.data = dict(x=‘foo’, y=6)

…

I get:

plots[‘bar’].rect(‘x’, ‘y’, source=obj.bar_data, width=0.5, height=value, color = “#ff1200”)

NameError: name ‘value’ is not defined

ERROR:tornado.access:500 GET /bokeh/flight_match_rate/ (127.0.0.1) 122.41ms

Josh

⌁   Link to post
Josh_Wasserstein
Josh_Wasserstein

Actually, guess I don’t know how to use data sources with rect plots. Can I use source? (rect seems to be designed to take width and height)

Josh

···

On Thu, Feb 26, 2015 at 5:51 PM, Josh Wasserstein ribonucleico@gmail.com wrote:

Sorry – That was really silly. I found the problem (value was of course not defined)

Thanks!

On Thu, Feb 26, 2015 at 5:50 PM, Josh Wasserstein ribonucleico@gmail.com wrote:

When I try to update bar plots (using rect) in an app with Bokeh, I get error the following error, why?

bar_data = Instance(ColumnDataSource)

figure = figure(title_text_font_size=“12pt”,

  					  plot_height=300,
  						plot_width=300,
  						tools=toolset,
  						title='I/O throughput',
  						logo=None)

figure.rect(‘x’, ‘y’, source=obj.bar_data, width=0.5, height=value, color = “#ff1200”)

and then, in an update_data(self) callback:

def update_data(self):

…

self.bar_data.data = dict(x=‘foo’, y=6)

…

I get:

plots[‘bar’].rect(‘x’, ‘y’, source=obj.bar_data, width=0.5, height=value, color = “#ff1200”)

NameError: name ‘value’ is not defined

ERROR:tornado.access:500 GET /bokeh/flight_match_rate/ (127.0.0.1) 122.41ms

Josh

⌁   Link to post
Josh_Wasserstein
Josh_Wasserstein

Nevermind. Sorry for the repeated emails. I figured this out.

Josh

···

On Thu, Feb 26, 2015 at 5:52 PM, Josh Wasserstein ribonucleico@gmail.com wrote:

Josh

Actually, guess I don’t know how to use data sources with rect plots. Can I use source? (rect seems to be designed to take width and height)

On Thu, Feb 26, 2015 at 5:51 PM, Josh Wasserstein ribonucleico@gmail.com wrote:

Sorry – That was really silly. I found the problem (value was of course not defined)

Thanks!

On Thu, Feb 26, 2015 at 5:50 PM, Josh Wasserstein ribonucleico@gmail.com wrote:

When I try to update bar plots (using rect) in an app with Bokeh, I get error the following error, why?

bar_data = Instance(ColumnDataSource)

figure = figure(title_text_font_size=“12pt”,

  					  plot_height=300,
  						plot_width=300,
  						tools=toolset,
  						title='I/O throughput',
  						logo=None)

figure.rect(‘x’, ‘y’, source=obj.bar_data, width=0.5, height=value, color = “#ff1200”)

and then, in an update_data(self) callback:

def update_data(self):

…

self.bar_data.data = dict(x=‘foo’, y=6)

…

I get:

plots[‘bar’].rect(‘x’, ‘y’, source=obj.bar_data, width=0.5, height=value, color = “#ff1200”)

NameError: name ‘value’ is not defined

ERROR:tornado.access:500 GET /bokeh/flight_match_rate/ (127.0.0.1) 122.41ms

Josh

⌁   Link to post

End of archived discussion · Replies are disabled