Coloring the area in an area figure

Hi to all,

is there a possiblity to costumize the color within an area figure?

Given the following code

def drawColorFig():

    output_file("area.html") #Safe file
    start = dt.datetime(year=2017, month=1, day = 1)#Start date
    dates = pd.date_range(sz.startDate, periods = 120, freq = 'M')#Periods on the x-axis
    #Data for y-axis
    newDicht = dict()
    newDicht["Starter"] = range(1,120)
    newDicht["Observer"] = range(3,123)
  
    data1 = newDicht["Starter"]
    data2 = newDicht["Observer"]

    dataset1 = pd.Series(data1, index = dates)
    dataset2 = pd.Series(data2, index = dates)

    data = dict(data1=dataset1, data2=dataset2, data3 = dataset3, data4 = dataset4)

    tool = 'hover, save, wheel_zoom, reset, box_zoom, pan'
    x = Area(data=data, stack=True, tools = tool)
    show(x)

``

I want to have dataset1 for example in yellow color and dataset 2 in blue color?

Cheers

Markus

Hi,

Yes, Area accepts a palette keyword argument that can be used to provide a list of colors:

  area2 = Area(data, title="Stacked Area Chart", legend="top_left",
               stack=True, xlabel='time', ylabel='memory',
               palette=['orange', 'grey', 'blue'])

Thanks,

Bryan

···

On Mar 7, 2017, at 06:51, 'Mar kus' via Bokeh Discussion - Public <[email protected]> wrote:

Hi to all,

is there a possiblity to costumize the color within an area figure?

Given the following code

def drawColorFig():

        output_file("area.html") #Safe file
        start = dt.datetime(year=2017, month=1, day = 1)#Start date
        dates = pd.date_range(sz.startDate, periods = 120, freq = 'M')#Periods on the x-axis
        #Data for y-axis
        newDicht = dict()
        newDicht["Starter"] = range(1,120)
        newDicht["Observer"] = range(3,123)
      
        data1 = newDicht["Starter"]
        data2 = newDicht["Observer"]

        dataset1 = pd.Series(data1, index = dates)
        dataset2 = pd.Series(data2, index = dates)

        data = dict(data1=dataset1, data2=dataset2, data3 = dataset3, data4 = dataset4)

        tool = 'hover, save, wheel_zoom, reset, box_zoom, pan'
        x = Area(data=data, stack=True, tools = tool)
        show(x)

I want to have dataset1 for example in yellow color and dataset 2 in blue color?

Cheers
Markus

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/9c0cec36-c207-4c84-a471-9325098d917b%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.