Python package extending plotly for scientific computing and visualization
Project description
plotly-scientific-plots
This python library is meant to augment the plotly and dash visualization libraries. It is designed to facilitate rapid and beautiful data visualizations for research scientists and data scientists.
Its advantages over naive plotly are:
- One-line commands to make plots
- Integrated scatistical testing above plots
- Expanded plot types (such as confusion amtrices, ROC plots)
- more 'Matlab-like' interface for those making the Matlab --> python transition
- Easily make full multi-figure dashboards in a single line using Dash
Requirements and installation
Required packages:
- numpy
- scipy
- plotly
- colorlover
- dash
- dash_core_components
- dash_html_components
To install, simply use pip install plotly-scientific-plots
To import use import plotly_scientific_plots as psp
Examples and Usage
Plotly's key strength is its ability to do interactive visualizations.
For scientists, this allows novel ways of exploring data with mouse clicks and hovers. To see a full list of plotly-scientific-tools examples and their descriptions, go through the examples.ipynb
in nbviewer by clicking here
Below, are a limited set of examples to give the feel of how psp
works:
Sample plots
Two dataset histograms:
psp.plot2Hists(data_source_1, data_source_2, names=['Data 1','Data 2'],
normHist=True, title='Comparison of 2 Data Sources',
KS=True, MW=True, T=True)
Notice that the statistics box only appears when mouse hovers on the databar of the given color.
Scatter + Contour Plot:
psp.scatterHistoPlot(data_source_1, data_source_3, title='Contour of x_var & y_var',
xlbl='x_var label', ylbl='y_var label')
Multiple Dataset Correlations + Stats:
psp.corrPlot([data_source_1, data_source_11, data_source_12], [data_source_3, data_source_31,
data_source_32], names=['datasetA', 'datasetB', 'datasetC'],addCorr=True,
addCorrLine=True, title='Correlation of x_var & y_var', xlbl='x_var label',
ylbl='y_var label')
Polar Plot
psp.plotPolar([polar1], numbins=20, title='Polar Distribution')
Dashboards
To make multi-figure dashboards simply collect all desired figures in a nested list. Each outer list will correspond
to a column in the dashboard, and each figure within each outer list will be a row in the column. The pass that list
to psp.startDashboard
. A flask-based web-server will start showing the figures in the browser at the provided port
(default port=8050). For example:
plot1 = psp.plotHist(..., plot=False)
plot2 = psp.plot2Hists(..., plot=False)
plot3 = psp.corrPlot(..., plot=False)
plot4 = psp.plotPolar(..., plot=False)
dash_plots = [
[plot1, plot2],
[plot3, plot4]
]
psp.startDashboard(dash_plots, port=8052)
An example dashboard appears below:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for plotly-scientific-plots-0.1.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b3e7195bf61625c1135096ee86738a8e79f021d358c8416484d1fd33c563af6 |
|
MD5 | 4a7ff44d7a9083b48ebef4335e814483 |
|
BLAKE2b-256 | 9c22c16aa282cdf8a52506026e185a55bfc341fe12594da6a7314429ff984c58 |
Hashes for plotly_scientific_plots-0.1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8197cb8ec0f8a0713c2ea6e4393e192949a63f2b76e10c744eacb665b81cc292 |
|
MD5 | edbdd9023ffcfd47d954cf564015a508 |
|
BLAKE2b-256 | 0a93226b833290ae2178f979ffb3876e08369742fb0bb7cdb94f996157c00f13 |