Open RohitDhankar opened 4 years ago
It's an Interactive Plot, if we hover over any field it will display more information about that field like tableau Looking forward to creating more engaging and Interactive visuals.
@S-T-A-R-L-O-R-D - thanks Devesh , this is awesome :)
from bokeh.plotting import figure, output_file, show, ColumnDataSource from bokeh.models.tools import HoverTool from bokeh.transform import factor_cmap from bokeh.palettes import Blues8 from bokeh.embed import components from bokeh.io import output_notebook,show import pandas as pd
df = pd.read_csv("cars.csv")
source = ColumnDataSource(df)
output_notebook() output_file("index.html")
p = figure( y_range=source.data['Car'].tolist(), plot_width=800, plot_height=600, title="Cars With Top Horsepower ", x_axis_label="Horsepower", tools="pan,box_select,zoom_in,zoom_out,save,reset")
p.hbar(y='Car', right='Horsepower', left=0, height=0.4, fill_color=factor_cmap('Car',palette=Blues8,factors=source.data['Car'].tolist()), fill_alpha=0.5, legend='Car' ,source=source)
p.legend.orientation='vertical' p.legend.location='top_right' p.legend.label_text_font_size='10px'
hover = HoverTool() hover.tooltips = """
""" p.add_tools(hover)
show(p)
script,div=components(p) print(div) print(script)
Deep dive Visualizations with - Bokeh , Holoviews , PlotlyJS , d3.js , dc.js and maybe Seaborn @RohitDhankar and @RohanMathur17 to collab .
Existing old code here - https://github.com/digital-cognition-co-in/DigitalCognition/blob/97d80d279d8cf0cb5f85a2264bab8e2f23e7a44c/dc_dash/dc_bokeh_plots.py#L19
@S-T-A-R-L-O-R-D ( DEVESH SOLANKI ) to collab with @RohanMathur17 for Plotly Python version and Bokeh plots / charts.