Bokeh line graph looping
<p>Iâve been working on bokeh plots and Iâm trying to plot a line graph taking values from a database. But the plot kind of traces back to the initial point and I donât want that. I want a plot which starts at one point and stops at a certain point (and circle back). Iâve tried plotting it on other tools like SQLite browser and Excel and the plot seems ok which means I must be doing something wrong with the bokeh stuff and that the data points itself are not in error.</p>

<p>Iâve attached the images for reference and the line of code doing the line plot. Is there something Iâve missed?</p>

<pre><code>&gt;&gt;&gt; image = fig.line(âxâ, âyâ, color=color, source=something) 
</code></pre>

<p>(Assume <code>x</code> and <code>y</code> are integer values and Iâve specified <code>x</code> and <code>y</code> ranges as <code>DataRange1d(bounds=(0,None))</code>)</p>

<p><a href="http://i.stack.imgur.com/wpPiU.png" rel="nofollow"><img src="http://i.stack.imgur.com/wpPiU.png" alt="enter image description here"></a></p>

<p><a href="http://i.stack.imgur.com/shVqI.png" rel="nofollow"><img src="http://i.stack.imgur.com/shVqI.png" alt="enter image description here"></a></p>

<p>Bokeh does not "auto-close" lines. You can see this is the case by looking at any number of examples in the docs and repository, but here is one in particular:</p>

<p><a href="http://bokeh.pydata.org/en/latest/docs/gallery/stocks.html" rel="nofollow">http://bokeh.pydata.org/en/latest/docs/gallery/stocks.html</a></p>

<p>Bokeh's <code>.line</code> method will only "close up" if that is what is in the data (i.e., if the last point in the data is a repeat of the first point). I suggest you actually inspect the data values in <code>source.data</code> and I believe you will find this to be the case. Then the question is why is that the case and how to prevent it from doing that, but that is not really a Bokeh question. </p>

python bokeh