Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bokeh (Python) Figure.vbar() vs Bar()

Tags:

python

bokeh

I'm just starting to take a look at Bokeh for data visualization and am wondering the advantage/disadvantage to using Figure.vbar() vs Bar() if someone could clarify.

like image 466
FortuneFaded Avatar asked Sep 23 '16 20:09

FortuneFaded


People also ask

How do you plot multiple lines on bokeh?

Bokeh can be used to plot multiple lines on a graph. Plotting multiple lines on a graph can be done using the multi_line() method of the plotting module.

How do you show a bokeh plot?

You can display images on Bokeh plots using the image() , image_rgba() , and image_url() glyph methods. You can use hovering tooltips with image glyphs to let the user see the values of each pixel.

How does bokeh Python work?

Bokeh is a Python library for creating interactive visualizations for modern web browsers. It helps you build beautiful graphics, ranging from simple plots to complex dashboards with streaming datasets. With Bokeh, you can create JavaScript-powered visualizations without writing any JavaScript yourself.


1 Answers

bar is from the high level Charts interface. It gives you quick, easy access to bar charts with limited control.

vbar is from the mid level Plotting interface and gives you more control over the layout of your bar chart. Alternatives to vbar would be rect and quad, both from the Plotting interface. They give a few distinctive options for bar shape, location, etc.

bar is much easier if you don't need to do anything fancy. If you decide you want more control over your plot (like HoverTool etc) you will have to instantiate a Figure and use one of it's methods.


bar docs Here

and

vbar docs Here

I use both, depending on my needs.

like image 87
Ben Love Avatar answered Oct 04 '22 21:10

Ben Love