Line graph with filled area for values above y=0

I am trying to visualize a line chart, wishing to highlight all values above a certain axis (say, y=0) by creating a filled hatch (patch?) between the positive values and the y=0 axis.

How can I achieve this?

I see this example, however it is built on explicit x steps which is not our case.

import numpy as np

df = pd.DataFrame(np.random.randn(24, 1), columns=list(‘N’))

df_src = ColumnDataSource()

df_src.data = ColumnDataSource.from_df(df)

f = figure (title = 'Pathches above y=0 axis ',

plot_width=750, plot_height=350,

x_axis_label = ‘Index’,

y_axis_label = ‘N’)

f.line(x=‘index’, y=‘N’, source=df_src, line_width=2)

show(f)

``

Hi,

You should probably wait until next week for the next release (or try out a "dev build" if you are in a hurry) since this was closed in the current cycle:

  https://github.com/bokeh/bokeh/issues/8848

Thanks,

Bryan

···

On May 16, 2019, at 4:37 AM, [email protected] wrote:

I am trying to visualize a line chart, wishing to highlight all values above a certain axis (say, y=0) by creating a filled hatch (patch?) between the positive values and the y=0 axis.

How can I achieve this?

I see this example, however it is built on explicit x steps which is not our case.

import numpy as np
df = pd.DataFrame(np.random.randn(24, 1), columns=list('N'))

df_src = ColumnDataSource()
df_src.data = ColumnDataSource.from_df(df)
f = figure (title = 'Pathches above y=0 axis ',
                                plot_width=750, plot_height=350,
                                x_axis_label = 'Index',
                                y_axis_label = 'N')
        
f.line(x='index', y='N', source=df_src, line_width=2)
show(f)

--
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/5d1fb033-a18a-422a-aa39-3ba16e5779e1%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.