Skip to main content

Matlab-inspired call syntax for bokeh plots

Project description

bokeh-plot

Installation:

pip install bokeh-plot

Usage:

To load this extension in jupyter notebook:

%load_ext bokeh_plot

The following syntax is supported:

plot([1,4,9])             # x is automatic 
plot([1,4,9], '.-')       # line and dots 
plot([1,2,3], [1,4,9])    # x and y 
plot([1,2,3], [1,4,9], '.-')    # x, y and line style

Several plots in one figure:

Interactive controls:

click and drag = pan
mouse wheel = zoom, 
wheel on x axis = scroll horizontally
wheel on y axis = scroll vertically

Multiple plot syntax:

x = [1,5,10]
y1 = [1,4,9]
y2 = [1,8,27]

- plot(x, y1, '.-')        # solid line with dots
  plot(x, y2, '.-g')       # the second plot is green

- plot([y1, y2])           # auto x, auto colors       

- plot(x, [y1, y2])

- plot([y1, y2], '.-bg')   # blue and green

- plot([y1, y2], style=['.', '.-'], color=['b', 'g'])

- plot(x, y1, '.-', x, y2, '.-g')

The following markers are supported so far:

'.' dots
'-' line
'.-' dots+line

The following colors are supported so far:

'b' blue
'g' green
'r' red
'o' orange

NB The color specifier must go after the marker if both are present.

Legend:

- plot([1,2,3], [1,4,9], legend='plot1')
  plot([1,2,3], [2,5,10], legend='plot2')

- plot([y1, y2], legend=['y1', 'y2'])

Legend location:

- plot([1,2,3], [1,4,9], legend='plot1', legend_loc='top_left')
  plot([1,2,3], [2,5,10], legend='plot2')

Other legend locations: https://docs.bokeh.org/en/latest/docs/user_guide/styling.html#location

Other uses:

semilogx(), semilogy() and loglog() show (semi)logarithmic plots with the same syntax as plot().

plot(x, y, hover=True) displays point coordinates on mouse hover.

imshow(a) displays an array as an image:

Complete list of palettes: https://docs.bokeh.org/en/latest/docs/reference/palettes.html

See also a contour plot example in the bokeh gallery page

Comparison to bokeh

bokeh-plot is a thin wrapper over the excellent bokeh library that cuts down the amount of boilerplate code.

The following two cells are equivalent:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bokeh_plot-0.1.13.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

bokeh_plot-0.1.13-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file bokeh_plot-0.1.13.tar.gz.

File metadata

  • Download URL: bokeh_plot-0.1.13.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.7

File hashes

Hashes for bokeh_plot-0.1.13.tar.gz
Algorithm Hash digest
SHA256 ca53672d9874d8546c40dd939b1dbdeed8d3f5f5d3ba43825e54fdc6e9d2e6ad
MD5 26a19f495663fb2287c68568d08c98fa
BLAKE2b-256 c1ee4d7cd7689d9eac6eac8cc91eb3c54a63208a1b0832b11c9ab7710c4a99cf

See more details on using hashes here.

Provenance

File details

Details for the file bokeh_plot-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: bokeh_plot-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.7

File hashes

Hashes for bokeh_plot-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 90da20f14ea8af64dc04b4db25e44e22c75b3b3e1726f37f9f30b373ed29ceac
MD5 3d65f221a5c216994fe4f319921cadbe
BLAKE2b-256 f9f53d981d135a3cbca9deb2b4faf7f02f289cdee29c89363cf53b55579a1b8a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page