Skip to content

Statistical analysis, clustering and visualinzing scientific data with hassle free

License

Notifications You must be signed in to change notification settings

koonimaru/omniplot

Repository files navigation

Downloads PyPI Version License omniplot logo

What is omniplot

omniplot is a python module to draw a scientific plot with hassle free. It mainly focuses on bioinfomatics data.





Motivation

Although there exist many good python data visualization libraries, such as matplotlib, pandas, seaborn, plotly, vedo and so on, still several kinds of plots cannot be drawn without hassle. This module is aimed to provide convenient tools that allow users to draw complex plots, such as a scatter plot with PCA and loadings or clustering analysis in one liner.

Install

omniplot best works with python3.8. But, greater python versions may be OK. Please try installation with conda, if something wrong with pip installation.

pip install cython --user
git clone https://github.com/koonimaru/omniplot.git --user
cd omniplot
pip install .

or

pip install cython --user
pip install git+https://github.com/koonimaru/omniplot.git --user

or

git clone https://github.com/koonimaru/omniplot.git
cd omniplot
conda env create -f environment.yml python=3.8
conda activate omniplot
conda install ipykernel
ipython kernel install --user --name=omniplot
conda deactivate

And this is how to use conda environment in jupyerlab.

Known issues:
If you get errors saying "error: invalid command 'bdist_wheel'", please try pip install --upgrade pip wheel setuptools

How to use

I created jupyter notebooks to demonstrate the usage of omniplot Link. You can open jupyter notebooks with jupyter lab or VScode.

And, I also write articles in medium.

A formal documation is under development, but you may want to visit an auto-generated API.

Example usage

import pandas as pd
from omniplot import plot as op
import seaborn as  sns
import matplotlib.pyplot as plt

df=sns.load_dataset("titanic")
df=df[["class","embark_town","sex"]].fillna("NA")
op.nested_piechart(df, category=["class","embark_town","sex"], title="Titanic", ignore=0.01, show_legend=True,show_values=False,hatch=True,ncols=3)
plt.show()

Example usage

import seaborn as sns
from omniplot import plot as op
import matplotlib.pyplot as plt
df=sns.load_dataset("penguins")
df=df.dropna(axis=0)
res=op.radialtree(df, category=["species","island","sex"])
plt.show()