bokeh - ValueError: Keyword argument sequencesMoving a stacked bar that that worked in Bokeh 0.9 to Bokeh 0.11Bokeh: Automatically refreshing bokeh plotsBokeh tooltips' arguments for Bar chartbrowsing image sequence with a slider in bokehBokeh 100% Stacked Bar ChartCreate stacked bar chart using bokeh in pythonBokeh- datetime x_range: 'ValueError, Unrecognized range input'Bokeh 12.0.15- stacked grouped barsBokeh Horizontal Stacked Bar ChartBokeh stack chart legend incorrect

Cutting numbers into a specific decimals

Template factorial function without template specialization

Why does AM radio react to IR remote?

Journal published a paper, ignoring my objections as a referee

Did ancient peoples ever hide their treasure behind puzzles?

Printing a list as "a, b, c." using Python

Why does Sauron not permit his followers to use his name?

Why doesn't Starship have four landing legs?

The meaning of asynchronous vs synchronous

Why does this London Underground poster from 1924 have a Star of David atop a Christmas tree?

What is Soda Fountain Etiquette?

Heat output from a 200W electric radiator?

In Endgame, wouldn't Stark have remembered Hulk busting out of the stairwell?

What ways are there to "PEEK" memory sections in (different) BASIC(s)

STM32 cannot reach individual registers and pins as PIC

Another "Ask One Question" Question

Alternatives to Network Backup

Is this password scheme legit?

What should be done with the carbon when using magic to get oxygen from carbon dioxide?

Is this position a forced win for Black after move 14?

Why nature prefers simultaneous events?

Can a network vulnerability be exploited locally?

How do you say "half the time …, the other half …" in German?

Why did the population of Bhutan drop by 70% between 2007 and 2008?



bokeh - ValueError: Keyword argument sequences


Moving a stacked bar that that worked in Bokeh 0.9 to Bokeh 0.11Bokeh: Automatically refreshing bokeh plotsBokeh tooltips' arguments for Bar chartbrowsing image sequence with a slider in bokehBokeh 100% Stacked Bar ChartCreate stacked bar chart using bokeh in pythonBokeh- datetime x_range: 'ValueError, Unrecognized range input'Bokeh 12.0.15- stacked grouped barsBokeh Horizontal Stacked Bar ChartBokeh stack chart legend incorrect






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Below is two sets of code. The first set of code works and gives the desired outcome. However, when i try to extend the size of the dataframe, as in the second set of code, with an additional column i get an error message.



The error message I get is below.



raise ValueError("Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: %r" % sorted(list(lengths)))

ValueError: Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: [3, 4]

raise ValueError("Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: %r" % sorted(list(lengths)))

ValueError: Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: [3, 4]


Code 1 which works



import pandas as pd
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure, show
from bokeh.palettes import Spectral3

df = pd.DataFrame('Category': ['<£5000', '£100K to £250K'],
'01/01/2014': [8,1],
'01/01/2015': [8,2],
'01/01/2016': [7,1])


grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016'].mean().round(0)

source = ColumnDataSource(grouped)
countries = source.data['Category'].tolist()
p = figure(x_range=countries)

p.vbar_stack(stackers=['01/01/2014', '01/01/2015', '01/01/2016'],
x='Category', source=source,
legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 '],
width=0.5, color=Spectral3)


p.title.text ='Average Number of Trades by Portfolio Size'
p.legend.location = 'top_right'

p.xaxis.axis_label = 'Portfolio Size'
p.xgrid.grid_line_color = None #remove the x grid lines

p.yaxis.axis_label = 'Average Number of Trades'

show(p)


Code 2 which does not work. Additional date added in.



import pandas as pd
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure, show
from bokeh.palettes import Spectral3

df = pd.DataFrame('Category': ['<£5000', '£100K to £250K'],
'01/01/2014': [8,1],
'01/01/2015': [8,2],
'01/01/2016': [7,1],
'01/01/2017': [9,4])


grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'].mean().round(0)

source = ColumnDataSource(grouped)
countries = source.data['Category'].tolist()
p = figure(x_range=countries)

p.vbar_stack(stackers=['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'],
x='Category', source=source,
legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 ', '01/01/2017 '],
width=0.5, color=Spectral3)


p.title.text ='Average Number of Trades by Portfolio Size'
p.legend.location = 'top_right'

p.xaxis.axis_label = 'Portfolio Size'
p.xgrid.grid_line_color = None #remove the x grid lines

p.yaxis.axis_label = 'Average Number of Trades'

show(p)









share|improve this question






























    0















    Below is two sets of code. The first set of code works and gives the desired outcome. However, when i try to extend the size of the dataframe, as in the second set of code, with an additional column i get an error message.



    The error message I get is below.



    raise ValueError("Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: %r" % sorted(list(lengths)))

    ValueError: Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: [3, 4]

    raise ValueError("Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: %r" % sorted(list(lengths)))

    ValueError: Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: [3, 4]


    Code 1 which works



    import pandas as pd
    from bokeh.models import ColumnDataSource
    from bokeh.plotting import figure, show
    from bokeh.palettes import Spectral3

    df = pd.DataFrame('Category': ['<£5000', '£100K to £250K'],
    '01/01/2014': [8,1],
    '01/01/2015': [8,2],
    '01/01/2016': [7,1])


    grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016'].mean().round(0)

    source = ColumnDataSource(grouped)
    countries = source.data['Category'].tolist()
    p = figure(x_range=countries)

    p.vbar_stack(stackers=['01/01/2014', '01/01/2015', '01/01/2016'],
    x='Category', source=source,
    legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 '],
    width=0.5, color=Spectral3)


    p.title.text ='Average Number of Trades by Portfolio Size'
    p.legend.location = 'top_right'

    p.xaxis.axis_label = 'Portfolio Size'
    p.xgrid.grid_line_color = None #remove the x grid lines

    p.yaxis.axis_label = 'Average Number of Trades'

    show(p)


    Code 2 which does not work. Additional date added in.



    import pandas as pd
    from bokeh.models import ColumnDataSource
    from bokeh.plotting import figure, show
    from bokeh.palettes import Spectral3

    df = pd.DataFrame('Category': ['<£5000', '£100K to £250K'],
    '01/01/2014': [8,1],
    '01/01/2015': [8,2],
    '01/01/2016': [7,1],
    '01/01/2017': [9,4])


    grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'].mean().round(0)

    source = ColumnDataSource(grouped)
    countries = source.data['Category'].tolist()
    p = figure(x_range=countries)

    p.vbar_stack(stackers=['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'],
    x='Category', source=source,
    legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 ', '01/01/2017 '],
    width=0.5, color=Spectral3)


    p.title.text ='Average Number of Trades by Portfolio Size'
    p.legend.location = 'top_right'

    p.xaxis.axis_label = 'Portfolio Size'
    p.xgrid.grid_line_color = None #remove the x grid lines

    p.yaxis.axis_label = 'Average Number of Trades'

    show(p)









    share|improve this question


























      0












      0








      0








      Below is two sets of code. The first set of code works and gives the desired outcome. However, when i try to extend the size of the dataframe, as in the second set of code, with an additional column i get an error message.



      The error message I get is below.



      raise ValueError("Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: %r" % sorted(list(lengths)))

      ValueError: Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: [3, 4]

      raise ValueError("Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: %r" % sorted(list(lengths)))

      ValueError: Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: [3, 4]


      Code 1 which works



      import pandas as pd
      from bokeh.models import ColumnDataSource
      from bokeh.plotting import figure, show
      from bokeh.palettes import Spectral3

      df = pd.DataFrame('Category': ['<£5000', '£100K to £250K'],
      '01/01/2014': [8,1],
      '01/01/2015': [8,2],
      '01/01/2016': [7,1])


      grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016'].mean().round(0)

      source = ColumnDataSource(grouped)
      countries = source.data['Category'].tolist()
      p = figure(x_range=countries)

      p.vbar_stack(stackers=['01/01/2014', '01/01/2015', '01/01/2016'],
      x='Category', source=source,
      legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 '],
      width=0.5, color=Spectral3)


      p.title.text ='Average Number of Trades by Portfolio Size'
      p.legend.location = 'top_right'

      p.xaxis.axis_label = 'Portfolio Size'
      p.xgrid.grid_line_color = None #remove the x grid lines

      p.yaxis.axis_label = 'Average Number of Trades'

      show(p)


      Code 2 which does not work. Additional date added in.



      import pandas as pd
      from bokeh.models import ColumnDataSource
      from bokeh.plotting import figure, show
      from bokeh.palettes import Spectral3

      df = pd.DataFrame('Category': ['<£5000', '£100K to £250K'],
      '01/01/2014': [8,1],
      '01/01/2015': [8,2],
      '01/01/2016': [7,1],
      '01/01/2017': [9,4])


      grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'].mean().round(0)

      source = ColumnDataSource(grouped)
      countries = source.data['Category'].tolist()
      p = figure(x_range=countries)

      p.vbar_stack(stackers=['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'],
      x='Category', source=source,
      legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 ', '01/01/2017 '],
      width=0.5, color=Spectral3)


      p.title.text ='Average Number of Trades by Portfolio Size'
      p.legend.location = 'top_right'

      p.xaxis.axis_label = 'Portfolio Size'
      p.xgrid.grid_line_color = None #remove the x grid lines

      p.yaxis.axis_label = 'Average Number of Trades'

      show(p)









      share|improve this question














      Below is two sets of code. The first set of code works and gives the desired outcome. However, when i try to extend the size of the dataframe, as in the second set of code, with an additional column i get an error message.



      The error message I get is below.



      raise ValueError("Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: %r" % sorted(list(lengths)))

      ValueError: Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: [3, 4]

      raise ValueError("Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: %r" % sorted(list(lengths)))

      ValueError: Keyword argument sequences for broadcasting must all be the same lengths. Got lengths: [3, 4]


      Code 1 which works



      import pandas as pd
      from bokeh.models import ColumnDataSource
      from bokeh.plotting import figure, show
      from bokeh.palettes import Spectral3

      df = pd.DataFrame('Category': ['<£5000', '£100K to £250K'],
      '01/01/2014': [8,1],
      '01/01/2015': [8,2],
      '01/01/2016': [7,1])


      grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016'].mean().round(0)

      source = ColumnDataSource(grouped)
      countries = source.data['Category'].tolist()
      p = figure(x_range=countries)

      p.vbar_stack(stackers=['01/01/2014', '01/01/2015', '01/01/2016'],
      x='Category', source=source,
      legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 '],
      width=0.5, color=Spectral3)


      p.title.text ='Average Number of Trades by Portfolio Size'
      p.legend.location = 'top_right'

      p.xaxis.axis_label = 'Portfolio Size'
      p.xgrid.grid_line_color = None #remove the x grid lines

      p.yaxis.axis_label = 'Average Number of Trades'

      show(p)


      Code 2 which does not work. Additional date added in.



      import pandas as pd
      from bokeh.models import ColumnDataSource
      from bokeh.plotting import figure, show
      from bokeh.palettes import Spectral3

      df = pd.DataFrame('Category': ['<£5000', '£100K to £250K'],
      '01/01/2014': [8,1],
      '01/01/2015': [8,2],
      '01/01/2016': [7,1],
      '01/01/2017': [9,4])


      grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'].mean().round(0)

      source = ColumnDataSource(grouped)
      countries = source.data['Category'].tolist()
      p = figure(x_range=countries)

      p.vbar_stack(stackers=['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'],
      x='Category', source=source,
      legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 ', '01/01/2017 '],
      width=0.5, color=Spectral3)


      p.title.text ='Average Number of Trades by Portfolio Size'
      p.legend.location = 'top_right'

      p.xaxis.axis_label = 'Portfolio Size'
      p.xgrid.grid_line_color = None #remove the x grid lines

      p.yaxis.axis_label = 'Average Number of Trades'

      show(p)






      pandas bokeh stacked-chart






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 at 21:15









      ben121ben121

      3761 silver badge13 bronze badges




      3761 silver badge13 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          1















          The problem is that you increased the number of column in your dataframe but the color set Spectral3 has still only 3 colors.
          The following code uses Spectral[11] so it is good for up to 11 dataframe columns. For more column / colors you would need to switch to other palette offering more colors (code tested for Bokeh v1.0.4)



          import pandas as pd
          from bokeh.models import ColumnDataSource
          from bokeh.plotting import figure, show
          from bokeh.palettes import Spectral

          df = pd.DataFrame( 'Category': ['<5000 EUR', '100K EUR to 250K EUR'],
          '01/01/2014': [8, 1],
          '01/01/2015': [8, 2],
          '01/01/2016': [7, 1],
          '01/01/2017': [9, 4] )

          nmb_columns = (len(df.columns) - 1)
          grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'].mean().round(0)

          source = ColumnDataSource(grouped)
          countries = source.data['Category'].tolist()
          p = figure(x_range = countries)

          p.vbar_stack(stackers = ['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'],
          x = 'Category', source = source,
          legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 ', '01/01/2017 '],
          width = 0.5, color = Spectral[11][:nmb_columns])

          p.title.text = 'Average Number of Trades by Portfolio Size'
          p.legend.location = 'top_left'
          p.legend.click_policy = 'hide'

          p.xaxis.axis_label = 'Portfolio Size'
          p.xgrid.grid_line_color = None # remove the x grid lines

          p.yaxis.axis_label = 'Average Number of Trades'

          show(p)


          Result:



          enter image description here






          share|improve this answer

























          • Brilliant thank you.

            – ben121
            Mar 28 at 6:57










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55386575%2fbokeh-valueerror-keyword-argument-sequences%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1















          The problem is that you increased the number of column in your dataframe but the color set Spectral3 has still only 3 colors.
          The following code uses Spectral[11] so it is good for up to 11 dataframe columns. For more column / colors you would need to switch to other palette offering more colors (code tested for Bokeh v1.0.4)



          import pandas as pd
          from bokeh.models import ColumnDataSource
          from bokeh.plotting import figure, show
          from bokeh.palettes import Spectral

          df = pd.DataFrame( 'Category': ['<5000 EUR', '100K EUR to 250K EUR'],
          '01/01/2014': [8, 1],
          '01/01/2015': [8, 2],
          '01/01/2016': [7, 1],
          '01/01/2017': [9, 4] )

          nmb_columns = (len(df.columns) - 1)
          grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'].mean().round(0)

          source = ColumnDataSource(grouped)
          countries = source.data['Category'].tolist()
          p = figure(x_range = countries)

          p.vbar_stack(stackers = ['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'],
          x = 'Category', source = source,
          legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 ', '01/01/2017 '],
          width = 0.5, color = Spectral[11][:nmb_columns])

          p.title.text = 'Average Number of Trades by Portfolio Size'
          p.legend.location = 'top_left'
          p.legend.click_policy = 'hide'

          p.xaxis.axis_label = 'Portfolio Size'
          p.xgrid.grid_line_color = None # remove the x grid lines

          p.yaxis.axis_label = 'Average Number of Trades'

          show(p)


          Result:



          enter image description here






          share|improve this answer

























          • Brilliant thank you.

            – ben121
            Mar 28 at 6:57















          1















          The problem is that you increased the number of column in your dataframe but the color set Spectral3 has still only 3 colors.
          The following code uses Spectral[11] so it is good for up to 11 dataframe columns. For more column / colors you would need to switch to other palette offering more colors (code tested for Bokeh v1.0.4)



          import pandas as pd
          from bokeh.models import ColumnDataSource
          from bokeh.plotting import figure, show
          from bokeh.palettes import Spectral

          df = pd.DataFrame( 'Category': ['<5000 EUR', '100K EUR to 250K EUR'],
          '01/01/2014': [8, 1],
          '01/01/2015': [8, 2],
          '01/01/2016': [7, 1],
          '01/01/2017': [9, 4] )

          nmb_columns = (len(df.columns) - 1)
          grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'].mean().round(0)

          source = ColumnDataSource(grouped)
          countries = source.data['Category'].tolist()
          p = figure(x_range = countries)

          p.vbar_stack(stackers = ['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'],
          x = 'Category', source = source,
          legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 ', '01/01/2017 '],
          width = 0.5, color = Spectral[11][:nmb_columns])

          p.title.text = 'Average Number of Trades by Portfolio Size'
          p.legend.location = 'top_left'
          p.legend.click_policy = 'hide'

          p.xaxis.axis_label = 'Portfolio Size'
          p.xgrid.grid_line_color = None # remove the x grid lines

          p.yaxis.axis_label = 'Average Number of Trades'

          show(p)


          Result:



          enter image description here






          share|improve this answer

























          • Brilliant thank you.

            – ben121
            Mar 28 at 6:57













          1














          1










          1









          The problem is that you increased the number of column in your dataframe but the color set Spectral3 has still only 3 colors.
          The following code uses Spectral[11] so it is good for up to 11 dataframe columns. For more column / colors you would need to switch to other palette offering more colors (code tested for Bokeh v1.0.4)



          import pandas as pd
          from bokeh.models import ColumnDataSource
          from bokeh.plotting import figure, show
          from bokeh.palettes import Spectral

          df = pd.DataFrame( 'Category': ['<5000 EUR', '100K EUR to 250K EUR'],
          '01/01/2014': [8, 1],
          '01/01/2015': [8, 2],
          '01/01/2016': [7, 1],
          '01/01/2017': [9, 4] )

          nmb_columns = (len(df.columns) - 1)
          grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'].mean().round(0)

          source = ColumnDataSource(grouped)
          countries = source.data['Category'].tolist()
          p = figure(x_range = countries)

          p.vbar_stack(stackers = ['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'],
          x = 'Category', source = source,
          legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 ', '01/01/2017 '],
          width = 0.5, color = Spectral[11][:nmb_columns])

          p.title.text = 'Average Number of Trades by Portfolio Size'
          p.legend.location = 'top_left'
          p.legend.click_policy = 'hide'

          p.xaxis.axis_label = 'Portfolio Size'
          p.xgrid.grid_line_color = None # remove the x grid lines

          p.yaxis.axis_label = 'Average Number of Trades'

          show(p)


          Result:



          enter image description here






          share|improve this answer













          The problem is that you increased the number of column in your dataframe but the color set Spectral3 has still only 3 colors.
          The following code uses Spectral[11] so it is good for up to 11 dataframe columns. For more column / colors you would need to switch to other palette offering more colors (code tested for Bokeh v1.0.4)



          import pandas as pd
          from bokeh.models import ColumnDataSource
          from bokeh.plotting import figure, show
          from bokeh.palettes import Spectral

          df = pd.DataFrame( 'Category': ['<5000 EUR', '100K EUR to 250K EUR'],
          '01/01/2014': [8, 1],
          '01/01/2015': [8, 2],
          '01/01/2016': [7, 1],
          '01/01/2017': [9, 4] )

          nmb_columns = (len(df.columns) - 1)
          grouped = df.groupby('Category')['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'].mean().round(0)

          source = ColumnDataSource(grouped)
          countries = source.data['Category'].tolist()
          p = figure(x_range = countries)

          p.vbar_stack(stackers = ['01/01/2014', '01/01/2015', '01/01/2016', '01/01/2017'],
          x = 'Category', source = source,
          legend = ['01/01/2014 ', '01/01/2015 ', '01/01/2016 ', '01/01/2017 '],
          width = 0.5, color = Spectral[11][:nmb_columns])

          p.title.text = 'Average Number of Trades by Portfolio Size'
          p.legend.location = 'top_left'
          p.legend.click_policy = 'hide'

          p.xaxis.axis_label = 'Portfolio Size'
          p.xgrid.grid_line_color = None # remove the x grid lines

          p.yaxis.axis_label = 'Average Number of Trades'

          show(p)


          Result:



          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 27 at 22:18









          TonyTony

          2,9791 gold badge5 silver badges23 bronze badges




          2,9791 gold badge5 silver badges23 bronze badges















          • Brilliant thank you.

            – ben121
            Mar 28 at 6:57

















          • Brilliant thank you.

            – ben121
            Mar 28 at 6:57
















          Brilliant thank you.

          – ben121
          Mar 28 at 6:57





          Brilliant thank you.

          – ben121
          Mar 28 at 6:57








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55386575%2fbokeh-valueerror-keyword-argument-sequences%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript