Gnuplot.jl/dev/search_index.js
Giorgio Calderone 06084d0bbb Docs updated
2020-03-24 23:20:17 +01:00

4 lines
31 KiB
JavaScript

var documenterSearchIndex = {"docs":
[{"location":"api/#API-1","page":"API","title":"API","text":"","category":"section"},{"location":"api/#","page":"API","title":"API","text":"The list of Gnuplot.jl exported symbols are as follows:","category":"page"},{"location":"api/#","page":"API","title":"API","text":"@gp\n@gsp\nsave\npalette\nlinestyles\nhist\ncontourlines","category":"page"},{"location":"api/#Gnuplot.@gp","page":"API","title":"Gnuplot.@gp","text":"@gp args...\n\nThe @gp macro (and its companion @gsp, for splot operations) allows to exploit all of the Gnuplot package functionalities using an extremely efficient and concise syntax. Both macros accept the same syntax, as described below.\n\nThe macros accepts any number of arguments, with the following meaning:\n\na symbol: the name of the session to use;\na string: a command (e.g. \"set key left\") or plot specification (e.g. \"with lines\");\na string starting with a $ sign: a data set name;\nan Int > 0: the plot destination in a multiplot session;\na keyword/value pair: a keyword value (see below);\nany other type: a dataset to be passed to Gnuplot. Each dataset must be terminated by either:\na string starting with a $ sign (i.e. the data set name);\nor a string with the plot specifications (e.g. \"with lines\");\nthe :- symbol, used as first argument, avoids resetting the Gnuplot session. Used as last argument avoids immediate execution of the plot/splot command. This symbol can be used to split a single call into multiple ones.\n\nAll entries are optional, and there is no mandatory order. The plot specification can either be:\n\na complete plot/splot command (e.g., \"plot sin(x)\", both \"plot\" and \"splot\" can be abbreviated to \"p\" and \"s\" respectively);\nor a partial specification starting with the \"with\" clause (if it follows a data set).\n\nThe list of accepted keyword is as follows:\n\ntitle::String: plot title;\nxlabel::String: X axis label;\nylabel::String: Y axis label;\nzlabel::String: Z axis label;\nxlog::Bool: logarithmic scale for X axis;\nylog::Bool: logarithmic scale for Y axis;\nzlog::Bool: logarithmic scale for Z axis;\nxrange::NTuple{2, Number}: X axis range;\nyrange::NTuple{2, Number}: Y axis range;\nzrange::NTuple{2, Number}: Z axis range;\ncbrange::NTuple{2, Number}: Color box axis range;\n\nThe symbol for the above-mentioned keywords may also be used in a shortened form, as long as there is no ambiguity with other keywords. E.g. you can use: xr=(1,10) in place of xrange=(1,10).\n\nExamples:\n\nSimple examples with no data:\n\n@gp \"plot sin(x)\"\n@gp \"plot sin(x)\" \"pl cos(x)\"\n@gp \"plo sin(x)\" \"s cos(x)\"\n\n# Split a `@gp` call in two\n@gp \"plot sin(x)\" :-\n@gp :- \"plot cos(x)\"\n\n# Insert a 3 second pause between one plot and the next\n@gp \"plot sin(x)\" 2 xr=(-2pi,2pi) \"pause 3\" \"plot cos(4*x)\"\n\nSimple examples with data:\n\n@gp \"set key left\" tit=\"My title\" xr=(1,12) 1:10 \"with lines tit 'Data'\"\n\nx = collect(1.:10)\n@gp x\n@gp x x\n@gp x -x\n@gp x x.^2\n@gp x x.^2 \"w l\"\n\nlw = 3\n@gp x x.^2 \"w l lw $lw\"\n\nA more complex example\n\n@gp(\"set grid\", \"set key left\", xlog=true, ylog=true,\n title=\"My title\", xlab=\"X label\", ylab=\"Y label\",\n x, x.^0.5, \"w l tit 'Pow 0.5' dt 2 lw 2 lc rgb 'red'\",\n x, x , \"w l tit 'Pow 1' dt 1 lw 3 lc rgb 'blue'\",\n x, x.^2 , \"w l tit 'Pow 2' dt 3 lw 2 lc rgb 'purple'\")\n\nMultiplot example:\n\n@gp(xr=(-2pi,2pi), \"unset key\",\n \"set multi layout 2,2 title 'Multiplot title'\",\n 1, \"p sin(x)\" ,\n 2, \"p sin(2*x)\",\n 3, \"p sin(3*x)\",\n 4, \"p sin(4*x)\")\n\nor equivalently\n\n@gp xr=(-2pi,2pi) \"unset key\" \"set multi layout 2,2 title 'Multiplot title'\" :-\nfor i in 1:4\n @gp :- i \"p sin($i*x)\" :-\nend\n@gp\n\nMultiple gnuplot sessions\n\n@gp :GP1 \"plot sin(x)\"\n@gp :GP2 \"plot sin(x)\"\n\nGnuplot.quitall()\n\nFurther examples\n\nx = range(-2pi, stop=2pi, length=100);\ny = 1.5 * sin.(0.3 .+ 0.7x) ;\nnoise = randn(length(x))./2;\ne = 0.5 * fill(1, size(x));\n\nname = \"\\$MyDataSet1\"\n@gp x y name \"plot $name w l\" \"pl $name u 1:(2*\\$2) w l\"\n\n@gsp randn(Float64, 30, 50)\n@gp randn(Float64, 30, 50) \"w image\"\n@gsp x y y\n\n@gp(\"set key horizontal\", \"set grid\",\n xrange=(-7,7), ylabel=\"Y label\",\n x, y, \"w l t 'Real model' dt 2 lw 2 lc rgb 'red'\",\n x, y+noise, e, \"w errorbars t 'Data'\")\n\n@gp \"f(x) = a * sin(b + c*x); a = 1; b = 1; c = 1;\" :-\n@gp :- x y+noise e name :-\n@gp :- \"fit f(x) $name u 1:2:3 via a, b, c;\" :-\n@gp :- \"set multiplot layout 2,1\" :-\n@gp :- \"plot $name w points\" ylab=\"Data and model\" :-\n@gp :- \"plot $name u 1:(f(\\$1)) w lines\" :-\n@gp :- 2 xlab=\"X label\" ylab=\"Residuals\" :-\n@gp :- \"plot $name u 1:((f(\\$1)-\\$2) / \\$3):(1) w errorbars notit\"\n\n# Retrieve values for a, b and c\na = Meta.parse(Gnuplot.exec(\"print a\"))\nb = Meta.parse(Gnuplot.exec(\"print b\"))\nc = Meta.parse(Gnuplot.exec(\"print c\"))\n\n# Save to a PDF file\nsave(term=\"pdf\", output=\"gnuplot.pdf\")\n\nDisplay an image\n\nusing TestImages\nimg = testimage(\"lena\");\n@gp img \"w image\"\n@gp \"set size square\" img \"w rgbimage\" # Color image with correct proportions\n@gp \"set size square\" img \"u 2:(-\\$1):3:4:5 with rgbimage\" # Correct orientation\n\n\n\n\n\n","category":"macro"},{"location":"api/#Gnuplot.@gsp","page":"API","title":"Gnuplot.@gsp","text":"@gsp\n\nSee documentation for @gp.\n\n\n\n\n\n","category":"macro"},{"location":"api/#Gnuplot.save","page":"API","title":"Gnuplot.save","text":"save(...)\n\nSave the data and commands in the current session to either:\n\nthe gnuplot process (i.e. produce a plot): save(term=\"\", output=\"\");\nan IO stream: save(stream::IO; term=\"\", output=\"\");\na file: save(file::AbstractStrings; term=\"\", output=\"\").\n\nTo save the data and command from a specific session pass the ID as first argument, i.e.:\n\nsave(sid::Symbol, term=\"\", output=\"\");\nsave(sid::Symbol, file::AbstractStrings; term=\"\", output=\"\").\n\nIn all cases the term keyword allows to specify a gnuplot terminal, and the output keyword allows to specify an output file.\n\n\n\n\n\n","category":"function"},{"location":"basic/#Basic-usage-1","page":"Basic usage","title":"Basic usage","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"The main purpose of the Gnuplot.jl package is to send data and commands to the underlying gnuplot process, in order to generate plots. Unlike other packages, however, the actual commands to plot, or the plot attributes, are not specified through function calls. This is what makes Gnuplot.jl easy to learn and use: there are no functions or keywords names to memorize[1].","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"The most important symbols exported by the package are the @gp (for 2D plots) and @gsp (for 3D plots) macros, both accepting any number of arguments, and whose meaning is interpreted as follows:","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"one, or a group of consecutive, array(s) build up a dataset. The different arrays are accessible as columns 1, 2, etc. from the gnuplot process. The number of required input arrays depends on the chosen plot style (see gnuplot documentation);\na string occurring before a dataset is interpreted as a gnuplot command (e.g. set grid);\na string occurring immediately after a dataset is interpreted as a plot element for the dataset, by which you can specify using clause, with clause, line styles, etc.;\nthe special symbol :-, whose meaning is to avoid creating a new plot (if given as first argument), or to avoid immediately running all commands to create the final plot (if given as last argument). Its purpose is to allow splitting one long statement into multiple (shorter) ones.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"The above lists all the required concepts to follow the examples presented below. The @gp and @gsp macros also accepts further arguments, but their use will be discussed in Advanced techniques.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"[1]: a previous knowledge of gnuplot usage is, nevertheless, required.","category":"page"},{"location":"basic/#Plots-in-2D-1","page":"Basic usage","title":"Plots in 2D","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"Here we will show a few examples to generate 2D plots. The examples are intentionally very simple to highlight the behavior of Gnuplot.jl. See Examples for more complex ones.","category":"page"},{"location":"basic/#Simple-examples-involving-just-gnuplot-commands:-1","page":"Basic usage","title":"Simple examples involving just gnuplot commands:","text":"","category":"section"},{"location":"basic/#Plot-a-sinusoid:-1","page":"Basic usage","title":"Plot a sinusoid:","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"@gp \"plot sin(x)\"\nsave(term=\"png size 480,360\", output=\"src/assets/basic1.png\") # hide","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"(Image: )","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"","category":"page"},{"location":"basic/#Plot-two-curves:-1","page":"Basic usage","title":"Plot two curves:","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"@gp \"set key left\" \"plot sin(x)\" \"pl cos(x)\"\nsave(term=\"png size 480,360\", output=\"src/assets/basic2.png\") # hide","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"(Image: )","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"note: Note\nNote that all gnuplot commands can be abbreviated as long as the resulting string is not ambiguous. In the example above we used pl in place of plot.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"","category":"page"},{"location":"basic/#Split-a-@gp-call-in-three-statements:-1","page":"Basic usage","title":"Split a @gp call in three statements:","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"@gp \"set grid\" :-\n@gp :- \"p sin(x)\" :-\n@gp :- \"plo cos(x)\"\nsave(term=\"png size 480,360\", output=\"src/assets/basic3.png\") # hide","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"(Image: )","category":"page"},{"location":"basic/#Send-data-from-Julia-to-gnuplot:-1","page":"Basic usage","title":"Send data from Julia to gnuplot:","text":"","category":"section"},{"location":"basic/#Plot-a-parabola-1","page":"Basic usage","title":"Plot a parabola","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"@gp (1:20).^2 \nsave(term=\"png size 480,360\", output=\"src/assets/basic4.png\") # hide","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"(Image: )","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"","category":"page"},{"location":"basic/#Plot-a-parabola-with-scaled-x-axis,-lines-and-legend-1","page":"Basic usage","title":"Plot a parabola with scaled x axis, lines and legend","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"x = 1:20\n@gp \"set key left\" x ./ 20 x.^2 \"with lines tit 'Parabola'\"\nsave(term=\"png size 480,360\", output=\"src/assets/basic5.png\") # hide","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"(Image: )","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"","category":"page"},{"location":"basic/#Multiple-datasets,-logarithmic-axis,-labels-and-colors,-etc.-1","page":"Basic usage","title":"Multiple datasets, logarithmic axis, labels and colors, etc.","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"x = 1:0.1:10\n@gp \"set grid\" \"set key left\" \"set logscale y\"\n@gp :- \"set title 'Plot title'\" \"set label 'X label'\" \"set xrange [0:12]\"\n@gp :- x x.^0.5 \"w l tit 'Pow 0.5' dt 2 lw 2 lc rgb 'red'\"\n@gp :- x x \"w l tit 'Pow 1' dt 1 lw 3 lc rgb 'blue'\"\n@gp :- x x.^2 \"w l tit 'Pow 2' dt 3 lw 2 lc rgb 'purple'\"\nsave(term=\"png size 480,360\", output=\"src/assets/basic6.png\") # hide","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"(Image: )","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"note: Note\nThe above example lacks the trailing :- symbol. This means the plot will be updated at each command, adding one curve at a time.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"","category":"page"},{"location":"basic/#Keywords-for-common-commands-1","page":"Basic usage","title":"Keywords for common commands","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"In order to avoid typing long, and very frequently used gnuplot commands, Gnuplot.jl provides a few keywords which can be used in both @gp and @sgp calls:","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"xrange=[low, high] => \"set xrange [low:high];\nyrange=[low, high] => \"set yrange [low:high];\nzrange=[low, high] => \"set zrange [low:high];\ncbrange=[low, high]=> \"set cbrange[low:high];\nkey=\"...\" => \"set key ...\";\ntitle=\"...\" => \"set title \\\"...\\\"\";\nxlabel=\"...\" => \"set xlabel \\\"...\\\"\";\nylabel=\"...\" => \"set ylabel \\\"...\\\"\";\nzlabel=\"...\" => \"set zlabel \\\"...\\\"\";\nxlog=true => set logscale x;\nylog=true => set logscale y;\nzlog=true => set logscale z;","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"All such keywords can be abbreviated to unambiguous names.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"By using the above keywords the first lines of the previous example:","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"@gp \"set grid\" \"set key left\" \"set logscale y\"\n@gp :- \"set title 'Plot title'\" \"set label 'X label'\" \"set xrange [0:12]\"","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"can be replaced with a shorter version:","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"@gp \"set grid\" k=\"left\" ylog=true\n@gp :- tit=\"Plot title\" xlab=\"X label\" xr=[0,12]","category":"page"},{"location":"basic/#Plot-images-1","page":"Basic usage","title":"Plot images","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"Gnuplot.jl can also display images, i.e. 2D arrays:","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"img = randn(Float64, 30, 50)\nimg[10,:] .= -4\n@gp img \"w image notit\"\nsave(term=\"jpeg size 480,360\", output=\"src/assets/basic7a.png\") # hide","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"(Image: )","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"Note that the first index corresponds to the X coordinate when the image is displayed.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"The following example shows how to fix orientation of an image by means of the using clause (the TestImages package is required to run this example):","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"using TestImages\nimg = testimage(\"lena\");\n@gp \"set size square\" img \"u 2:(-\\$1):3:4:5 with rgbimage notit\"\nsave(term=\"jpeg size 480,360\", output=\"src/assets/basic7b.jpg\") # hide","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"(Image: )","category":"page"},{"location":"basic/#Plots-in-3D-1","page":"Basic usage","title":"Plots in 3D","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"3D plots follow the same rules as 2D ones, just replace the @gp macro with @gsp and add the required columns (according to the plotting style).","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"E.g., to plot a spiral increasing in size along the X direction:","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"x = 0:0.1:10pi\n@gsp x sin.(x) .* x cos.(x) .* x x./15 \"w p pt 7 ps var lc pal\"\nsave(term=\"jpeg size 640,480\", output=\"src/assets/basic8.jpg\") # hide","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"(Image: )","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"The keywords discussed above can also be used in 3D plots.","category":"page"},{"location":"basic/#Palettes-and-line-styles-1","page":"Basic usage","title":"Palettes and line styles","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"The Gnuplot.jl package comes with all the ColorSchemes palettes readily available.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"A gnuplot-compliant palette can be retrieved with palette(), and used as any other command. The previous example may use an alternative palette with:","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"x = 0:0.1:10pi\n@gsp palette(:viridis) x sin.(x) .* x cos.(x) .* x x./15 \"w p pt 7 ps var lc pal\"\nsave(term=\"jpeg size 640,480\", output=\"src/assets/basic8a.jpg\") # hide","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"(Image: )","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"The ColorSchemes palettes can also be used to generate line styles, by means of the linestyles() function, e.g.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"@gp linestyles(:deepsea)\nx = 1:0.1:4pi\nfor i in 1:5\n @gp :- x i.* sin.(x) \"w l notit ls $i lw 5\"\nend\nsave(term=\"jpeg size 480,360\", output=\"src/assets/basic9.jpg\") # hide","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"(Image: )","category":"page"},{"location":"basic/#Exporting-plots-to-files-1","page":"Basic usage","title":"Exporting plots to files","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"The save() function allows to export all plots (as well as multiplots, see Multiplot) to a file using one of the many available gnuplot terminals. To check which terminals are available in your platform type set term in your gnuplot terminal.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"All plots in this page have been saved with:","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"save(term=\"png size 480,360\", output=\"output.png\")","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"except the Lena image, saved with the jpeg terminal:","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"save(term=\"jpeg size 480,360\", output=\"output.png\")","category":"page"},{"location":"basic/#Gnuplot-scripts-1","page":"Basic usage","title":"Gnuplot scripts","text":"","category":"section"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"Besides exporting plots in a file Gnuplot.jl can also save a script, i.e. a file containing the minimum set of data and commands required to generate a plot within gnuplot.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"To generate a script for one of the example above use:","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"save(\"script.gp\")","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"after the plot has been displayed. The script can then be used within a gnuplot session as follows:","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"gunplot> load 'script.gp'","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"to generate a plot identical to the original one, without using the Julia language.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"The purpose of gnuplot scripts is to allow sharing all data, alongside a plot, in order to foster collaboration among scientists and replicability of results. Moreover, a script can be used at any time to change the details of a plot, without the need to re-run the Julia code used to generate it the first time.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"Finally, the scripts are the only possible output when Dry sessions are used (i.e. when gnuplot is not available in the user platform.","category":"page"},{"location":"examples/#Examples-1","page":"Examples","title":"Examples","text":"","category":"section"},{"location":"examples/#","page":"Examples","title":"Examples","text":"An exhaustive gallery of example is available here:","category":"page"},{"location":"examples/#","page":"Examples","title":"Examples","text":"https://lazarusa.github.io/gnuplot-examples/","category":"page"},{"location":"examples/#","page":"Examples","title":"Examples","text":"Further gnuplot examples can be found here: http://www.gnuplotting.org/","category":"page"},{"location":"advanced/#Advanced-techniques-1","page":"Advanced techniques","title":"Advanced techniques","text":"","category":"section"},{"location":"advanced/#Multiplot-1","page":"Advanced techniques","title":"Multiplot","text":"","category":"section"},{"location":"advanced/#Mixing-2D-and-3D-plots-1","page":"Advanced techniques","title":"Mixing 2D and 3D plots","text":"","category":"section"},{"location":"advanced/#","page":"Advanced techniques","title":"Advanced techniques","text":"\n@gp \"set multiplot layout 1,2\"\n@gp :- 1 \"plot sin(x) w l\"\n\n\nx = y = -10:0.33:10\nfz(x,y) = sin.(sqrt.(x.^2 + y.^2))./sqrt.(x.^2+y.^2)\nfxy = [fz(x,y) for x in x, y in y]\n\n@gsp :- 2 x y fxy \"w pm3d notit\"\n","category":"page"},{"location":"advanced/#Multiple-processes-1","page":"Advanced techniques","title":"Multiple processes","text":"","category":"section"},{"location":"advanced/#Named-datasets-1","page":"Advanced techniques","title":"Named datasets","text":"","category":"section"},{"location":"advanced/#Histograms-(1D)-1","page":"Advanced techniques","title":"Histograms (1D)","text":"","category":"section"},{"location":"advanced/#Histograms-(2D)-1","page":"Advanced techniques","title":"Histograms (2D)","text":"","category":"section"},{"location":"advanced/#Contour-lines-1","page":"Advanced techniques","title":"Contour lines","text":"","category":"section"},{"location":"advanced/#Animations-1","page":"Advanced techniques","title":"Animations","text":"","category":"section"},{"location":"advanced/#Dry-sessions-1","page":"Advanced techniques","title":"Dry sessions","text":"","category":"section"},{"location":"advanced/#Options-1","page":"Advanced techniques","title":"Options","text":"","category":"section"},{"location":"install/#Installation-1","page":"Installation","title":"Installation","text":"","category":"section"},{"location":"install/#Prerequisite-1","page":"Installation","title":"Prerequisite","text":"","category":"section"},{"location":"install/#","page":"Installation","title":"Installation","text":"In order to use the Gnuplot.jl package you'll need gnuplot (ver. >= 4.7) installed on your system, and its executable available in your path.","category":"page"},{"location":"install/#","page":"Installation","title":"Installation","text":"If gnuplot is not available in your platform you can still use Gnuplot.jl in \"dry\" mode (see Dry sessions). In this case a plot can not be generated, but you may still generate Gnuplot scripts.","category":"page"},{"location":"install/#Package-installation-1","page":"Installation","title":"Package installation","text":"","category":"section"},{"location":"install/#","page":"Installation","title":"Installation","text":"In the Julia REPL type:","category":"page"},{"location":"install/#","page":"Installation","title":"Installation","text":"julia> ]add Gnuplot","category":"page"},{"location":"install/#","page":"Installation","title":"Installation","text":"Then hit backspace key to return to Julia REPL.","category":"page"},{"location":"install/#Check-installation-1","page":"Installation","title":"Check installation","text":"","category":"section"},{"location":"install/#","page":"Installation","title":"Installation","text":"Check execution and version of the underlying gnuplot process:","category":"page"},{"location":"install/#","page":"Installation","title":"Installation","text":"julia> using Gnuplot\njulia> Gnuplot.gpversion()","category":"page"},{"location":"install/#","page":"Installation","title":"Installation","text":"Generate the first plot:","category":"page"},{"location":"install/#","page":"Installation","title":"Installation","text":"julia> @gp 1:9","category":"page"},{"location":"#Gnuplot.jl-1","page":"Home","title":"Gnuplot.jl","text":"","category":"section"},{"location":"#A-Julia-interface-to-Gnuplot.-1","page":"Home","title":"A Julia interface to Gnuplot.","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"The Gnuplot.jl package allows easy and fast use of gnuplot as a data visualization tool in Julia. Have a look at Basic usage and Examples for a quick overview. The package main features are:","category":"page"},{"location":"#","page":"Home","title":"Home","text":"fast time-to-first-plot (~1 sec);\nextremely concise yet meaningful syntax, makes it ideal for interactive data exploration;\nno 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;\ntransparent interface between Julia and gnuplot to exploit all functionalities of the latter, both present and future ones;\nfast data transmission through system pipes (no temporary files involved);\navailability of all the palettes from ColorSchemes;\nsupport for multiple plots in one window, multiple plotting windows, as well as ASCII and Sixel plots (to plot directly in a terminal);\nsupport for histograms (both 1D and 2D);\nenhanced support for contour plots;\nexport to a huge number of formats such as pdf, png, LaTeX, svg, etc. (actually all those supported by gnuplot);\nsave sessions into gnuplot scripts enables easy plot reproducibility and modifications.","category":"page"},{"location":"#Yet-another-plotting-package?-1","page":"Home","title":"Yet another plotting package?","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"A powerful plotting 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.","category":"page"},{"location":"#","page":"Home","title":"Home","text":"Gnuplot.jl package fills the niche of users who needs:","category":"page"},{"location":"#","page":"Home","title":"Home","text":"publication-quality plots, by exploiting the capabilities of a widely used tool such as gnuplot, and its many output formats available;\na well-documented framework, by taking advantage of all the gnuplot documentation, tutorials and examples available on the web;\na fast response, by relying on an external program (rather than on a large Julia code base);\nan interactive data exploration framework, by exposing a carefully designed, extremely concise and easy to remember syntax (at least for users with minimal gnuplot knowledge);\na procedure to foster plot reproducibility by sharing just the data and commands in the form of gnuplot scripts, rather than the original Julia code.","category":"page"},{"location":"#","page":"Home","title":"Home","text":"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).","category":"page"},{"location":"#","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#","page":"Home","title":"Home","text":"The functionalities 1, 2 and 3 listed above are similar to those provided by the Gaston package. Gnuplot.jl also provides features 4 and 5, as well as the minimalistic approach.","category":"page"},{"location":"#Do-Gnuplot.jl-suits-my-needs?-1","page":"Home","title":"Do Gnuplot.jl suits my needs?","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"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). 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.","category":"page"},{"location":"#","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#","page":"Home","title":"Home","text":"Last but not least, have a look at the Gnuplot.jl Examples page.","category":"page"},{"location":"#Notation-1","page":"Home","title":"Notation","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"In this documentation:","category":"page"},{"location":"#","page":"Home","title":"Home","text":"Gnuplot.jl refers to the Julia package;\ngnuplot refers to the gnuplot application.","category":"page"},{"location":"#Table-of-Contents-1","page":"Home","title":"Table of Contents","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Pages = [\"index.md\", \"install.md\", \"basic.md\", \"advanced.md\", \"examples.md\", \"api.md\"]","category":"page"}]
}