Installation and update
Prerequisite
You need version 3.10 (or a more recent version) of Python 3. You can check your version of Python 3 with:
python3 --version
Using PyPI (stable version)
Install plothist
(Optional) Setup and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate
Install
plothistfromPyPIinto your environment.If you have a local installation, you can use the normal setup command:
python3 -m pip install plothist
If this fails because you do not have write access to where your virtual environment lives, you can also install
plothistlocally:
python3 -m pip install --user plothist
This will automatically also install plothist into your current environment.
Please make sure to always setup your environment correctly before using plothist.
The plothist package can now be imported in any of your scripts. Now you can go on with the step by step tutorial starting with Plot 1D histograms or directly to the example gallery.
Update plothist
To update plothist to its latest stable version, follow the instructions above, adding the argument --upgrade right after pip3 install:
python3 -m pip install --upgrade [--user] plothist
Install the development version
Fork and clone locally the plothist repository, then go to the package folder:
git clone git@github.com:USERNAME/plothist.git cd plothist
Option 1 (recommended) - Using uv
Install
uvfollowing the instructions in the uv documentation.Run the following commands to setup a virtual environment and install the package:
uv sync --group dev --group test
The previous command creates a virtual environment .venv and installs the package in editable mode with the development and test dependencies.
To activate the virtual environment, run:
source .venv/bin/activate
Option 2 - Not using uv
Setup and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate
Run the following command to install the package in editable mode with the development and test dependencies:
python3 -m pip install --editable ".[dev,test]"
To update plothist to its latest development version, go to the package folder and run:
git pull