diff --git a/docs/src/options.md b/docs/src/options.md index d66938e..511870a 100644 --- a/docs/src/options.md +++ b/docs/src/options.md @@ -59,15 +59,15 @@ If you use **Gnuplot.jl** frequently you may find convenient to collect all the ```julia macro gnuplotrc() return :( - using Gnuplot + using Gnuplot; # Uncomment the following if you don't have the gnuplot # executable installed on your platform - #Gnuplot.options.dry = true + #Gnuplot.options.dry = true; # Uncomment the following and set the proper path if the # gnuplot executable is not in your $PATH - #Gnuplot.options.cmd = "/path/to/gnuplot" + #Gnuplot.options.cmd = "/path/to/gnuplot"; # Set the default terminal for interacitve use push!(Gnuplot.options.init, "set term wxt size 700,400"); @@ -77,7 +77,7 @@ macro gnuplotrc() # Initialize the gnuplot REPL using the provided `start_key`. # Comment the following to disable the REPL. - Gnuplot.repl_init(start_key='>') + Gnuplot.repl_init(start_key='>'); ) end ``` diff --git a/docs/src/recipes.md b/docs/src/recipes.md index caf1be5..39611d9 100644 --- a/docs/src/recipes.md +++ b/docs/src/recipes.md @@ -1,3 +1,20 @@ # Plot recipes +A plot *recipe* is a function to convert data from the "Julia world" into one, or more, `Gnuplot.PlotElements` object(s) suitable to be ingested in **Gnuplot.jl**. These objects contain all the informations to create a plot, and can be passed directly to `@gp` or `@gsp`. The main purpose of recipes is to provide quick data visualization procedures. + + +There are two kinds of plot recipes: +- *explicit* recipe: a function which is explicitly invoked by the user. It can have any name, and accept any number of arguments and keywords. It is typically used when the conversion from Julia data to `Gnuplot.Recipe` objects requires some extra informations, beside data itself. An example is the quick look procedure for a `DataFrame` object (shown below); + +- *implicit* recipe: a function which is automatically called by **Gnuplot.jl** (never by the user). It must extend the `Gnuplot.recipe` function, and accept exactly one argument and no keywords. it is typically used when the conversion is completely determined by the data type itself. An example is the plot of a `Matrix{ColorTypes.RGB}` data as an image. + +In both cases the recipe function must return a scalar, or a vector of, `Gnuplot.PlotElements` object(s). The fields of the structure are: +- `mid::Int`:: multiplot ID; +- `cmds::Vector{String}`: commands to set plot properties; +- `data::Vector{DataSet}`: data sets to plot; +- `plot::Vector{String}`: plot specifications for each `DataSet`. + +`DataSet` is an abstract type, the actual data sets are stored in the form of either a `DataSetText` object (a textual representation of the data) or a `DataSetBin` object (a binary file). Both `DataSetText` and `DataSetBin` structures provide a number of constructors accepting several types of input data. + +