<jupyter_start><jupyter_text>Showing the before/after as static images below since github does not show bokeh's output:<jupyter_code>Image("./images/before.png")
Image("./images/after.png")
a = [1, 2, 3, 4, 5, 6]
b = [2, 5, 9, 1, 2, 4]
p = figure(plot_height = 300, plot_width = 500, title=' , Volume')

p.line(a, b, legend='something', color='green', line_width=2)
p.left[0].formatter.use_scientific = False

p.xaxis.ticker = FixedTicker(ticks=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
p.yaxis[0].formatter = NumeralTickFormatter(format="0,0")
p.legend.background_fill_alpha = 0.1
show(p)
def step_line(x, y):
    """
    ingest two lists
    set offsets such that the data can be used
    to generate a step-line plot.
    
    Steps are thus:
        * for x's, repeat all but the first.
        * for y's, double up each occurance except the last
    
    Example:
        Before:
            a = [1, 2, 3, 4, 5]
            b = [2, 5, 9, 1, 2]
        After:
            a = [1, 2, 2, 3, 3, 4, 4, 5, 5]
            b = [2, 2, 5, 5, 9, 9, 1, 1, 2]
    """
    x1 = []
    y1 = []
    
    for idx in (range(len(x)*2-1)):
        if idx == 0:
            print(idx)
            x1.append(x[idx])
            y1.append(y[idx])
        else:
            #print('ceil is: ' + str(math.ceil(idx/2)))
            x1.append(x[math.ceil(idx/2)])
            y1.append(y[math.floor(idx/2)])
    return x1, y1
one, two = step_line(a, b)
p = figure(plot_height = 300, plot_width = 500, title=' , Volume')

p.line(one, two, legend='something', color='green', line_width=2)
p.left[0].formatter.use_scientific = False

p.xaxis.ticker = FixedTicker(ticks=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
p.yaxis[0].formatter = NumeralTickFormatter(format="0,0")
p.legend.background_fill_alpha = 0.1
show(p)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1685022026431718, 'fraction_numerical': 0.0605726872246696, 'mean_word_length': 2.6195219123505975, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '433514', 'license': 'MIT', 'n_tokens_mistral': 802, 'n_tokens_neox': 704, 'n_words': 192, 'path': 'bokeh_step_line.ipynb', 'repo_name': 'afonit/step_line', 'size': '1816'}