{"id":24528124,"url":"https://github.com/acorbe/autogpy","last_synced_at":"2025-04-14T15:52:50.119Z","repository":{"id":57412844,"uuid":"186997173","full_name":"acorbe/autogpy","owner":"acorbe","description":"Gnuplot scripts and figures auto-generated in Python. Production-ready, Latex and Tikz rendering. ","archived":false,"fork":false,"pushed_at":"2020-10-29T09:10:53.000Z","size":3902,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T04:41:42.955Z","etag":null,"topics":["gnuplot","gnuplot-graphs","gnuplot-interface","jupyter","numpy","plotting-in-python","python3","tikz"],"latest_commit_sha":null,"homepage":"https://acorbe.github.io/autogpy/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acorbe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-16T09:33:32.000Z","updated_at":"2024-12-18T22:04:23.000Z","dependencies_parsed_at":"2022-08-29T15:22:50.244Z","dependency_job_id":null,"html_url":"https://github.com/acorbe/autogpy","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acorbe%2Fautogpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acorbe%2Fautogpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acorbe%2Fautogpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acorbe%2Fautogpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acorbe","download_url":"https://codeload.github.com/acorbe/autogpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248911131,"owners_count":21182041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gnuplot","gnuplot-graphs","gnuplot-interface","jupyter","numpy","plotting-in-python","python3","tikz"],"created_at":"2025-01-22T06:33:58.965Z","updated_at":"2025-04-14T15:52:50.080Z","avatar_url":"https://github.com/acorbe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003eautogpy - AutoGnuplot.py\u003c/h1\u003e\n\n\u003ch2\u003eAutomatic generation of gnuplot figures/scripts/data from python.\u003c/h2\u003e\n\n\n**Author:** [Alessandro Corbetta](http://corbetta.phys.tue.nl/), 2019-2020   \n**Documentation:** https://acorbe.github.io/autogpy/  \n**Examples** [Link](https://github.com/acorbe/autogpy/tree/master/examples)  \n**Github** [Link](https://github.com/acorbe/autogpy) \n\n\n[![PyPI](https://img.shields.io/pypi/v/autogpy)](https://pypi.org/project/autogpy/) [![build status](https://travis-ci.org/acorbe/autogpy.svg?branch=master)](https://travis-ci.org/github/acorbe/autogpy) [![Downloads](https://pepy.tech/badge/autogpy)](https://pepy.tech/project/autogpy)![PyPI - Downloads](https://img.shields.io/pypi/dm/autogpy)\n\n\n### Which problem does it solve? [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/acorbe/autogpy/blob/master/examples/05-colab/Autogpy_colab_showcase.ipynb)\n\n\n`autogpy` eliminates annoying duplications of code and data when employing python for data analysis and [gnuplot](http://www.gnuplot.info/) for figures. Providing a gnuplot-like or a matplotlib-like syntax, `autogpy` automatically generates gnuplot scripts and dumps suitably the data.  \n\n![Autogpy-Demo](https://github.com/acorbe/autogpy/raw/master/doc/other/demo-animation.gif)\n\nLinks: [[Source](https://github.com/acorbe/autogpy/tree/master/examples/02-webexample/webmovie.ipynb)] [[Output](https://github.com/acorbe/autogpy/tree/master/examples/02-webexample/test-figure)]\n\n\n### Main features\n+ [[Reference](https://acorbe.github.io/autogpy/code.html#autogpy.AutoGnuplotFigure.plot)] [[Example 1](https://github.com/acorbe/autogpy/blob/master/examples/01-syntax/hybrid-python-gnuplot-syntax.ipynb) [2](https://github.com/acorbe/autogpy/blob/master/examples/01-syntax/pure-gnuplot-syntax.ipynb)] anything that be obtained by the gnuplot command `plot` can be produced\n+ output figures are shipped in a folder which includes scripts, data and makefile\n+ any gnuplot state modification can be achieved\n+ terminals epslatex, tikz/pgfplot and jpg\n+ multiplots\n+ `plt.hist`-like gnuplot histogram figures generator\n+ jupyter notebook figure preview\n+ jupyter notebook gnuplot script inspection\n+ easy scp-based synchronization between a machine in which the figures are generated (e.g. from even larger datasets) and the \"paper writing\" machine.\n\n**Requirements**\n+ Linux/MacOs (could work on Windows, yet it has not been adjusted for)\n+ Python 3\n+ Working latex distribution\n+ Gnuplot, optionally with tikz terminal (tikz terminal requires a working installation of luatex)\n+ `pdftoppm` (via [`poppler-utils`](https://command-not-found.com/pdftoppm)) or [`imagemagick`](https://command-not-found.com/convert) to convert the output pdf figures in png format for jupyter notebook preview \n+ **Note:** in case `pdftoppm` is unavailable, `imagemagick` offline conversions pdf to png must be enabled (`sudo sed -i '/PDF/s/none/read|write/' /etc/ImageMagick-6/policy.xml`) [[Reference](https://stackoverflow.com/a/52661288)]\n\n\n### Getting autogpy\n\nVia `pip`\n```bash\npip install autogpy\n\n```\n\nOn Google Colab\n```bash\n!apt install gnuplot texlive poppler-utils ghostscript texlive-latex-extra\n!pip install autogpy\n```\n\nFrom source\n```bash\ngit clone git@github.com:acorbe/autogpy.git\npip install autogpy/\n```\n\n\n## In a nutshell\n\nPlease see also the [examples](https://github.com/acorbe/autogpy/tree/master/examples) and the [documentation](https://acorbe.github.io/autogpy/).\n\n```python\nimport autogpy\nimport numpy as np\n\nxx = np.linspace(0,6,100)\nyy = np.sin(xx)\nzz = np.cos(xx)\n\nwith autogpy.AutogpyFigure(\"test_figure\") as figure: \n\n\t# gnuplot-like syntax\n\tfigure.plot(r'with lines t \"sin\"',xx,yy)\n\t\n\t# matplotlib-like syntax\n\tfigure.plot(xx,zz,u='1:2',w='lines',label='cos')\n```\n\ngenerates the following figure (also appearing in jupyter)\n\n\u003cimg src=\"https://github.com/acorbe/autogpy/raw/master/example_fig.jpeg\" alt=\"example figure\" width=\"500px\" \u003e\n\n**Most importantly**, the following source and data are created in the folder `test_figure` \n\n```bash\n$ ls test_figure\n\n.gitignore\nMakefile\nsync_me.sh\nfig__0__.dat\nfig__1__.dat\nfig__.core.gnu\nfig__.jpg.gnu\nfig__.pdflatex_compile.sh\nfig__.pdflatex.gnu\nfig__.tikz_compile.sh\nfig__.tikz.gnu\n```\n\nWith `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.\n\nInspecting the `fig__.pdflatex.gnu`, responsible of the epslatex version of the figure, one gets:\n```gnuplot\nset terminal epslatex size 9.9cm,8.cm color colortext standalone      'phv,12 '  linewidth 2\nset output 'fig.latex.nice/plot_out.tex'\n\np \"fig__0__.dat\" with lines t \"sin\",\\\n\"fig__1__.dat\" u 1:2 with lines t \"cos\" \n```\n\n**KWONW ISSUES**\n+ Certain features require imagemagick and a working `gnuplot-tikz.lua`. Some versions of these might have bugs. Call `figure.display_fixes()` to show known fixes.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facorbe%2Fautogpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facorbe%2Fautogpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facorbe%2Fautogpy/lists"}