An open API service indexing awesome lists of open source software.

https://github.com/vincent-picaud/gnuplotscripting.jl

An easy to use and simple gnuplot wrapping in Julia
https://github.com/vincent-picaud/gnuplotscripting.jl

gnuplot julia plotting

Last synced: 9 months ago
JSON representation

An easy to use and simple gnuplot wrapping in Julia

Awesome Lists containing this project

README

          

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://vincent-picaud.github.io/GnuplotScripting.jl/stable)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://vincent-picaud.github.io/GnuplotScripting.jl/dev)
[![Build Status](https://github.com/vincent-picaud/GnuplotScripting.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/vincent-picaud/GnuplotScripting.jl/actions/workflows/CI.yml?query=branch%3Amain)

# GnuplotScripting.jl

An **easy to use** and **simple** `gnuplot` wrapping that allows you
to:

- perform direct rendering of Gnuplot plots from Julia,
- create and save Gnuplot scripts with embedded data,
- easily export Gnuplot figures.

```julia
using GnuplotScripting

# create a gnuplot script
#
gp = GnuplotScript()

# Fake data
#
X=[-pi:0.1:pi;];
Ys =sin.(X);
Yc =cos.(X);

# embed data into the script
#
id=register_data(gp,hcat(X,Ys,Yc))

# usual gnuplot command
#
free_form(gp,"replot '$id' u 1:3 w l t 'cos'")
free_form(gp,"replot '$id' u 1:2 w l t 'sin'")

# png export of the fig
#
export_png("fig.png",gp)

# write gnuplot script
#
write_script("gnuplot_script.gp",gp)
```
That's it!

After running the previous code you will get a nearly immediate plot
of your figure, a `fig.png` image file

![image](docs/src/figures/trig.png)

and a gnuplot script `gnuplot_script.gp` with embedded data you can
rerun when you want.