plot-misc 2.0.2__tar.gz → 2.0.4__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.
- plot_misc-2.0.4/MANIFEST.in +16 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/PKG-INFO +52 -28
- plot_misc-2.0.4/README.md +94 -0
- plot_misc-2.0.4/plot_misc/_version.py +1 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/barchart.py +22 -14
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/volcano.py +9 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc.egg-info/PKG-INFO +52 -28
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc.egg-info/SOURCES.txt +3 -0
- plot_misc-2.0.4/plot_misc.egg-info/requires.txt +19 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/pyproject.toml +9 -13
- plot_misc-2.0.4/requirements-dev.txt +9 -0
- plot_misc-2.0.4/requirements.txt +9 -0
- plot_misc-2.0.2/README.md +0 -79
- plot_misc-2.0.2/plot_misc/_version.py +0 -1
- plot_misc-2.0.2/plot_misc.egg-info/requires.txt +0 -11
- {plot_misc-2.0.2 → plot_misc-2.0.4}/LICENSE +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/__init__.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/constants.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/errors.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/__init__.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/bar_points.tsv.gz +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/barchart.tsv.gz +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/calibration_bins.tsv.gz +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/calibration_data.tsv.gz +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/forest_data.tsv.gz +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/group_bar.tsv.gz +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/heatmap_data.tsv.gz +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/incidence_matrix_data.tsv.gz +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/lollipop_data.tsv.gz +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/mace_associations.tsv.gz +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/net_benefit.tsv.gz +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/string_data.txt +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/volcano.tsv.gz +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/examples.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/forest.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/heatmap.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/incidencematrix.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/machine_learning.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/piechart.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/utils/__init__.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/utils/colour.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/utils/formatting.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/utils/utils.py +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc.egg-info/dependency_links.txt +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc.egg-info/top_level.txt +0 -0
- {plot_misc-2.0.2 → plot_misc-2.0.4}/setup.cfg +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# include top-level metadata
|
|
2
|
+
include README.md LICENSE
|
|
3
|
+
include requirements.txt
|
|
4
|
+
include requirements-dev.txt
|
|
5
|
+
|
|
6
|
+
# ship the example datasets explicitly
|
|
7
|
+
recursive-include plot_misc/example_data/example_datasets *.tsv.gz *.txt
|
|
8
|
+
|
|
9
|
+
# drop these
|
|
10
|
+
prune tests
|
|
11
|
+
prune resources
|
|
12
|
+
|
|
13
|
+
# drop the rest
|
|
14
|
+
global-exclude .*
|
|
15
|
+
global-exclude *.py[cod]
|
|
16
|
+
global-exclude __pycache__/*
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plot-misc
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.4
|
|
4
4
|
Summary: Various plotting templates built on top of matplotlib
|
|
5
5
|
Author-email: A Floriaan Schmidt <floriaanschmidt@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0-or-later
|
|
7
7
|
Project-URL: Homepage, https://gitlab.com/SchmidtAF/plot-misc
|
|
8
|
+
Project-URL: Documentation, https://schmidtaf.gitlab.io/plot-misc/
|
|
8
9
|
Classifier: Programming Language :: Python
|
|
9
10
|
Classifier: Programming Language :: Python :: 3
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -14,46 +15,68 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
|
14
15
|
Requires-Python: <3.13,>=3.10
|
|
15
16
|
Description-Content-Type: text/markdown
|
|
16
17
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist:
|
|
18
|
-
Requires-Dist:
|
|
19
|
-
Requires-Dist: matplotlib
|
|
20
|
-
Requires-Dist: seaborn
|
|
21
|
-
Requires-Dist: scipy
|
|
22
|
-
Requires-Dist:
|
|
23
|
-
Requires-Dist:
|
|
18
|
+
Requires-Dist: pandas>=1.3
|
|
19
|
+
Requires-Dist: numpy>=1.21
|
|
20
|
+
Requires-Dist: matplotlib>=3.5
|
|
21
|
+
Requires-Dist: seaborn>=0.11
|
|
22
|
+
Requires-Dist: scipy>=1.5
|
|
23
|
+
Requires-Dist: statsmodels>=0.1
|
|
24
|
+
Requires-Dist: scikit-learn>=1.4
|
|
25
|
+
Requires-Dist: adjustText>=1.3
|
|
24
26
|
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: python-build; extra == "dev"
|
|
25
28
|
Requires-Dist: twine; extra == "dev"
|
|
26
|
-
Requires-Dist:
|
|
29
|
+
Requires-Dist: setuptools; extra == "dev"
|
|
30
|
+
Requires-Dist: wheel; extra == "dev"
|
|
31
|
+
Requires-Dist: pytest>=6; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest-mock>=3; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest-dependency>=0.5; extra == "dev"
|
|
34
|
+
Requires-Dist: bump2version>=1; extra == "dev"
|
|
35
|
+
Requires-Dist: jupyter; extra == "dev"
|
|
27
36
|
Dynamic: license-file
|
|
28
37
|
|
|
29
38
|
# A collection of plotting functions
|
|
30
|
-
__version__: `2.0.
|
|
39
|
+
__version__: `2.0.4`
|
|
31
40
|
|
|
41
|
+
This repository collects plotting modules written on top of `matplotlib`.
|
|
42
|
+
The functions are intended to set up light-touch, basic illustrations that
|
|
43
|
+
can be customised using the standard matplotlib interface via axes and figures.
|
|
44
|
+
Functionality is included to create illustrations commonly used in medical research,
|
|
45
|
+
covering forest plots, volcano plots, incidence matrices/bubble charts,
|
|
46
|
+
illustrations to evaluate prediction models (e.g. feature importance, net benefit, calibration plots),
|
|
47
|
+
and more.
|
|
32
48
|
|
|
33
|
-
|
|
34
|
-
`seaborn`.
|
|
35
|
-
The functions are intended to set-up a light-touch basic illustration which
|
|
36
|
-
can be customised using the normal matplotlib interface using axes and figures.
|
|
49
|
+
The documentation for plot-misc can be found [here](https://SchmidtAF.gitlab.io/plot-misc/).
|
|
37
50
|
|
|
51
|
+
## Installation
|
|
52
|
+
The package is available on PyPI, and conda, with the latest source code
|
|
53
|
+
available on gitlab.
|
|
38
54
|
|
|
39
|
-
|
|
55
|
+
### Installation using PyPI
|
|
40
56
|
|
|
57
|
+
To install the package from PyPI, run:
|
|
41
58
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
59
|
+
```sh
|
|
60
|
+
pip install plot-misc
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
This installs the latest stable release along with its dependencies.
|
|
45
64
|
|
|
46
65
|
### Installation using conda
|
|
47
|
-
I maintain a conda package in my personal conda channel. To install from this please run:
|
|
48
66
|
|
|
49
|
-
|
|
67
|
+
A Conda package is maintained in my personal Conda channel.
|
|
68
|
+
To install from this channel, run:
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
```sh
|
|
50
72
|
conda install afschmidt::plot_misc
|
|
51
73
|
```
|
|
52
74
|
|
|
53
|
-
### Installation using
|
|
75
|
+
### Installation using gitlab
|
|
76
|
+
|
|
77
|
+
If you require the latest updates, potentially not yet formally released, you can install the package directly from GitLab.
|
|
54
78
|
|
|
55
|
-
|
|
56
|
-
first clone and cd into the repository root:
|
|
79
|
+
First, clone the repository and move into its root directory:
|
|
57
80
|
|
|
58
81
|
```sh
|
|
59
82
|
git clone git@gitlab.com:SchmidtAF/plot-misc.git
|
|
@@ -80,8 +103,8 @@ Next the package can be installed:
|
|
|
80
103
|
python -m pip install .
|
|
81
104
|
```
|
|
82
105
|
|
|
83
|
-
Or for an editable (developer) install run the command below from the
|
|
84
|
-
the repository.
|
|
106
|
+
Or for an editable (developer) install run the command below from the
|
|
107
|
+
root of the repository.
|
|
85
108
|
The difference with this is that you can just run `git pull` to
|
|
86
109
|
update repository, or switch branches without re-installing:
|
|
87
110
|
|
|
@@ -90,9 +113,10 @@ python -m pip install -e .
|
|
|
90
113
|
|
|
91
114
|
```
|
|
92
115
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
116
|
+
#### Validating the package
|
|
117
|
+
|
|
118
|
+
After installing the package from GitLab, you may wish to run the test
|
|
119
|
+
suite to confirm everything is working as expected:
|
|
96
120
|
|
|
97
121
|
```sh
|
|
98
122
|
# From the root of the repository
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# A collection of plotting functions
|
|
2
|
+
__version__: `2.0.4`
|
|
3
|
+
|
|
4
|
+
This repository collects plotting modules written on top of `matplotlib`.
|
|
5
|
+
The functions are intended to set up light-touch, basic illustrations that
|
|
6
|
+
can be customised using the standard matplotlib interface via axes and figures.
|
|
7
|
+
Functionality is included to create illustrations commonly used in medical research,
|
|
8
|
+
covering forest plots, volcano plots, incidence matrices/bubble charts,
|
|
9
|
+
illustrations to evaluate prediction models (e.g. feature importance, net benefit, calibration plots),
|
|
10
|
+
and more.
|
|
11
|
+
|
|
12
|
+
The documentation for plot-misc can be found [here](https://SchmidtAF.gitlab.io/plot-misc/).
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
The package is available on PyPI, and conda, with the latest source code
|
|
16
|
+
available on gitlab.
|
|
17
|
+
|
|
18
|
+
### Installation using PyPI
|
|
19
|
+
|
|
20
|
+
To install the package from PyPI, run:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
pip install plot-misc
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This installs the latest stable release along with its dependencies.
|
|
27
|
+
|
|
28
|
+
### Installation using conda
|
|
29
|
+
|
|
30
|
+
A Conda package is maintained in my personal Conda channel.
|
|
31
|
+
To install from this channel, run:
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
conda install afschmidt::plot_misc
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Installation using gitlab
|
|
39
|
+
|
|
40
|
+
If you require the latest updates, potentially not yet formally released, you can install the package directly from GitLab.
|
|
41
|
+
|
|
42
|
+
First, clone the repository and move into its root directory:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
git clone git@gitlab.com:SchmidtAF/plot-misc.git
|
|
46
|
+
cd plot-misc
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Install the dependencies:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
# From the root of the repository
|
|
53
|
+
conda env create --file ./resources/conda/envs/conda_create.yaml
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
To add to an existing environment use:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
# From the root of the repository
|
|
60
|
+
conda env update --file ./resources/conda/envs/conda_update.yaml
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Next the package can be installed:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
python -m pip install .
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Or for an editable (developer) install run the command below from the
|
|
70
|
+
root of the repository.
|
|
71
|
+
The difference with this is that you can just run `git pull` to
|
|
72
|
+
update repository, or switch branches without re-installing:
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
python -m pip install -e .
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### Validating the package
|
|
80
|
+
|
|
81
|
+
After installing the package from GitLab, you may wish to run the test
|
|
82
|
+
suite to confirm everything is working as expected:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
# From the root of the repository
|
|
86
|
+
pytest tests
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Usage
|
|
90
|
+
|
|
91
|
+
Please have a look at the examples in
|
|
92
|
+
[resources](https://gitlab.com/SchmidtAF/plot-misc/-/tree/master/resources/examples)
|
|
93
|
+
for some possible recipes.
|
|
94
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.0.4'
|
|
@@ -83,6 +83,14 @@ def bar(data:pd.DataFrame, label:str, column:str,
|
|
|
83
83
|
Matplotlib figure object.
|
|
84
84
|
ax : plt.Axes
|
|
85
85
|
Matplotlib axes with the rendered bar plot.
|
|
86
|
+
|
|
87
|
+
Notes
|
|
88
|
+
-----
|
|
89
|
+
This function is essentially a helper function for the more complicated
|
|
90
|
+
bar charts in this module and simply wraps matplotlib's bar function.
|
|
91
|
+
It is included as a public function to allow people to use the same
|
|
92
|
+
interface when working with plot-misc. If one is exclusively looking to
|
|
93
|
+
use `bar` it is advisable to simply revert to matplotlib's offering.
|
|
86
94
|
"""
|
|
87
95
|
# check input
|
|
88
96
|
is_df(data)
|
|
@@ -235,30 +243,30 @@ def stack_bar(data:pd.DataFrame, label:str, columns:list[str],
|
|
|
235
243
|
'number of colours ({1}).'.format(
|
|
236
244
|
len(columns), len(colours)))
|
|
237
245
|
# get labels
|
|
238
|
-
labels = data[label]
|
|
246
|
+
# labels = data[label]
|
|
239
247
|
# get columns
|
|
240
248
|
fields=columns
|
|
241
249
|
# actual plotting
|
|
242
250
|
left = len(data) * [0]
|
|
243
251
|
for idx, name in enumerate(fields):
|
|
252
|
+
new_kwargs = _update_kwargs(update_dict=kwargs,
|
|
253
|
+
edgecolor=edgecolour,
|
|
254
|
+
color=colours[idx],
|
|
255
|
+
alpha=transparency,
|
|
256
|
+
)
|
|
244
257
|
if horizontal == False:
|
|
245
|
-
|
|
246
|
-
new_kwargs = _update_kwargs(update_dict=kwargs,
|
|
247
|
-
edgecolor=edgecolour,
|
|
248
|
-
width=wd, color=colours[idx],
|
|
249
|
-
alpha=transparency,
|
|
258
|
+
new_kwargs = _update_kwargs(new_kwargs, bottom=left,
|
|
250
259
|
)
|
|
251
|
-
ax.bar(labels, height=data[name], bottom=left, **new_kwargs,
|
|
252
|
-
)
|
|
253
260
|
else:
|
|
254
|
-
|
|
255
|
-
new_kwargs = _update_kwargs(update_dict=kwargs, edgecolor=edgecolour,
|
|
256
|
-
height=wd, color=colours[idx],
|
|
257
|
-
alpha=transparency,
|
|
261
|
+
new_kwargs = _update_kwargs(new_kwargs, left=left,
|
|
258
262
|
)
|
|
259
|
-
|
|
263
|
+
# The actual plotting
|
|
264
|
+
# NOTE adding wd here because it bar assigns it to either width or
|
|
265
|
+
# height depending on horizontal.
|
|
266
|
+
_, ax = bar(data=data, label=label, column=name, horizontal=horizontal,
|
|
267
|
+
wd=wd, ax=ax, kwargs_bar=new_kwargs,
|
|
260
268
|
)
|
|
261
|
-
#
|
|
269
|
+
# updating the coordinate where the last bar stops
|
|
262
270
|
left = left + data[name]
|
|
263
271
|
# removing spines
|
|
264
272
|
ax.spines['right'].set_visible(False)
|
|
@@ -113,6 +113,15 @@ def plot_volcano(data:DataFrame, y_column:str, x_column:str,
|
|
|
113
113
|
The created figure (if `ax` was not provided).
|
|
114
114
|
ax : `matplotlib.axes.Axes`
|
|
115
115
|
The matplotlib axis containing the plot.
|
|
116
|
+
|
|
117
|
+
Notes
|
|
118
|
+
-----
|
|
119
|
+
When `adjust=True`, text labels are repositioned using the `adjustText`
|
|
120
|
+
package to reduce overlaps. This is particularly helpful when multiple
|
|
121
|
+
points are labelled in a crowded region. Additional options can be passed
|
|
122
|
+
to `adjustText` via `label_kwargs_dict`.
|
|
123
|
+
|
|
124
|
+
Please see the module documentation `here <https://pypi.org/project/adjustText/>`_.
|
|
116
125
|
"""
|
|
117
126
|
FT_FAM = 'font.family'
|
|
118
127
|
# ###### Check input
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plot-misc
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.4
|
|
4
4
|
Summary: Various plotting templates built on top of matplotlib
|
|
5
5
|
Author-email: A Floriaan Schmidt <floriaanschmidt@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0-or-later
|
|
7
7
|
Project-URL: Homepage, https://gitlab.com/SchmidtAF/plot-misc
|
|
8
|
+
Project-URL: Documentation, https://schmidtaf.gitlab.io/plot-misc/
|
|
8
9
|
Classifier: Programming Language :: Python
|
|
9
10
|
Classifier: Programming Language :: Python :: 3
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -14,46 +15,68 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
|
14
15
|
Requires-Python: <3.13,>=3.10
|
|
15
16
|
Description-Content-Type: text/markdown
|
|
16
17
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist:
|
|
18
|
-
Requires-Dist:
|
|
19
|
-
Requires-Dist: matplotlib
|
|
20
|
-
Requires-Dist: seaborn
|
|
21
|
-
Requires-Dist: scipy
|
|
22
|
-
Requires-Dist:
|
|
23
|
-
Requires-Dist:
|
|
18
|
+
Requires-Dist: pandas>=1.3
|
|
19
|
+
Requires-Dist: numpy>=1.21
|
|
20
|
+
Requires-Dist: matplotlib>=3.5
|
|
21
|
+
Requires-Dist: seaborn>=0.11
|
|
22
|
+
Requires-Dist: scipy>=1.5
|
|
23
|
+
Requires-Dist: statsmodels>=0.1
|
|
24
|
+
Requires-Dist: scikit-learn>=1.4
|
|
25
|
+
Requires-Dist: adjustText>=1.3
|
|
24
26
|
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: python-build; extra == "dev"
|
|
25
28
|
Requires-Dist: twine; extra == "dev"
|
|
26
|
-
Requires-Dist:
|
|
29
|
+
Requires-Dist: setuptools; extra == "dev"
|
|
30
|
+
Requires-Dist: wheel; extra == "dev"
|
|
31
|
+
Requires-Dist: pytest>=6; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest-mock>=3; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest-dependency>=0.5; extra == "dev"
|
|
34
|
+
Requires-Dist: bump2version>=1; extra == "dev"
|
|
35
|
+
Requires-Dist: jupyter; extra == "dev"
|
|
27
36
|
Dynamic: license-file
|
|
28
37
|
|
|
29
38
|
# A collection of plotting functions
|
|
30
|
-
__version__: `2.0.
|
|
39
|
+
__version__: `2.0.4`
|
|
31
40
|
|
|
41
|
+
This repository collects plotting modules written on top of `matplotlib`.
|
|
42
|
+
The functions are intended to set up light-touch, basic illustrations that
|
|
43
|
+
can be customised using the standard matplotlib interface via axes and figures.
|
|
44
|
+
Functionality is included to create illustrations commonly used in medical research,
|
|
45
|
+
covering forest plots, volcano plots, incidence matrices/bubble charts,
|
|
46
|
+
illustrations to evaluate prediction models (e.g. feature importance, net benefit, calibration plots),
|
|
47
|
+
and more.
|
|
32
48
|
|
|
33
|
-
|
|
34
|
-
`seaborn`.
|
|
35
|
-
The functions are intended to set-up a light-touch basic illustration which
|
|
36
|
-
can be customised using the normal matplotlib interface using axes and figures.
|
|
49
|
+
The documentation for plot-misc can be found [here](https://SchmidtAF.gitlab.io/plot-misc/).
|
|
37
50
|
|
|
51
|
+
## Installation
|
|
52
|
+
The package is available on PyPI, and conda, with the latest source code
|
|
53
|
+
available on gitlab.
|
|
38
54
|
|
|
39
|
-
|
|
55
|
+
### Installation using PyPI
|
|
40
56
|
|
|
57
|
+
To install the package from PyPI, run:
|
|
41
58
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
59
|
+
```sh
|
|
60
|
+
pip install plot-misc
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
This installs the latest stable release along with its dependencies.
|
|
45
64
|
|
|
46
65
|
### Installation using conda
|
|
47
|
-
I maintain a conda package in my personal conda channel. To install from this please run:
|
|
48
66
|
|
|
49
|
-
|
|
67
|
+
A Conda package is maintained in my personal Conda channel.
|
|
68
|
+
To install from this channel, run:
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
```sh
|
|
50
72
|
conda install afschmidt::plot_misc
|
|
51
73
|
```
|
|
52
74
|
|
|
53
|
-
### Installation using
|
|
75
|
+
### Installation using gitlab
|
|
76
|
+
|
|
77
|
+
If you require the latest updates, potentially not yet formally released, you can install the package directly from GitLab.
|
|
54
78
|
|
|
55
|
-
|
|
56
|
-
first clone and cd into the repository root:
|
|
79
|
+
First, clone the repository and move into its root directory:
|
|
57
80
|
|
|
58
81
|
```sh
|
|
59
82
|
git clone git@gitlab.com:SchmidtAF/plot-misc.git
|
|
@@ -80,8 +103,8 @@ Next the package can be installed:
|
|
|
80
103
|
python -m pip install .
|
|
81
104
|
```
|
|
82
105
|
|
|
83
|
-
Or for an editable (developer) install run the command below from the
|
|
84
|
-
the repository.
|
|
106
|
+
Or for an editable (developer) install run the command below from the
|
|
107
|
+
root of the repository.
|
|
85
108
|
The difference with this is that you can just run `git pull` to
|
|
86
109
|
update repository, or switch branches without re-installing:
|
|
87
110
|
|
|
@@ -90,9 +113,10 @@ python -m pip install -e .
|
|
|
90
113
|
|
|
91
114
|
```
|
|
92
115
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
116
|
+
#### Validating the package
|
|
117
|
+
|
|
118
|
+
After installing the package from GitLab, you may wish to run the test
|
|
119
|
+
suite to confirm everything is working as expected:
|
|
96
120
|
|
|
97
121
|
```sh
|
|
98
122
|
# From the root of the repository
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
pandas>=1.3
|
|
2
|
+
numpy>=1.21
|
|
3
|
+
matplotlib>=3.5
|
|
4
|
+
seaborn>=0.11
|
|
5
|
+
scipy>=1.5
|
|
6
|
+
statsmodels>=0.1
|
|
7
|
+
scikit-learn>=1.4
|
|
8
|
+
adjustText>=1.3
|
|
9
|
+
|
|
10
|
+
[dev]
|
|
11
|
+
python-build
|
|
12
|
+
twine
|
|
13
|
+
setuptools
|
|
14
|
+
wheel
|
|
15
|
+
pytest>=6
|
|
16
|
+
pytest-mock>=3
|
|
17
|
+
pytest-dependency>=0.5
|
|
18
|
+
bump2version>=1
|
|
19
|
+
jupyter
|
|
@@ -4,22 +4,14 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "plot-misc"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.4"
|
|
8
8
|
description = "Various plotting templates built on top of matplotlib"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "A Floriaan Schmidt", email = "floriaanschmidt@gmail.com" }]
|
|
11
11
|
license = "GPL-3.0-or-later"
|
|
12
12
|
license-files = ["LICENSE"]
|
|
13
13
|
requires-python = ">=3.10, <3.13"
|
|
14
|
-
|
|
15
|
-
"numpy",
|
|
16
|
-
"pandas",
|
|
17
|
-
"matplotlib",
|
|
18
|
-
"seaborn",
|
|
19
|
-
"scipy",
|
|
20
|
-
"scikit-learn",
|
|
21
|
-
"adjustText"
|
|
22
|
-
]
|
|
14
|
+
dynamic = ["dependencies", "optional-dependencies"]
|
|
23
15
|
classifiers = [
|
|
24
16
|
"Programming Language :: Python",
|
|
25
17
|
"Programming Language :: Python :: 3",
|
|
@@ -29,11 +21,15 @@ classifiers = [
|
|
|
29
21
|
"Programming Language :: Python :: Implementation :: PyPy"
|
|
30
22
|
]
|
|
31
23
|
|
|
32
|
-
[project.optional-dependencies]
|
|
33
|
-
dev = ["twine", "build"]
|
|
34
|
-
|
|
35
24
|
[project.urls]
|
|
36
25
|
Homepage = "https://gitlab.com/SchmidtAF/plot-misc"
|
|
26
|
+
Documentation = "https://schmidtaf.gitlab.io/plot-misc/"
|
|
27
|
+
|
|
28
|
+
[tool.setuptools.dynamic]
|
|
29
|
+
dependencies = { file = ["requirements.txt"] }
|
|
30
|
+
|
|
31
|
+
[tool.setuptools.dynamic.optional-dependencies]
|
|
32
|
+
dev = { file = ["requirements-dev.txt"] }
|
|
37
33
|
|
|
38
34
|
[tool.setuptools.packages.find]
|
|
39
35
|
include = ["plot_misc*"]
|
plot_misc-2.0.2/README.md
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# A collection of plotting functions
|
|
2
|
-
__version__: `2.0.2`
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This repository collects plotting modules written on top of `matplotlib` or
|
|
6
|
-
`seaborn`.
|
|
7
|
-
The functions are intended to set-up a light-touch basic illustration which
|
|
8
|
-
can be customised using the normal matplotlib interface using axes and figures.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
The documentation for plot-misc can be found [here](https://SchmidtAF.gitlab.io/plot-misc/).
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
At present, this package is undergoing development and no packages exist yet on PyPI.
|
|
16
|
-
Therefore it is recommended that you install in either of the two ways below.
|
|
17
|
-
|
|
18
|
-
### Installation using conda
|
|
19
|
-
I maintain a conda package in my personal conda channel. To install from this please run:
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
conda install afschmidt::plot_misc
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Installation using pip
|
|
26
|
-
|
|
27
|
-
You can install using pip from the root of the cloned repository,
|
|
28
|
-
first clone and cd into the repository root:
|
|
29
|
-
|
|
30
|
-
```sh
|
|
31
|
-
git clone git@gitlab.com:SchmidtAF/plot-misc.git
|
|
32
|
-
cd plot-misc
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Install the dependencies:
|
|
36
|
-
|
|
37
|
-
```sh
|
|
38
|
-
# From the root of the repository
|
|
39
|
-
conda env create --file ./resources/conda/envs/conda_create.yaml
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
To add to an existing environment use:
|
|
43
|
-
|
|
44
|
-
```sh
|
|
45
|
-
# From the root of the repository
|
|
46
|
-
conda env update --file ./resources/conda/envs/conda_update.yaml
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Next the package can be installed:
|
|
50
|
-
|
|
51
|
-
```sh
|
|
52
|
-
python -m pip install .
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Or for an editable (developer) install run the command below from the root of
|
|
56
|
-
the repository.
|
|
57
|
-
The difference with this is that you can just run `git pull` to
|
|
58
|
-
update repository, or switch branches without re-installing:
|
|
59
|
-
|
|
60
|
-
```sh
|
|
61
|
-
python -m pip install -e .
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Next steps...
|
|
66
|
-
After installation you might wish to try the `pytest` to confirm
|
|
67
|
-
everything is in working order.
|
|
68
|
-
|
|
69
|
-
```sh
|
|
70
|
-
# From the root of the repository
|
|
71
|
-
pytest tests
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Usage
|
|
75
|
-
|
|
76
|
-
Please have a look at the examples in
|
|
77
|
-
[resources](https://gitlab.com/SchmidtAF/plot-misc/-/tree/master/resources/examples)
|
|
78
|
-
for some possible recipes.
|
|
79
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '2.0.2'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/bar_points.tsv.gz
RENAMED
|
File without changes
|
|
File without changes
|
{plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/calibration_bins.tsv.gz
RENAMED
|
File without changes
|
{plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/calibration_data.tsv.gz
RENAMED
|
File without changes
|
{plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/forest_data.tsv.gz
RENAMED
|
File without changes
|
{plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/group_bar.tsv.gz
RENAMED
|
File without changes
|
{plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/heatmap_data.tsv.gz
RENAMED
|
File without changes
|
|
File without changes
|
{plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/lollipop_data.tsv.gz
RENAMED
|
File without changes
|
{plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/mace_associations.tsv.gz
RENAMED
|
File without changes
|
{plot_misc-2.0.2 → plot_misc-2.0.4}/plot_misc/example_data/example_datasets/net_benefit.tsv.gz
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|