weird caching of previous plots in new images

Greetings,

I have been experimenting with bokeh for a few days now and I have noticed this weird behaviour:

The figure which shows the plot objects may contain plot objects from previous figures.

Unfortunately, I cannot share the exact code, but this is the core of my program:

    from bokeh.plotting import scatter, line, hold, show

    from bokeh.resources import CDN

    from bokeh.embed import components

    import pandas as pd

    measurement = "..."

    df = ...

    hold()

    s = scatter(df['date'], df['value'], size=5, color="red", alpha=0.5, plot_width=600, plot_height=400, x_axis_type='datetime', legend="daily", title=measurement)

    l = line(df['date'], df['value'].mean(), line_width=2, color="grey", alpha=0.5, plot_width=600, plot_height=400, x_axis_type='datetime', legend="total")

    show()

    script, div = components(l, CDN)

    body = div + script

As you can see, I am embedding the graphic into an HTML webpage.

Any idea on what I am doing wrong?

Many thanks!

if you are referring to the Scatter and the line being on the same chart?
If so the hold() is allowing that.

···

On Thu, Oct 23, 2014 at 7:31 AM, [email protected] wrote:

Greetings,

I have been experimenting with bokeh for a few days now and I have noticed this weird behaviour:

The figure which shows the plot objects may contain plot objects from previous figures.

Unfortunately, I cannot share the exact code, but this is the core of my program:

    from bokeh.plotting import scatter, line, hold, show
    from bokeh.resources import CDN
    from bokeh.embed import components
    import pandas as pd
    measurement = "..."
    df = ...
    hold()
    s = scatter(df['date'], df['value'], size=5, color="red", alpha=0.5, plot_width=600, plot_height=400, x_axis_type='datetime', legend="daily", title=measurement)
    l = line(df['date'], df['value'].mean(), line_width=2, color="grey", alpha=0.5, plot_width=600, plot_height=400, x_axis_type='datetime', legend="total")
    show()
    script, div = components(l, CDN)
    body = div + script

As you can see, I am embedding the graphic into an HTML webpage.

Any idea on what I am doing wrong?

Many thanks!

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/589d2573-6793-4a94-bd2a-1b3838d95ba9%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I guess you are referring to the accumulation of figures in your html file…

Right now, since 0.7 release, the plotting API was rewritten in a way that you will not have this problem again.

Just update the code to use the new plotting API and you will be fine.

Cheers.

Damian

···

On Sunday, October 26, 2014 1:53:36 PM UTC-3, Jared Thompson wrote:

if you are referring to the Scatter and the line being on the same chart?
If so the hold() is allowing that.

On Thu, Oct 23, 2014 at 7:31 AM, [email protected] wrote:

Greetings,

I have been experimenting with bokeh for a few days now and I have noticed this weird behaviour:

The figure which shows the plot objects may contain plot objects from previous figures.

Unfortunately, I cannot share the exact code, but this is the core of my program:

    from bokeh.plotting import scatter, line, hold, show
    from bokeh.resources import CDN
    from bokeh.embed import components
    import pandas as pd
    measurement = "..."
    df = ...
    hold()
    s = scatter(df['date'], df['value'], size=5, color="red", alpha=0.5, plot_width=600, plot_height=400, x_axis_type='datetime', legend="daily", title=measurement)
    l = line(df['date'], df['value'].mean(), line_width=2, color="grey", alpha=0.5, plot_width=600, plot_height=400, x_axis_type='datetime', legend="total")
    show()
    script, div = components(l, CDN)
    body = div + script

As you can see, I am embedding the graphic into an HTML webpage.

Any idea on what I am doing wrong?

Many thanks!

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/589d2573-6793-4a94-bd2a-1b3838d95ba9%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.