58 lines
1.7 KiB
Markdown
58 lines
1.7 KiB
Markdown
# TUDPlot
|
|
|
|
A package for matplotlib plotting in the corporate style of the TU Darmstadt.
|
|
|
|
## Installation
|
|
|
|
Make sure dependencies are installed:
|
|
|
|
* Python 3.5
|
|
* matplotlib
|
|
* numpy
|
|
|
|
### Installation from repository
|
|
This will install itudplot for your python in your local folder (so you do no break system packages, despite what "--break-system-packages" implicates)
|
|
|
|
pip install --user --break-system-packages git+https://gitea.pkm.physik.tu-darmstadt.de/IPKM/python-tudplot.git
|
|
|
|
Another way is to use a venv for your project:
|
|
|
|
python3 -m venv venv
|
|
source ./venv/bin/activate
|
|
pip install git+https://gitea.pkm.physik.tu-darmstadt.de/IPKM/python-tudplot.git
|
|
|
|
or use your existing venv.
|
|
|
|
|
|
|
|
|
|
|
|
### Installation from source
|
|
Download the source as [zip file](https://gitea.pkm.physik.tu-darmstadt.de/IPKM/python-tudplot/archive/main.zip) or clone it with git:
|
|
git clone https://gitea.pkm.physik.tu-darmstadt.de/IPKM/python-tudplot.git
|
|
|
|
Then in the unpacked source directory run:
|
|
|
|
pip install --user --break-system-packages .
|
|
|
|
## Usage
|
|
|
|
Use the function `activate` to activate TU styled plotting:
|
|
|
|
import tudplot
|
|
tudplot.activate()
|
|
|
|
A call with no arguments will activate a nominal color range of 6 distinct TU colors.
|
|
One can specify the keyword `full` to enable a range of continuous colors from the full TU color spectrum.
|
|
|
|
tudplot.activate(full=10)
|
|
|
|
TUDPlot also comes with a basic exporter `saveagr`, to save the current matplotlib figure in xmgrace agr format.
|
|
|
|
import matplotlib.pyplot as plt
|
|
fig = plt.figure()
|
|
plt.plot([1,2,3], label='Test')
|
|
# Do more plotting here...
|
|
# When the figure is complete:
|
|
tudplot.saveagr('test.agr')
|