Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

bar plot bokeh

from bokeh.models import ColumnDataSource
from bokeh.palettes import Spectral6

fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries']
counts = [5, 3, 4, 2, 4, 6]

source = ColumnDataSource(data=dict(fruits=fruits, counts=counts, color=Spectral6))

p = figure(x_range=fruits, plot_height=250, y_range=(0, 9), title="Fruit Counts")
p.vbar(x='fruits', top='counts', width=0.9, color='color', legend_field="fruits", source=source)

p.xgrid.grid_line_color = None
p.legend.orientation = "horizontal"
p.legend.location = "top_center"

show(p)
Comment

PREVIOUS NEXT
Code Example
Python :: get current domain name django 
Python :: python equals override 
Python :: subset a list python 
Python :: multiple lines input python 
Python :: pandas replace nan with none 
Python :: python tkinter entry hide text 
Python :: get tweet by its id 
Python :: python user input to tuple 
Python :: planets python 
Python :: python list all but first 
Python :: counter in python 
Python :: python get current date and time 
Python :: python imaplib send email 
Python :: for python 
Python :: python unittest 
Python :: target ordinary encodiing) 
Python :: how to raise the exception in __exit__ python 
Python :: pickle load data 
Python :: question command python 
Python :: python terminal game 
Python :: manage.py startapp not working in django 
Python :: all frequency offset in pandas 
Python :: clone keras model 
Python :: django filter queryset by date 
Python :: torch.stack example 
Python :: Get current cursor type and color Tkinter Python 
Python :: xpath start-with python 
Python :: how to put python code on a website 
Python :: create a empty dataframe 
Python :: python area of rectangle 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =