{"id":48454393,"url":"https://github.com/faridrashidi/cnsplots","last_synced_at":"2026-04-06T22:03:28.489Z","repository":{"id":343040879,"uuid":"592054202","full_name":"faridrashidi/cnsplots","owner":"faridrashidi","description":"🎨 Toolkit for generating publication-quality plots for Cell, Nature and Science journals","archived":false,"fork":false,"pushed_at":"2026-04-01T18:28:19.000Z","size":153874,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-02T05:31:13.645Z","etag":null,"topics":["data-science","data-visualization","plotting","publication-quality","python","scientific-publications"],"latest_commit_sha":null,"homepage":"https://cnsplots.farid.one","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/faridrashidi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2023-01-22T19:28:36.000Z","updated_at":"2026-04-01T18:24:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/faridrashidi/cnsplots","commit_stats":null,"previous_names":["faridrashidi/cnsplots"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/faridrashidi/cnsplots","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faridrashidi%2Fcnsplots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faridrashidi%2Fcnsplots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faridrashidi%2Fcnsplots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faridrashidi%2Fcnsplots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faridrashidi","download_url":"https://codeload.github.com/faridrashidi/cnsplots/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faridrashidi%2Fcnsplots/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31491098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"ssl_error","status_checked_at":"2026-04-06T17:22:54.741Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-science","data-visualization","plotting","publication-quality","python","scientific-publications"],"created_at":"2026-04-06T22:03:27.788Z","updated_at":"2026-04-06T22:03:28.482Z","avatar_url":"https://github.com/faridrashidi.png","language":"Python","readme":"# cnsplots\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/faridrashidi/cnsplots/main/docs/_static/images/logo.svg\" alt=\"cnsplots logo\" width=\"240\"\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Tests](https://img.shields.io/github/actions/workflow/status/faridrashidi/cnsplots/ci-tests.yml?branch=main\u0026logo=github\u0026logoColor=white\u0026style=flat-square\u0026label=tests\u0026labelColor=000000\u0026cacheSeconds=0)](https://github.com/faridrashidi/cnsplots/actions/workflows/ci-tests.yml)\n[![Docs](https://img.shields.io/website?url=https%3A%2F%2Fcnsplots.farid.one%2F\u0026up_message=online\u0026down_message=offline\u0026logo=readthedocs\u0026logoColor=white\u0026style=flat-square\u0026label=docs\u0026labelColor=000000\u0026cacheSeconds=0)](https://cnsplots.farid.one/)\n[![PyPI](https://img.shields.io/pypi/v/cnsplots?logo=pypi\u0026logoColor=white\u0026style=flat-square\u0026labelColor=000000\u0026cacheSeconds=0)](https://pypi.org/project/cnsplots/)\n[![Python Version](https://img.shields.io/pypi/pyversions/cnsplots?logo=python\u0026logoColor=white\u0026style=flat-square\u0026labelColor=000000\u0026cacheSeconds=0)](https://pypi.org/project/cnsplots/)\n[![License](https://img.shields.io/pypi/l/cnsplots?logo=creativecommons\u0026logoColor=white\u0026style=flat-square\u0026labelColor=000000\u0026color=blueviolet\u0026cacheSeconds=0)](https://github.com/faridrashidi/cnsplots/blob/main/LICENSE.md)\n\n**Publication-Ready Scientific Plots for Cell, Nature, and Science Journals**\n\nCreate visually stunning, journal-quality figures with minimal code. Built on matplotlib, fully compatible with seaborn, and optimized for Adobe Illustrator.\n\n[Documentation](https://cnsplots.farid.one/) · [Examples Gallery](https://cnsplots.farid.one/latest/examples/index.html) · [Report Bug](https://github.com/faridrashidi/cnsplots/issues) · [Request Feature](https://github.com/faridrashidi/cnsplots/issues)\n\n\u003c/div\u003e\n\n---\n\n## Overview\n\n[![Overview](https://raw.githubusercontent.com/faridrashidi/cnsplots/main/docs/_static/images/overview.png)](https://cnsplots.farid.one/latest/examples/showcase.html#figure-1)\n\n**cnsplots** is a Python visualization library designed specifically for creating publication-ready scientific figures. It takes care of the tedious styling details so you can focus on your science.\n\n### Why cnsplots?\n\n- 🎨 **Publication-Ready**: Pre-configured styles matching Cell, Nature, and Science journal requirements\n- 🎯 **Simple API**: Create complex multi-panel figures with just a few lines of code\n- 📐 **Precise Control**: Specify dimensions in pixels, perfect for journal submission guidelines\n- 🖋️ **Adobe Illustrator Compatible**: SVG exports with editable fonts (no text-to-path conversion)\n- 📊 **Statistical Integration**: Built-in statistical tests and annotations\n- 🔧 **Highly Customizable**: Full control over colors, fonts, and styling\n- 🌈 **Rich Color Palettes**: Curated color schemes optimized for scientific visualization\n- 🧩 **Multi-Panel Support**: Easy creation of complex figure layouts\n\n## Features\n\n### 📊 25+ Plot Types\n\n**Basic Plots**\n\n- Box plots, violin plots, bar plots, strip plots\n- Scatter plots, line plots, regression plots\n- Histograms, KDE plots, ridge plots\n\n**Scientific Plots**\n\n- Survival plots (Kaplan-Meier)\n- Cumulative incidence plots\n- ROC curves and forest plots\n- Volcano plots and GSEA plots\n- Confusion matrices\n\n**Specialized Plots**\n\n- Heatmaps with hierarchical clustering\n- Dot plots for enrichment\n- Venn diagrams and UpSet plots\n- Sankey diagrams\n- Pie and donut charts\n- QQ plots and slope plots\n\n### 🎨 Beautiful Color Palettes\n\nMultiple curated palettes including:\n\n- **Qualitative**: Cell, Nature, Science, Ecotyper1-6, Set1-3, Tableau, Bold\n- **Sequential**: Parula, gnuplot, custom gradients\n- **Diverging**: BlueRed, BuRd_custom, OrBu_custom\n\n### 📐 Multi-Panel Figures\n\nCreate complex layouts with automatic panel labeling (A, B, C...):\n\n```python\nimport cnsplots as cns\n\nmp = cns.multipanel(max_width=540)\n\n# Panel A\nmp.panel(\"A\", height=150, width=150)\ncns.boxplot(data=df1, x=\"group\", y=\"value\")\n\n# Panel B\nmp.panel(\"B\", height=150, width=150)\ncns.scatterplot(data=df2, x=\"x\", y=\"y\")\n\n# Continues...\n```\n\n## Installation\n\n### From PyPI\n\n```bash\npip install cnsplots\n```\n\n### For Development\n\nFirst install [uv](https://docs.astral.sh/uv/), then:\n\n```bash\ngit clone https://github.com/faridrashidi/cnsplots\ncd cnsplots\nmake install\n```\n\nThis installs the package with its development and documentation extras. Core\nscientific integrations such as `scanpy`, `lifelines`, and `gseapy` remain\nruntime dependencies of `cnsplots` itself.\n\n## Quick Start\n\n### Basic Usage\n\n```python\nimport cnsplots as cns\nimport seaborn as sns\n\n# Load example data\ndf = sns.load_dataset(\"tips\")\n\n# Create a figure (height, width in pixels)\ncns.figure(height=150, width=100)\n\n# Create a publication-ready boxplot\ncns.boxplot(data=df, x=\"day\", y=\"total_bill\")\n\n# Save as vector graphic\ncns.savefig(\"figure.svg\")\n```\n\n### Statistical Comparisons\n\n```python\n# Add statistical significance annotations\ncns.figure(150, 150)\ncns.boxplot(\n    data=df,\n    x=\"day\",\n    y=\"total_bill\",\n    pairs=[(\"Thur\", \"Fri\"), (\"Sat\", \"Sun\")],  # Compare these pairs\n)\n# Prints: P-values were determined by two-sided Mann-Whitney U test.\n```\n\n### Custom Colors\n\n```python\n# Use custom color palette\ncns.figure(150, 200, color_cycle=\"Ecotyper1\")\ncns.violinplot(data=df, x=\"day\", y=\"total_bill\", hue=\"sex\")\n```\n\n## Examples Gallery\n\nExplore our comprehensive [examples gallery](https://cnsplots.farid.one/latest/examples/index.html) featuring:\n\n- 📦 Basic statistical plots\n- 🧬 Genomics and bioinformatics visualizations\n- 📈 Time-series and survival analysis\n- 🎯 Machine learning results (ROC, confusion matrices)\n- 🔬 Multi-omics data visualization\n- 🎨 Custom color schemes and styling\n\n## Documentation\n\nFull documentation is available at [cnsplots.farid.one](https://cnsplots.farid.one/)\n\n- [Installation Guide](https://cnsplots.farid.one/latest/installation.html)\n- [API Reference](https://cnsplots.farid.one/latest/api.html)\n- [Examples Gallery](https://cnsplots.farid.one/latest/examples/index.html)\n\n## Key Concepts\n\n### Figure Dimensions\n\nSpecify sizes in **pixels** for precise control:\n\n```python\ncns.figure(height=150, width=100)  # Final canvas size is 150px × 100px\n```\n\n### Color Palettes\n\nAccess curated color palettes:\n\n```python\n# Qualitative palettes (for categorical data)\ncns.figure(color_cycle=\"Ecotyper1\")  # Default, optimized for journals\ncns.figure(color_cycle=\"Cell\")  # Custom Cell-inspired journal palette\ncns.figure(color_cycle=\"Nature\")  # Nature-inspired journal palette\ncns.figure(color_cycle=\"Science\")  # Science-inspired journal palette\ncns.figure(color_cycle=\"Set1\")  # ColorBrewer Set1\n\n# Sequential palettes (for continuous data)\ncns.figure(color_map=\"parula\")  # MATLAB-style\ncns.figure(color_map=\"gnuplot\")  # Default sequential\n\n# Get individual colors\nred = cns.RED\nblue = cns.BLUE\n```\n\n### Statistical Tests\n\nMany plot functions include built-in statistical testing:\n\n```python\n# Boxplot with Mann-Whitney U test\ncns.boxplot(data=df, x=\"group\", y=\"value\", pairs=\"all\")\n\n# Barplot with Welch's t-test\ncns.barplot(data=df, x=\"group\", y=\"value\", pairs=[(\"A\", \"B\")])\n\n# Stackplot with Fisher's exact test\ncns.stackplot(data=df, x=\"group\", y=\"category\", pairs=[(\"A\", \"B\")])\n```\n\n### Export for Publication\n\n```python\n# SVG for vector graphics (recommended)\ncns.savefig(\"figure.svg\")\n\n# High-resolution PNG\ncns.savefig(\"figure.png\")\n\n# PDF with editable text\ncns.savefig(\"figure.pdf\")\n```\n\nFor Illustrator-optimized SVG post-processing, install MuPDF's `mutool`.\nWithout it, `cns.savefig(\"figure.svg\")` falls back to a standard matplotlib SVG\nand emits a warning instead of failing.\n\n## Requirements\n\n- Python ≥ 3.10\n- Core: matplotlib, numpy, pandas, seaborn\n- Included integrations: lifelines, gseapy, scanpy, and other plotting backends\n- Optional external tool: MuPDF's `mutool` for enhanced SVG post-processing\n\nSee [pyproject.toml](pyproject.toml) for complete dependency list.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n## Citation\n\nIf you use cnsplots in your research, please cite:\n\n```bibtex\n@software{cnsplots,\n  author = {Rashidi, Farid},\n  title = {cnsplots: Publication-Ready Scientific Plots},\n  year = {2026},\n  url = {https://github.com/faridrashidi/cnsplots}\n}\n```\n\n## License\n\nThis project is licensed under the BSD 3-Clause License - see the [LICENSE.md](LICENSE.md) file for details.\n\n## Acknowledgments\n\nBuilt with:\n\n- [matplotlib](https://matplotlib.org/) - Core plotting library\n- [seaborn](https://seaborn.pydata.org/) - Statistical visualizations\n- [lifelines](https://lifelines.readthedocs.io/) - Survival analysis\n- [PyComplexHeatmap](https://github.com/DingWB/PyComplexHeatmap) - Complex heatmaps\n- [UpSetPlot](https://upsetplot.readthedocs.io/) - Set intersections\n\nInspired by the visualization standards of Cell, Nature, and Science journals.\n\n## Support\n\n- 📖 [Documentation](https://cnsplots.farid.one/)\n- 🐛 [Issue Tracker](https://github.com/faridrashidi/cnsplots/issues)\n- 💬 [Discussions](https://github.com/faridrashidi/cnsplots/discussions)\n\n## Related Projects\n\n- [matplotlib](https://matplotlib.org/) - The foundation of Python plotting\n- [seaborn](https://seaborn.pydata.org/) - Statistical data visualization\n- [plotnine](https://plotnine.readthedocs.io/) - Grammar of graphics for Python\n- [altair](https://altair-viz.github.io/) - Declarative visualization\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\nMade with ❤️ for the scientific community\n\n[⭐ Star us on GitHub](https://github.com/faridrashidi/cnsplots) · [📖 Documentation](https://cnsplots.farid.one/)\n\n\u003c/div\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaridrashidi%2Fcnsplots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaridrashidi%2Fcnsplots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaridrashidi%2Fcnsplots/lists"}