This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' A grouped bar chart using a cleaned up version of the `Auto MPG dataset`_. | |
This examples demonstrates automatic handing of Pandas GroupBy objects and | |
colormapping nested factors with ``factor_cmap``. A hover tooltip displays | |
information for each bar. | |
.. bokeh-example-metadata:: | |
:sampledata: autompg | |
:apis: bokeh.plotting.figure.vbar, bokeh.transform.factor_cmap | |
:refs: :ref:`ug_basic_bars_pandas` | |
:keywords: bars, categorical, colormap, groupby, pandas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries'] | |
years = ['2015', '2016', '2017'] | |
data = {'fruits' : fruits, | |
'2015' : [2, 1, 4, 3, 2, 4], | |
'2016' : [5, 3, 3, 2, 4, 6], | |
'2017' : [3, 2, 4, 4, 5, 3]} | |
# Define group colors for each fruit | |
fruit_colors = Turbo[6] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bokeh.models import ColumnDataSource, FactorRange | |
from bokeh.palettes import Turbo | |
from bokeh.plotting import figure, show | |
fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries'] | |
years = ['2015', '2016', '2017'] | |
data = {'fruits' : fruits, | |
'2015' : [2, 1, 4, 3, 2, 4], | |
'2016' : [5, 3, 3, 2, 4, 6], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' A grouped bar chart using a cleaned up version of the `Auto MPG dataset`_. | |
This examples demonstrates automatic handing of Pandas GroupBy objects and | |
colormapping nested factors with ``factor_cmap``. A hover tooltip displays | |
information for each bar. | |
.. bokeh-example-metadata:: | |
:sampledata: autompg | |
:apis: bokeh.plotting.figure.vbar, bokeh.transform.factor_cmap | |
:refs: :ref:`ug_basic_bars_pandas` | |
:keywords: bars, categorical, colormap, groupby, pandas |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, this is too big to display.
Sorry, this is too big to display.