publiplots 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- publiplots-0.1.0/.gitignore +207 -0
- publiplots-0.1.0/CHANGELOG.md +28 -0
- publiplots-0.1.0/LICENSE +21 -0
- publiplots-0.1.0/PKG-INFO +166 -0
- publiplots-0.1.0/README.md +130 -0
- publiplots-0.1.0/pyproject.toml +84 -0
- publiplots-0.1.0/src/publiplots/__init__.py +110 -0
- publiplots-0.1.0/src/publiplots/advanced/__init__.py +8 -0
- publiplots-0.1.0/src/publiplots/advanced/venn.py +374 -0
- publiplots-0.1.0/src/publiplots/base/__init__.py +8 -0
- publiplots-0.1.0/src/publiplots/base/bar.py +498 -0
- publiplots-0.1.0/src/publiplots/base/scatter.py +498 -0
- publiplots-0.1.0/src/publiplots/config.py +30 -0
- publiplots-0.1.0/src/publiplots/fonts/Arial_Black.ttf +0 -0
- publiplots-0.1.0/src/publiplots/fonts/Arial_Bold.ttf +0 -0
- publiplots-0.1.0/src/publiplots/fonts/Arial_Bold_Italic.ttf +0 -0
- publiplots-0.1.0/src/publiplots/fonts/Arial_Italic.ttf +0 -0
- publiplots-0.1.0/src/publiplots/themes/__init__.py +84 -0
- publiplots-0.1.0/src/publiplots/themes/colors.py +496 -0
- publiplots-0.1.0/src/publiplots/themes/hatches.py +490 -0
- publiplots-0.1.0/src/publiplots/themes/markers.py +255 -0
- publiplots-0.1.0/src/publiplots/themes/styles.py +331 -0
- publiplots-0.1.0/src/publiplots/utils/__init__.py +99 -0
- publiplots-0.1.0/src/publiplots/utils/axes.py +453 -0
- publiplots-0.1.0/src/publiplots/utils/fonts.py +50 -0
- publiplots-0.1.0/src/publiplots/utils/io.py +213 -0
- publiplots-0.1.0/src/publiplots/utils/legend.py +582 -0
- publiplots-0.1.0/src/publiplots/utils/validation.py +465 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [0.1.0] - 2025-01-XX
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- Initial release
|
|
13
|
+
- Base plotting functions:
|
|
14
|
+
- `barplot()` - Bar plots with error bars and grouping
|
|
15
|
+
- `scatterplot()` - Scatter plots with flexible styling
|
|
16
|
+
- Advanced plotting functions:
|
|
17
|
+
- `venn()` - 2-way and 3-way Venn diagrams
|
|
18
|
+
- Theme system:
|
|
19
|
+
- Pastel color palettes optimized for publications
|
|
20
|
+
- Publication, minimal, and poster style presets
|
|
21
|
+
- Customizable marker and hatch patterns
|
|
22
|
+
- Utilities:
|
|
23
|
+
- Legend builders with custom handlers
|
|
24
|
+
- File I/O with `savefig()`
|
|
25
|
+
- Axes manipulation utilities
|
|
26
|
+
- Comprehensive documentation and examples
|
|
27
|
+
|
|
28
|
+
[0.1.0]: https://github.com/jorgebotas/publiplots/releases/tag/v0.1.0
|
publiplots-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jorge Botas
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: publiplots
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Publication-ready plotting with a clean, modular API
|
|
5
|
+
Project-URL: Homepage, https://github.com/jorgebotas/publiplots
|
|
6
|
+
Project-URL: Documentation, https://github.com/jorgebotas/publiplots
|
|
7
|
+
Project-URL: Repository, https://github.com/jorgebotas/publiplots
|
|
8
|
+
Project-URL: Issues, https://github.com/jorgebotas/publiplots/issues
|
|
9
|
+
Author-email: Jorge Botas <jorgebotas.github@gmail.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: matplotlib,plotting,publication,seaborn,visualization
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Requires-Dist: matplotlib-venn>=0.11.0
|
|
24
|
+
Requires-Dist: matplotlib>=3.5.0
|
|
25
|
+
Requires-Dist: numpy>=1.21.0
|
|
26
|
+
Requires-Dist: pandas>=1.3.0
|
|
27
|
+
Requires-Dist: scipy>=1.7.0
|
|
28
|
+
Requires-Dist: seaborn>=0.12.0
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: black>=23.0.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# PubliPlots
|
|
38
|
+
|
|
39
|
+
Publication-ready plots
|
|
40
|
+
|
|
41
|
+
## Overview
|
|
42
|
+
|
|
43
|
+
PubliPlots is a Python visualization library that provides beautiful, publication-ready plots with a seaborn-like API. It focuses on:
|
|
44
|
+
|
|
45
|
+
- **Beautiful defaults**: Carefully designed pastel color palettes and styles
|
|
46
|
+
- **Intuitive API**: Follows seaborn conventions for ease of use
|
|
47
|
+
- **Modular design**: Compose complex visualizations from simple building blocks
|
|
48
|
+
- **Highly configurable**: Extensive customization while maintaining sensible defaults
|
|
49
|
+
- **Publication-ready**: Optimized for scientific publications and presentations
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
### From source (development)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
git clone https://github.com/jorgebotas/publiplots.git
|
|
57
|
+
cd publiplots
|
|
58
|
+
pip install -e .
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Development with uv and Jupyter
|
|
62
|
+
|
|
63
|
+
If you're using [uv](https://github.com/astral-sh/uv) for Python environment management and want to use the package in Jupyter notebooks:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Clone the repository
|
|
67
|
+
git clone https://github.com/jorgebotas/publiplots.git
|
|
68
|
+
cd publiplots
|
|
69
|
+
|
|
70
|
+
# Create a new uv environment with Python 3.11 (or your preferred version)
|
|
71
|
+
uv venv --python 3.11
|
|
72
|
+
|
|
73
|
+
# Activate the environment
|
|
74
|
+
source .venv/bin/activate # On Linux/macOS
|
|
75
|
+
# or
|
|
76
|
+
.venv\Scripts\activate # On Windows
|
|
77
|
+
|
|
78
|
+
# Install the package in editable mode with all dependencies
|
|
79
|
+
uv pip install -e .
|
|
80
|
+
|
|
81
|
+
# Install ipykernel to make the environment available in Jupyter
|
|
82
|
+
uv pip install ipykernel
|
|
83
|
+
|
|
84
|
+
# Register the environment as a Jupyter kernel
|
|
85
|
+
python -m ipykernel install --user --name=publiplots --display-name="Python (publiplots)"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Now you can select the "Python (publiplots)" kernel in Jupyter Lab or Jupyter Notebook and import publiplots:
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
import publiplots as pp
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### From PyPI (coming soon)
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip install publiplots
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Quick Start
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
import publiplots as pp
|
|
104
|
+
import pandas as pd
|
|
105
|
+
|
|
106
|
+
# Apply publication style globally
|
|
107
|
+
pp.set_publication_style()
|
|
108
|
+
|
|
109
|
+
# Create a scatter plot
|
|
110
|
+
fig, ax = pp.scatterplot(
|
|
111
|
+
data=df,
|
|
112
|
+
x='measurement_a',
|
|
113
|
+
y='measurement_b',
|
|
114
|
+
hue='condition',
|
|
115
|
+
palette=pp.get_palette('pastel_categorical', n_colors=3)
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
# Save with publication-ready settings
|
|
119
|
+
pp.savefig(fig, 'figure.pdf')
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Features
|
|
123
|
+
|
|
124
|
+
### Base Plotting Functions
|
|
125
|
+
|
|
126
|
+
- `scatterplot()` - Scatter plots with flexible styling
|
|
127
|
+
- `barplot()` - Bar plots with error bars and grouping
|
|
128
|
+
|
|
129
|
+
### Advanced Functions
|
|
130
|
+
|
|
131
|
+
- `venn()` - 2-way and 3-way Venn diagrams
|
|
132
|
+
|
|
133
|
+
### Theming
|
|
134
|
+
|
|
135
|
+
- Pastel color palettes optimized for publications
|
|
136
|
+
- Customizable matplotlib styles
|
|
137
|
+
- Consistent styling across all plots
|
|
138
|
+
|
|
139
|
+
## Documentation
|
|
140
|
+
|
|
141
|
+
Full documentation is available at [github.com/jorgebotas/publiplots](https://github.com/jorgebotas/publiplots)
|
|
142
|
+
|
|
143
|
+
## Development Status
|
|
144
|
+
|
|
145
|
+
PubliPlots is currently in active development (v0.1.0). The API may change in future releases.
|
|
146
|
+
|
|
147
|
+
## Contributing
|
|
148
|
+
|
|
149
|
+
Contributions are welcome! Please feel free to submit issues or pull requests.
|
|
150
|
+
|
|
151
|
+
## Citation
|
|
152
|
+
|
|
153
|
+
If you use PubliPlots in your research, please cite:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
Botas, J. (2025). PubliPlots: Publication-ready plotting for Python.
|
|
157
|
+
GitHub: https://github.com/jorgebotas/publiplots
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## License
|
|
161
|
+
|
|
162
|
+
MIT License - see LICENSE file for details.
|
|
163
|
+
|
|
164
|
+
## Author
|
|
165
|
+
|
|
166
|
+
Jorge Botas ([@jorgebotas](https://github.com/jorgebotas))
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# PubliPlots
|
|
2
|
+
|
|
3
|
+
Publication-ready plots
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
PubliPlots is a Python visualization library that provides beautiful, publication-ready plots with a seaborn-like API. It focuses on:
|
|
8
|
+
|
|
9
|
+
- **Beautiful defaults**: Carefully designed pastel color palettes and styles
|
|
10
|
+
- **Intuitive API**: Follows seaborn conventions for ease of use
|
|
11
|
+
- **Modular design**: Compose complex visualizations from simple building blocks
|
|
12
|
+
- **Highly configurable**: Extensive customization while maintaining sensible defaults
|
|
13
|
+
- **Publication-ready**: Optimized for scientific publications and presentations
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
### From source (development)
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
git clone https://github.com/jorgebotas/publiplots.git
|
|
21
|
+
cd publiplots
|
|
22
|
+
pip install -e .
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Development with uv and Jupyter
|
|
26
|
+
|
|
27
|
+
If you're using [uv](https://github.com/astral-sh/uv) for Python environment management and want to use the package in Jupyter notebooks:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Clone the repository
|
|
31
|
+
git clone https://github.com/jorgebotas/publiplots.git
|
|
32
|
+
cd publiplots
|
|
33
|
+
|
|
34
|
+
# Create a new uv environment with Python 3.11 (or your preferred version)
|
|
35
|
+
uv venv --python 3.11
|
|
36
|
+
|
|
37
|
+
# Activate the environment
|
|
38
|
+
source .venv/bin/activate # On Linux/macOS
|
|
39
|
+
# or
|
|
40
|
+
.venv\Scripts\activate # On Windows
|
|
41
|
+
|
|
42
|
+
# Install the package in editable mode with all dependencies
|
|
43
|
+
uv pip install -e .
|
|
44
|
+
|
|
45
|
+
# Install ipykernel to make the environment available in Jupyter
|
|
46
|
+
uv pip install ipykernel
|
|
47
|
+
|
|
48
|
+
# Register the environment as a Jupyter kernel
|
|
49
|
+
python -m ipykernel install --user --name=publiplots --display-name="Python (publiplots)"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Now you can select the "Python (publiplots)" kernel in Jupyter Lab or Jupyter Notebook and import publiplots:
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
import publiplots as pp
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### From PyPI (coming soon)
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install publiplots
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Quick Start
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
import publiplots as pp
|
|
68
|
+
import pandas as pd
|
|
69
|
+
|
|
70
|
+
# Apply publication style globally
|
|
71
|
+
pp.set_publication_style()
|
|
72
|
+
|
|
73
|
+
# Create a scatter plot
|
|
74
|
+
fig, ax = pp.scatterplot(
|
|
75
|
+
data=df,
|
|
76
|
+
x='measurement_a',
|
|
77
|
+
y='measurement_b',
|
|
78
|
+
hue='condition',
|
|
79
|
+
palette=pp.get_palette('pastel_categorical', n_colors=3)
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
# Save with publication-ready settings
|
|
83
|
+
pp.savefig(fig, 'figure.pdf')
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Features
|
|
87
|
+
|
|
88
|
+
### Base Plotting Functions
|
|
89
|
+
|
|
90
|
+
- `scatterplot()` - Scatter plots with flexible styling
|
|
91
|
+
- `barplot()` - Bar plots with error bars and grouping
|
|
92
|
+
|
|
93
|
+
### Advanced Functions
|
|
94
|
+
|
|
95
|
+
- `venn()` - 2-way and 3-way Venn diagrams
|
|
96
|
+
|
|
97
|
+
### Theming
|
|
98
|
+
|
|
99
|
+
- Pastel color palettes optimized for publications
|
|
100
|
+
- Customizable matplotlib styles
|
|
101
|
+
- Consistent styling across all plots
|
|
102
|
+
|
|
103
|
+
## Documentation
|
|
104
|
+
|
|
105
|
+
Full documentation is available at [github.com/jorgebotas/publiplots](https://github.com/jorgebotas/publiplots)
|
|
106
|
+
|
|
107
|
+
## Development Status
|
|
108
|
+
|
|
109
|
+
PubliPlots is currently in active development (v0.1.0). The API may change in future releases.
|
|
110
|
+
|
|
111
|
+
## Contributing
|
|
112
|
+
|
|
113
|
+
Contributions are welcome! Please feel free to submit issues or pull requests.
|
|
114
|
+
|
|
115
|
+
## Citation
|
|
116
|
+
|
|
117
|
+
If you use PubliPlots in your research, please cite:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
Botas, J. (2025). PubliPlots: Publication-ready plotting for Python.
|
|
121
|
+
GitHub: https://github.com/jorgebotas/publiplots
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
MIT License - see LICENSE file for details.
|
|
127
|
+
|
|
128
|
+
## Author
|
|
129
|
+
|
|
130
|
+
Jorge Botas ([@jorgebotas](https://github.com/jorgebotas))
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "publiplots"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Publication-ready plotting with a clean, modular API"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Jorge Botas", email = "jorgebotas.github@gmail.com"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["plotting", "visualization", "matplotlib", "seaborn", "publication"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Science/Research",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.9",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Topic :: Scientific/Engineering :: Visualization",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
dependencies = [
|
|
29
|
+
"matplotlib>=3.5.0",
|
|
30
|
+
"seaborn>=0.12.0",
|
|
31
|
+
"numpy>=1.21.0",
|
|
32
|
+
"pandas>=1.3.0",
|
|
33
|
+
"scipy>=1.7.0",
|
|
34
|
+
"matplotlib-venn>=0.11.0",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[project.optional-dependencies]
|
|
38
|
+
dev = [
|
|
39
|
+
"pytest>=7.0.0",
|
|
40
|
+
"pytest-cov>=4.0.0",
|
|
41
|
+
"black>=23.0.0",
|
|
42
|
+
"mypy>=1.0.0",
|
|
43
|
+
"ruff>=0.1.0",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[project.urls]
|
|
47
|
+
Homepage = "https://github.com/jorgebotas/publiplots"
|
|
48
|
+
Documentation = "https://github.com/jorgebotas/publiplots"
|
|
49
|
+
Repository = "https://github.com/jorgebotas/publiplots"
|
|
50
|
+
Issues = "https://github.com/jorgebotas/publiplots/issues"
|
|
51
|
+
|
|
52
|
+
[tool.hatch.build.targets.wheel]
|
|
53
|
+
packages = ["src/publiplots"]
|
|
54
|
+
|
|
55
|
+
[tool.hatch.build.targets.sdist]
|
|
56
|
+
include = [
|
|
57
|
+
"src/",
|
|
58
|
+
"README.md",
|
|
59
|
+
"LICENSE",
|
|
60
|
+
"CHANGELOG.md",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
[tool.pytest.ini_options]
|
|
64
|
+
testpaths = ["tests"]
|
|
65
|
+
python_files = ["test_*.py"]
|
|
66
|
+
python_classes = ["Test*"]
|
|
67
|
+
python_functions = ["test_*"]
|
|
68
|
+
addopts = "--cov=publiplots --cov-report=html --cov-report=term-missing"
|
|
69
|
+
|
|
70
|
+
[tool.black]
|
|
71
|
+
line-length = 88
|
|
72
|
+
target-version = ["py39"]
|
|
73
|
+
include = '\.pyi?$'
|
|
74
|
+
|
|
75
|
+
[tool.ruff]
|
|
76
|
+
line-length = 88
|
|
77
|
+
target-version = "py39"
|
|
78
|
+
select = ["E", "F", "I", "N", "W"]
|
|
79
|
+
|
|
80
|
+
[tool.mypy]
|
|
81
|
+
python_version = "3.9"
|
|
82
|
+
warn_return_any = true
|
|
83
|
+
warn_unused_configs = true
|
|
84
|
+
disallow_untyped_defs = false
|