On Mar 12, 2016, at 1:31 PM, A.S <[email protected]> wrote:
Thanks a lot!
That's elegant and it is working.
The only problem I am seeing is that if I allow a toolbar and then press the reset widget, the graph will squeeze and disappear.
Do you know why or if there is any solution to that?
On Friday, March 11, 2016 at 3:59:31 PM UTC+1, Jeff Harris wrote:
A minimal example:
import pandas as pd
import numpy as np
# setup range
rng = pd.date_range(start='3/11/16', periods=48, freq='H' )
td = pd.Series([ pd.Timedelta(minutes=i) for i in np.random.randint(0,59,48) ])
interval = pd.DataFrame({'start' : rng })
interval['end'] = interval['start'] + td
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure, show, output_file
cds_df = ColumnDataSource(interval)
p = figure(x_axis_type='datetime', plot_height=100, plot_width=500, responsive=True)
# hide the toolbar
p.toolbar_location=None
# formatting
p.yaxis.minor_tick_line_color = None
p.ygrid[0].ticker.desired_num_ticks = 1
y1 = p.quad(left='start',right='end',bottom=0, top=1, source=cds_df )
output_file("time_interval.html", mode='cdn')
show(p)
On Fri, Mar 11, 2016 at 1:06 PM, <[email protected]> wrote:
I was wondering how to plot pairs of timestamps in a simple graph such as the one in the picture.
What I have is a Python list such as:
['Friday 11 March 2016 08:43:07AM', 'Friday 11 March 2016 08:47:07AM', 'Friday 11 March 2016 08:52:08AM', 'Friday 11 March 2016 08:59:09AM']
The first item of the list is the start time of the first interval, the second is the end time of the first interval, and so on there may be dozens of intervals in the list. I can also iterate through the list and export it to a pandas dataframe with a Start and an End column where each pair is stored as a dataframe row.
However, I have no idea how I could produce the following graph with bokeh.
Any idea?
--
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 bokeh+un...@continuum.io.
To post to this group, send email to bo...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/8d834890-af42-42db-afe5-832ff2859cb6%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
--
Jeff Harris
BridgeSpan Financial
1001 19th Street North
Suite 1200
Arlington, VA 22209
jeff....@bridge-span.com
Company: (703) 341-5999
Cell: (703) 389-5867
* you can now follow us on both Facebook and Twitter. Keyword: SAFESTART *
----------
This electronic mail message and any associated files contain information that (a) is or may be LEGALLY PRIVILEGED, CONFIDENTIAL, PROPRIETARY IN NATURE, OR OTHERWISE PROTECTED BY LAW FROM DISCLOSURE, and (b) is intended only for the use of the Addressee(s) named herein. If you are not the intended recipient, an addressee, or the person responsible for delivering this to an addressee, you are hereby notified that reading, using, copying, or distributing all or any part of this message is strictly prohibited. If you have received this electronic mail message in error, please contact us immediately by replying to this message and taking the steps necessary to delete the message completely from your computer system.
----------
--
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/da3291d9-6b5e-4de2-b843-bc3b51452139%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.