See also a contour plot example in the bokeh gallery page Comparison to bokehīokeh-plot is a thin wrapper over the excellent bokeh library that cuts down the amount of boilerplate code. imshow(a) displays an array as an image:.show_df(df) displays pandas dataframe as a table (new in v0.1.14):.If the legend grows too long, it canīe hidden with legend_loc='hide' (new in v0.1.13): Plot(df) plots all columns of the dataframe as separate lines on the same figure with column namesĭisplayed in the legend and with index taken as the x axis values. Plot(x, y, vline=1, hline=1.5, vline_color='red') in addition to the (x, y) plot displays an infinite vertical line with x=1 and custom red color and an infinite horizontal line with y=1.5 and the default pink color. Plot(x, y, hover=True) displays point coordinates on mouse hover. Semilogx(), semilogy() and loglog() show (semi)logarithmic plots with the same syntax as plot(). The latter one accepts a list of lists of figures). There're three common layouts: bl.row, bl.column and bl.gridplot (the former two accept list of figures, (bp stands for ot, bl is is a shortcut for bokeh.layouts) Legend location: - plot(,, label='plot1', legend_loc='top_left')Īxes labels: - plot(, xlabel='time', ylabel='value') NB The color specifier must go after the marker if both are present. 'O' orange (capital O to avoid clashes with 'o' for open dots) The following colors are supported so far: 'b' blue The following markers are supported so far: '.' dots Plot(x, y2, '.-g') # the second plot is green plot(x, y1, '.-') # solid line with dots Multiple plot syntax (equivalent ways to draw it): x = Interactive controls: click and drag = pan The following syntax is supported: plot() # x is automatic To load this extension in jupyter notebook: %load_ext bokeh_plot With Pandas-Bokeh, creating stunning, interactive, HTML-based visualization is as easy as. Importing the library adds a complementary plotting method plotbokeh() on DataFrames and Series. Bokeh-plot Installation: pip install bokeh-plot Pandas-Bokeh provides a Bokeh plotting backend for Pandas, GeoPandas and Pyspark DataFrames, similar to the already existing Visualization feature of Pandas.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |