autogpy - AutoGnuplot.py
Automatic generation of gnuplot figures/scripts/data from python.
Author: Alessandro Corbetta, 2019-2020
Documentation: https://acorbe.github.io/autogpy/
Examples Link
Github Link
Which problem does it solve?
autogpy eliminates annoying duplications of code and data when employing python for data analysis and gnuplot for figures. Providing a gnuplot-like or a matplotlib-like syntax, autogpy automatically generates gnuplot scripts and dumps suitably the data.
Main features
- anything that be obtained by the gnuplot command
plotcan be produced - output figures are shipped in a folder which includes scripts, data and makefile
- any gnuplot state modification can be achieved
- terminals epslatex, tikz/pgfplot and jpg
- multiplots
plt.hist-like gnuplot histogram figures generator- jupyter notebook figure preview
- jupyter notebook gnuplot script inspection
- easy scp-based synchronization between a machine in which the figures are generated (e.g. from even larger datasets) and the "paper writing" machine.
Requirements
- Linux/MacOs (could work on Windows, yet it has not been adjusted for)
- Python 3
- Working latex distribution
- Gnuplot, optionally with tikz terminal
pdftoppm(viapoppler-utils) orimagemagickto convert the output pdf figures in png format for jupyter notebook preview
Getting autogpy
Via pip
pip install autogpy
On Google Colab
!apt install gnuplot texlive poppler-utils ghostscript texlive-latex-extra
!pip install autogpy
From source
git clone git@github.com:acorbe/autogpy.git
pip install autogpy/
In a nutshell
Please see also the examples and the documentation.
import autogpy
import numpy as np
xx = np.linspace(0,6,100)
yy = np.sin(xx)
zz = np.cos(xx)
with autogpy.AutogpyFigure("test_figure") as figure:
# gnuplot-like syntax
figure.plot(r'with lines t "sin"',xx,yy)
# matplotlib-like syntax
figure.plot(xx,zz,u='1:2',w='lines',label='cos')
generates the following figure (also appearing in jupyter)
Most importantly, the following source and data are created in the folder test_figure
$ ls test_figure
.gitignore
Makefile
sync_me.sh
fig__0__.dat
fig__1__.dat
fig__.core.gnu
fig__.jpg.gnu
fig__.pdflatex_compile.sh
fig__.pdflatex.gnu
fig__.tikz_compile.sh
fig__.tikz.gnu
With make one can obtain jpg, epslatex, and tikz/pgfplot versions of the figure. Notice that the input data has been formatted automatically and dumped in the .dat files.
Inspecting the fig__.pdflatex.gnu, responsible of the epslatex version of the figure, one gets:
set terminal epslatex size 9.9cm,8.cm color colortext standalone 'phv,12 ' linewidth 2
set output 'fig.latex.nice/plot_out.tex'
p "fig__0__.dat" with lines t "sin",\
"fig__1__.dat" u 1:2 with lines t "cos"
KWONW ISSUES
- Certain features require imagemagick and a working
gnuplot-tikz.lua. Some versions of these might have bugs. Callfigure.display_fixes()to show known fixes.
Metadata
Release files for autogpy 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| autogpy-0.3.2.tar.gz | 22.4 kB | Without provenance | Details for autogpy-0.3.2.tar.gz |
Release files / autogpy-0.3.2.tar.gz
| Download URL | autogpy-0.3.2.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e087be3d98c5aa16fcf8844b43289c335783bb47c41dd786c553c7ecb0dc5847
|
|
BLAKE2b-256 checksum How to use checksums |
035eea1a1e63c8fa68d2f9d560809a5ec71333b092ebea6bbc56b2e76ec6083a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
|
Security for autogpy 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.