Skip to main content

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`


**NOTE**: to get latest version install directly from git, which is more commonly updated. Use the following:
`pip install git+https://github.com/rsandler00/plotly-scientific-plots.git`


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][1]**

Below, are a limited set of examples to give the feel of how `psp` works:

#### Sample plots

##### Two dataset histograms:

```python
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.

![plot2Hist_1](images/plot2Hist_1.png?raw=true "plot2Hist_1")


##### Scatter + Contour Plot:

```python
psp.scatterHistoPlot(data_source_1, data_source_3, title='Contour of x_var & y_var',
xlbl='x_var label', ylbl='y_var label')
```
![plot2Hist_1](images/contour_and_scatter.png?raw=true "contour_and_scatter")


##### Multiple Dataset Correlations + Stats:

```python
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')
```
![plot2Hist_1](images/corrPlot_multi.png?raw=true "corrPlot_multi")


##### Polar Plot

```python
psp.plotPolar([polar1], numbins=20, title='Polar Distribution')
```
![plot2Hist_1](images/polar1.png?raw=true "polar1")


#### 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:

```python
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:

![plot2Hist_1](images/dashboard1.png?raw=true "dashboard1")




[1]: https://nbviewer.jupyter.org/github/rsandler00/plotly-scientific-plots/blob/master/examples.ipynb





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

plotly-scientific-plots-0.1.0.6.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plotly_scientific_plots-0.1.0.6-py3-none-any.whl (61.4 kB view details)

Uploaded Python 3

File details

Details for the file plotly-scientific-plots-0.1.0.6.tar.gz.

File metadata

  • Download URL: plotly-scientific-plots-0.1.0.6.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

File hashes

Hashes for plotly-scientific-plots-0.1.0.6.tar.gz
Algorithm Hash digest
SHA256 cc00d2ca8e90430ac513e1447dbef86d2dfe8a5367e5e10eaaabaca6b89d0b7c
MD5 095137a911fa764ac7e238107db0cb1f
BLAKE2b-256 8f4056a0c71bd530670c937ea5fddf11317ab5a7bb1e9a1e7901bcec9b2ddadf

See more details on using hashes here.

File details

Details for the file plotly_scientific_plots-0.1.0.6-py3-none-any.whl.

File metadata

  • Download URL: plotly_scientific_plots-0.1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 61.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

File hashes

Hashes for plotly_scientific_plots-0.1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a2bcc1f2a2f506c688a6e2e6176b66fa3c5aee1c18df77baa9e1c9cc4ba1aefe
MD5 75fb18c503a564072c2c54c9a5116404
BLAKE2b-256 87f282b13cce5508ca5b54c23cd3b080d50a2fd2fd0d6fbf68cacc4fe73f7df0

See more details on using hashes here.

Supported by

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