diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 0000000..50de053 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,13 @@ +using Documenter, Gnuplot + +makedocs(sitename="Gnuplot.jl", + #format = Documenter.HTML(prettyurls = false), + modules=[Gnuplot], + pages = [ + "Home" => "index.md", + "Installation" => "install.md", + "Basic usage" => "basic.md", + "Advanced usage" => "advanced.md", + "Examples" => "examples.md", + "API" => "api.md" + ]) diff --git a/docs/src/advanced.md b/docs/src/advanced.md new file mode 100644 index 0000000..f02ced7 --- /dev/null +++ b/docs/src/advanced.md @@ -0,0 +1,10 @@ +# Advanced techniques +## Multiplot +## Multiple processes +## Named datasets +## Histograms (1D) +## Histograms (2D) +## Contour lines +## Animations +## Dry sessions +## Options diff --git a/docs/src/api.md b/docs/src/api.md new file mode 100644 index 0000000..e8796dd --- /dev/null +++ b/docs/src/api.md @@ -0,0 +1,3 @@ +```@docs +@gp +``` diff --git a/docs/src/assets/logo.png b/docs/src/assets/logo.png new file mode 100644 index 0000000..64d40e5 Binary files /dev/null and b/docs/src/assets/logo.png differ diff --git a/docs/src/basic.md b/docs/src/basic.md new file mode 100644 index 0000000..e6e610c --- /dev/null +++ b/docs/src/basic.md @@ -0,0 +1,15 @@ +# Basic usage + +## Plots in 2D + +## Plots in 3D + +## Palettes and linestyles + +## Exporting + +## Generating scripts + +## Quick reference + + diff --git a/docs/src/examples.md b/docs/src/examples.md new file mode 100644 index 0000000..c0ab5de --- /dev/null +++ b/docs/src/examples.md @@ -0,0 +1,27 @@ +# Examples + +```julia + +@gp "set multiplot layout 1,2" +@gp :- 1 "plot sin(x) w l" + + +x = y = -10:0.33:10 +fz(x,y) = sin.(sqrt.(x.^2 + y.^2))./sqrt.(x.^2+y.^2) +fxy = [fz(x,y) for x in x, y in y] + +@gsp :- 2 x y fxy "w pm3d notit" + +``` + + + +@gp "set multiplot layout 1,2" +@gp :- 2 "unset grid" "unset border" "unset tics" :- +@gp :- 1 "plot sin(x) w l" + +x = y = -10:0.33:10 +fz(x,y) = sin.(sqrt.(x.^2 + y.^2))./sqrt.(x.^2+y.^2) +fxy = [fz(x,y) for x in x, y in y] + +@gsp :- 2 x y fxy "w pm3d notit" diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 0000000..4b2c6a8 --- /dev/null +++ b/docs/src/index.md @@ -0,0 +1,67 @@ +# Gnuplot.jl +## A Julia interface to Gnuplot. +--- + +The **Gnuplot.jl** package allows easy and fast use of [`gnuplot`](http://gnuplot.info/) as a data visualization tool in Julia. Have a look at [Basic usage](@ref) and [Examples](@ref) for a quick overview. The package main features are: + +- fast time-to-first-plot (~1 sec); + +- extremely concise yet meaningful syntax, makes it ideal for interactive data exploration; + +- no need to learn new API functions or keywords: only two macros (`@gp` for 2D plots, `@gsp` for 3D plots) and a basic knowledge of `gnuplot` are enough to generate the most complex plots; + +- transparent interface between Julia and `gnuplot` to exploit all functionalities of the latter, both present and future ones; + +- fast data transmission through system pipes (no temporary files involved); + +- availability of all the palettes from [ColorSchemes](https://github.com/JuliaGraphics/ColorSchemes.jl); + +- support for multiple plots in one window, mulitple plotting windows, as well as ASCII and Sixel plots (to plot directly in a terminal); + +- support for histograms (both 1D and 2D); + +- enhanced support for contour plots; + +- export to a huge number of formats such as `pdf`, `png`, ``\LaTeX``, `svg`, etc. (actually all those supported by `gnuplot`); + +- save sessions into `gnuplot` scripts enables easy plot reproducibility and modfications. + +--- +## Yet another plotting package? + +A powerful plottig framework is among the most important tool in the toolbox of any modern scientist and engineer. As such, it is hard to find a single package to fit all needs, and many solutions are indeed available in the Julia [ecosystem](https://github.com/JuliaPlots). + +**Gnuplot.jl** package fills the niche of users who needs: +1. publication-quality plots, by exploiting the capabilities of a widely used tool such as `gnuplot`, and its many output formats available; +1. a well-documented framework, by taking advantage of all the `gnuplot` documentation, tutorials and examples available on the web; +1. a fast response, by relying on an external program (rather than on a large Julia code base); +1. an interactive data exploration framework, by exposing a carefully designed, extremely concise and easy to remember syntax (at least for users with minimal `gnuplot` knowledge); +1. a procedure to foster plot reproducibility by sharing just the data and commands in the form of `gnuplot` scripts, rather than the original Julia code. + +Unlike other packages **Gnuplot.jl** is not a pure Julia solution as it depends on an external package to actually generate plots. However, if `gnuplot` is not available on a given platform, the package could still be used in "*dry*" mode, and no error for a missing dependency will be raised (see [Dry sessions](@ref)). + +The **Gnuplot.jl** package development follows a minimalistic approach: it is essentially a thin layer to send data and string commands to `gnuplot`. This way all underlying capabilities, both present and future ones, are automatically exposed to Julia user, with no need to implement dedicated wrappers. + +The functionalities 1, 2 and 3 listed above are similar to those provided by the [Gaston](https://github.com/mbaz/Gaston.jl) package. **Gnuplot.jl** also provides features 4 and 5, as well as the minimalistic approach. + + +--- +## Do Gnuplot.jl suits my needs? + +Any modern plotting package is able to produce a simple scatter plot, with custom symbols, line styles, colors and axis labels. Indeed, this is exactly the example that is reported in every package documentation (also here: see [Plots in 2D](@ref)). Still, producing complex and publication-quality plots is not an easy task. As a consequence is also not easy to determine whether a package can cope with the most difficult cases (unless you actually try it out) and a reasonable choice is typically to rely on the size of the user base, the availability of documentation / tutorials, and the possibility to preview complex examples. + +**Gnuplot.jl** aims to be ready for even the most challenging plots by relying on the widely and long lasting used `gnuplot` application, and by allowing each native feature (both present and future ones) to be immediately available in the Julia language. Moreover, **Gnuplot.jl** provides a unique syntax specifically aimed to increase productivity while performing interactive data exploration. + +Last but not least, have a look at the **Gnuplot.jl** [Examples](#ref) page. + +--- +## Notation +In this documentation: +- **Gnuplot.jl** refers to the Julia package; +- `gnuplot` refers to the [gnuplot](http://gnuplot.info/) application. + + +### Table of Contents +```@contents +Pages = ["index.md", "install.md", "basic.md", "advanced.md", "examples.md", "api.md"] +``` diff --git a/docs/src/install.md b/docs/src/install.md new file mode 100644 index 0000000..0b1cd9c --- /dev/null +++ b/docs/src/install.md @@ -0,0 +1,14 @@ +# Installation + +## Prerequisite +In order to use the **Gnuplot.jl** package you'll need [gnuplot](http://gnuplot.info/) (ver. >= 5.0) installed on your system, and its executable available in your path. + + +## Installation + +In the Julia REPL type: +``` julia +using Pkg +Pkg.add("Gnuplot") +using Gnuplot +```