VectoRose
VectoRose: A new package for analysing and visualising 3D non-unit vectors in Python - Published in JOSS (2025)
Science Score: 98.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 11 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org -
○Academic email domains
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Scientific Fields
Repository
Python package for producing spherical histograms
Basic Info
- Host: GitHub
- Owner: bzrudski
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://vectorose.readthedocs.io/
- Size: 76.7 MB
Statistics
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 14
Topics
Metadata Files
README.md
VectoRose

Spherical and polar histogram plotting for non-unit vectorial and axial data.
Overview
Many fields of science rely on oriented data. In these contexts, scalar values alone can't describe the quantities under consideration. The values of interest are vectors, consisting of a direction or orientation, in addition to an optional magnitude (length). Examples include wind velocities, trabecular bone co-alignment (anisotropy) and cardiac fibre orientations.
Traditional histograms and statistical tools can't be directly applied to analyse these data. To be able to visualise and quantitatively describe and analyse oriented datasets in 3D, we present VectoRose.
Features
VectoRose provides tools for visualising and quantitatively analysing data sets consisting of vectors and orientations of unit and non-unit length.
Using VectoRose, it is possible to:
- Construct spherical histograms of directions and orientations in 3D.
- Construct 1D scalar histograms of vector magnitudes.
- Construct nested spherical histograms to understand collections of non-unit vectors and axes.
- Construct 1D polar histograms of vector orientation spherical coordinate angles.
- Compute directional statistics to understand the distributions of orientations and directions, as described by Fisher, Lewis and Embleton.[^fle]


Installation
VectoRose can be installed from PyPI using pip.
bash
$ pip install vectorose
Alternatively, you can install it from source by cloning this repository.
Usage
To use VectoRose, you must have a collection of 3D vectors stored in a
NumPy array. These may be read from a NumPy file (*.npy) or a
comma-separated values (*.csv) file using the functions provided in
VectoRose.
VectoRose must be imported in order to be used. We recommend using the
alias vr when importing VectoRose:
python
import vectorose as vr
Histogram Construction
Histogram construction requires two steps:
- Assigning all vectors to magnitude and orientation bins.
- Computing histograms and generating the histogram plots.
The first step requires a discrete representation of a sphere, such as a
fine Tregenza sphere, which divides the surface of the sphere into 5806
faces, most of which are rectangular, of approximately equal surface area.
Two keyword arguments can be used to set the number of magnitude bins
(number_of_shells) and to fix the histogram domain (magnitude_range).
In the second step, a variety of histograms can be constructed. These histograms may consider the counts (or frequencies) of vectors at each combination of magnitude and direction (bivariate histogram), or within the bins of each variable separately (marginal histograms). Histograms can also be constructed that consider relative frequencies of one variable within a specific range of the other (conditional histograms).
In this brief code snippet, we will generate some random vectors from a von Mises-Fisher unimodal directional distribution, with some noise in the magnitude. We'll then construct the bivariate histogram and visualise it in 3D using PyVista.
```python import vectorose as vr import vectorose.mock_data
Create random vectors for demonstration
myvectors = vr.mockdata.createvonmisesfishervectorssingledirection( phi=45, theta=70, kappa=20, numberofpoints=10000, magnitude=1.0, magnitudestd=0.25, use_degrees=True, seed=20250317, )
Construct the discrete sphere representation
mysphere = vr.tregenzasphere.FineTregenzaSphere(numberofshells=10) mybinnedvectors, magnitudebinedges = mysphere.assignhistogrambins(myvectors)
Compute the bivariate histogram
myhistogram = mysphere.constructhistogram(mybinnedvectors, returnfraction=False)
Generate the histogram meshes
myhistogrammeshes = mysphere.createhistogrammeshes(myhistogram, magnitudebinedges)
Create a 3D SpherePlotter to view the histogram in 3D and show it
mysphereplotter = vr.plotting.SpherePlotter(myhistogrammeshes) mysphereplotter.produceplot() mysphere_plotter.show() ```

When this code is run in a Jupyter notebook, an interactive plotting output will appear beneath the code cell. When this code is run in a Python console, a new interactive window will appear that blocks the main thread.
In addition to showing the plot in 3D, VectoRose includes various functions to produce animations and screenshots of spherical histograms.
Directional Statistics
The functions in the vectorose.stats module enable directional statistics
to be computed. These functions have been adapted from the work by Fisher,
Lewis and Embleton.[^fle]
VectoRose implements a variety of descriptive statistics and hypothesis tests. Most of these consider pure directions or orientations, which are represented as unit vectors. These statistics include:
- Correlation between magnitude and orientation
- Hypothesis testing of uniform vs. unimodal distribution
- Woodcock's shape and strength parameters
- Mean resultant vector
- Spherical median vector
- Von Mises-Fisher parameter estimation
- Mean direction, including confidence cone
- Concentration parameter
In this code snippet, we generate two sets of mock vectors: a cluster, following a von Mises-Fisher distribution, and a girdle, following a Watson distribution with a negative parameter value. We then compute Woodcock's shape and strength parameters, as described by Woodcock[^woodcock] and as explained by Fisher, Lewis and Embleton.[^fle]
```python import vectorose as vr import vectorose.mock_data import numpy as np
Create random vectors for demonstration
myclustervectors = vr.mockdata.createvonmisesfishervectorssingledirection( phi=45, theta=70, kappa=20, numberofpoints=10000, magnitude=1.0, magnitudestd=0, usedegrees=True, seed=20250318, )
direction = np.array([1, 0, 0]) mygirdlevectors = vr.mockdata.generatewatson_distribution( direction, -20, n=10000, seed=20250318 )
Compute Woodcock's parameters for both sets of vectors
clusterorientationmatrixeigs, _ = vr.stats.computeorientationmatrixeigs( myclustervectors ) girdleorientationmatrixeigs, _ = vr.stats.computeorientationmatrixeigs( mygirdlevectors )
clusterwoodcockparameters = vr.stats.computeorientationmatrixparameters( clusterorientationmatrixeigs ) girdlewoodcockparameters = vr.stats.computeorientationmatrixparameters( girdleorientationmatrixeigs )
print(f"The VMF distribution has shape parameter {clusterwoodcockparameters.shapeparameter:.3f}" f" and strength parameter {clusterwoodcockparameters.strengthparameter:.3f}.")
print(f"The Watson distribution has shape parameter {girdlewoodcockparameters.shapeparameter:.3f}" f" and strength parameter {girdlewoodcockparameters.strengthparameter:.3f}.") ```
Running this code produces the following output:
The VMF distribution has shape parameter 48.085 and strength parameter 2.987.
The Watson distribution has shape parameter 0.005 and strength parameter 2.955.
Additional statistical operations are provided in the VectoRose API and are described in the User's Guide.
Citation
If you've found VectoRose helpful for your research, please cite our publication:
tex
@article{Rudski2025,
doi = {10.21105/joss.08369},
url = {https://doi.org/10.21105/joss.08369},
year = {2025},
publisher = {The Open Journal},
volume = {10},
number = {111},
pages = {8369},
author = {Rudski, Benjamin Z. and Deering, Joseph and Reznikov, Natalie},
title = {VectoRose: A new package for analysing and visualising 3D non-unit vectors in Python},
journal = {Journal of Open Source Software}
}
If you've modelled your analysis based on our sample case studies, please also cite the following:
TBA
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
VectoRose is built on a number of existing, well-supported open-source packages, including: NumPy, PyVista, Matplotlib, pandas, SciPy and trimesh.
License
VectoRose was created by Benjamin Z. Rudski and Joseph Deering. It is
licensed under the terms of the MIT license. See the LICENSE file for
more details.
Acknowledgements
The VectoRose project is developed by Benjamin Z. Rudski and Joseph Deering under the supervision of Dr. Natalie Reznikov at McGill University, in Montreal, Quebec, Canada 🇨🇦.
Works consult in this project are available in our online documentation, as
well as in docs/refs.bib.
For the directional statistics approaches, we made extensive use of
Statistic analysis of spherical data by Fisher, Lewis and Embleton.[^fle]
We also made extensive use of the book Python Packages by Tomas Beuzen and Tiffany Timbers to inform the structure and development of this package.
Credits
vectorose was created with cookiecutter and the py-pkgs-cookiecutter template.
[^fle]: Fisher, N. I., Lewis, T., & Embleton, B. J. J. (1993). Statistical analysis of spherical data ([New ed.], 1. paperback ed). Cambridge Univ. Press. https://www.cambridge.org/ca/universitypress/subjects/physics/astronomy-general/statistical-analysis-spherical-data?format=PB
[^woodcock]: Woodcock, N. H. (1977). Specification of fabric shapes using an eigenvalue method. Geological Society of America Bulletin, 88(9), 1231. https://doi.org/10.1130/0016-7606(1977)881231:SOFSUA2.0.CO;2
Owner
- Login: bzrudski
- Kind: user
- Repositories: 2
- Profile: https://github.com/bzrudski
JOSS Publication
VectoRose: A new package for analysing and visualising 3D non-unit vectors in Python
Authors
Faculty of Dental Medicine and Oral Health Sciences, McGill University, Canada, Department of Bioengineering, Faculty of Engineering, McGill University, Canada, Department of Anatomy and Cell Biology, School of Biomedical Sciences, Faculty of Medicine and Health Sciences, McGill University, Canada
Tags
anisotropy directional statistics trabecular bone histograms spherical histogramsCitation (CITATION.cff)
cff-version: "1.2.0"
authors:
- family-names: Rudski
given-names: Benjamin Z.
orcid: "https://orcid.org/0009-0000-3423-0662"
- family-names: Deering
given-names: Joseph
orcid: "https://orcid.org/0000-0003-2868-0944"
- family-names: Reznikov
given-names: Natalie
orcid: "https://orcid.org/0000-0001-5293-4647"
contact:
- family-names: Rudski
given-names: Benjamin Z.
orcid: "https://orcid.org/0009-0000-3423-0662"
doi: 10.5281/zenodo.15857821
message: If you use this software, please cite our article in the
Journal of Open Source Software.
preferred-citation:
authors:
- family-names: Rudski
given-names: Benjamin Z.
orcid: "https://orcid.org/0009-0000-3423-0662"
- family-names: Deering
given-names: Joseph
orcid: "https://orcid.org/0000-0003-2868-0944"
- family-names: Reznikov
given-names: Natalie
orcid: "https://orcid.org/0000-0001-5293-4647"
date-published: 2025-07-18
doi: 10.21105/joss.08369
issn: 2475-9066
issue: 111
journal: Journal of Open Source Software
publisher:
name: Open Journals
start: 8369
title: "VectoRose: A new package for analysing and visualising 3D
non-unit vectors in Python"
type: article
url: "https://joss.theoj.org/papers/10.21105/joss.08369"
volume: 10
title: "VectoRose: A new package for analysing and visualising 3D
non-unit vectors in Python"
GitHub Events
Total
- Create event: 13
- Issues event: 3
- Release event: 9
- Watch event: 4
- Delete event: 7
- Issue comment event: 8
- Public event: 1
- Push event: 70
- Pull request event: 10
Last Year
- Create event: 13
- Issues event: 3
- Release event: 9
- Watch event: 4
- Delete event: 7
- Issue comment event: 8
- Public event: 1
- Push event: 70
- Pull request event: 10
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 0
- Total pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: 18 minutes
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 1.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 0
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: 18 minutes
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 1.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 1
Top Authors
Issue Authors
- bzrudski (2)
- stevenpawley (1)
Pull Request Authors
- dependabot[bot] (5)
- bzrudski (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 55 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 12
- Total maintainers: 1
pypi.org: vectorose
Plot polar and spherical histograms from orientation data.
- Homepage: https://github.com/bzrudski/vectorose
- Documentation: https://vectorose.readthedocs.io/en/latest/index.html
- License: MIT
-
Latest release: 1.4.1
published 7 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/setup-python v5 composite
- coactions/setup-xvfb v1 composite
- codecov/codecov-action v3 composite
- python-semantic-release/python-semantic-release v8.3.0 composite
- snok/install-poetry v1 composite
- myst-nb *
- sphinx-autoapi *
- sphinx-rtd-theme *
- 221 dependencies
- black ^24.10.0 develop
- ipympl ^0.9.4 develop
- jupyter ^1.0.0 develop
- jupyterlab >=3 develop
- jupytext ^1.16.4 develop
- myst-nb ^1.0.0 develop
- pydata-sphinx-theme ^0.15.3 develop
- pytest ^7.4.4 develop
- pytest-cov ^4.1.0 develop
- python-semantic-release ^8.7.0 develop
- sphinx-autoapi ^3.0.0 develop
- sphinx-copybutton ^0.5.2 develop
- sphinx-design ^0.6.1 develop
- sphinxcontrib-bibtex ^2.6.3 develop
- sphinxcontrib-video ^0.3.1 develop
- imageio [ffmpeg, pyav]>=2.27.0
- imageio-ffmpeg (>=0.5.1, <1)
- importlib-metadata >=7.0.1
- ipywidgets (>=8.1.5, <9)
- matplotlib >=3.3.4
- numpy (>=1.19.5, <2)
- openpyxl (>=3.1.2, <4)
- pandas >=1.1.3
- pyvista [all, jupyter, trame] (>=0.44.1, <1)
- scipy (>=1.14, <2)
- trame (>=3.6.5, <4)
- trimesh [easy] (>=4.3.0, <5)