4 lines
33 KiB
JavaScript
4 lines
33 KiB
JavaScript
var documenterSearchIndex = {"docs":
|
|
[{"location":"api/#API-1","page":"API","title":"API","text":"","category":"section"},{"location":"api/#Exported-symbols-1","page":"API","title":"Exported symbols","text":"","category":"section"},{"location":"api/#","page":"API","title":"API","text":"The list of Gnuplot.jl exported symbols is as follows:","category":"page"},{"location":"api/#","page":"API","title":"API","text":"@gp\n@gsp\nsave","category":"page"},{"location":"api/#Gnuplot.@gp","page":"API","title":"Gnuplot.@gp","text":"@gp args...\n\nThe @gp macro, and its companion @gsp for 3D plots, allows to send data and commands to the gnuplot using an extremely concise syntax. The macros accepts any number of arguments, with the following meaning:\n\none, 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.. All keywords may be abbreviated following gnuplot conventions. Moreover, \"plot\" and \"splot\" can be abbreviated to \"p\" and \"s\" respectively;\nthe special symbol :-, whose meaning is to avoid starting 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;\nany other symbol is interpreted as a session ID;\nan Int (> 0) is interpreted as the plot destination in a multi-plot session (this specification applies to subsequent arguments, not previous ones);\nan input in the form keyword=value is interpreted as a keyword/value pair. The accepted keywords and their corresponding gnuplot commands are as follows:\nxrange=[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.\n\nAll Keyword names can be abbreviated as long as the resulting name is unambiguous. E.g. you can use xr=[1,10] in place of xrange=[1,10];\n\nan input in the form \"name\"=>(array1, array2, etc...) is interpreted as a named dataset.\n\n\n\n\n\n","category":"macro"},{"location":"api/#Gnuplot.@gsp","page":"API","title":"Gnuplot.@gsp","text":"@gsp args...\n\nThis macro accepts the same syntax as @gp, but produces a 3D plot instead of a 2D one.\n\n\n\n\n\n","category":"macro"},{"location":"api/#Gnuplot.save","page":"API","title":"Gnuplot.save","text":"save(sid::Symbol; term=\"\", output=\"\")\nsave(sid::Symbol, script_filename::String, ;term=\"\", output=\"\")\nsave(; term=\"\", output=\"\")\nsave(script_filename::String ;term=\"\", output=\"\")\n\nExport a (multi-)plot into the external file name provided in the output= keyword. The gnuplot terminal to use is provided through the term= keyword.\n\nIf the script_filename argument is provided a gnuplot script will be written in place of the output image. The latter can then be used in a pure gnuplot session (Julia is no longer needed) to generate exactly the same original plot.\n\nIf the sid argument is provided the operation applies to the corresponding session.\n\n\n\n\n\n","category":"function"},{"location":"api/#Non-exported-symbols-1","page":"API","title":"Non-exported symbols","text":"","category":"section"},{"location":"api/#","page":"API","title":"API","text":"The following functions are not exported by the Gnuplot.jl package since they are typically not used in every day work, or aimed to debugging purposes. Still, they can be useful in some case, hence they are documented here.","category":"page"},{"location":"api/#","page":"API","title":"API","text":"In order to call these functions you should add the Gnuplot. prefix to the function name.","category":"page"},{"location":"api/#","page":"API","title":"API","text":"Gnuplot.exec\nGnuplot.gpversion\nGnuplot.quit\nGnuplot.quitall\nGnuplot.version","category":"page"},{"location":"api/#Gnuplot.exec","page":"API","title":"Gnuplot.exec","text":"Gnuplot.exec(sid::Symbol, command::String)\nGnuplot.exec(command::String)\n\nExecute the gnuplot command command on the underlying gnuplot process of the sid session, and return the results as a Vector{String}. If a gnuplot error arises it is propagated as an ErrorException.\n\nThe sid argument is (optional): if not given, :default is used.\n\nExamples:\n\nGnuplot.exec(\"print GPVAL_TERM\")\nGnuplot.exec(\"plot sin(x)\")\n\n\n\n\n\n","category":"function"},{"location":"api/#Gnuplot.gpversion","page":"API","title":"Gnuplot.gpversion","text":"Gnuplot.gpversion()\n\nReturns the gnuplot application version.\n\nRaise an error if version is < 4.7 (required to use data blocks).\n\n\n\n\n\n","category":"function"},{"location":"api/#Gnuplot.quit","page":"API","title":"Gnuplot.quit","text":"Gnuplot.quit(sid::Symbol)\n\nQuit the session identified by sid and the associated gnuplot process (if any).\n\n\n\n\n\n","category":"function"},{"location":"api/#Gnuplot.quitall","page":"API","title":"Gnuplot.quitall","text":"Gnuplot.quitall()\n\nQuit all the sessions and the associated gnuplot processes.\n\n\n\n\n\n","category":"function"},{"location":"api/#Gnuplot.version","page":"API","title":"Gnuplot.version","text":"Gnuplot.version()\n\nReturns the Gnuplot.jl package version.\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 starting 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/#plots2d-1","page":"Basic usage","title":"2D plots","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/#","page":"Basic usage","title":"Basic usage","text":"Remember to run:","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"using Gnuplot","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"before running the examples.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"using Gnuplot\nGnuplot.quitall()\nmkdir(\"assets\")\nGnuplot.splash(\"assets/logo.png\")\nsaveas(file) = save(term=\"pngcairo size 480,360\", output=\"assets/$(file).png\")\nempty!(Gnuplot.options.init)\npush!(Gnuplot.options.init, \"set term unknown\")","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/#","page":"Basic usage","title":"Basic usage","text":"","category":"page"},{"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)\"\nsaveas(\"basic1\") # 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)\"\nsaveas(\"basic2\") # 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)\"\nsaveas(\"basic3\") # 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\nsaveas(\"basic4\") # 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'\"\nsaveas(\"basic5\") # 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'\"\nsaveas(\"basic6\") # 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\"\nsaveas(\"basic7a\") # 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\" \"set autoscale fix\" img \"u 2:(-\\$1):3:4:5 with rgbimage notit\"\nsave(term=\"jpeg size 480,360\", output=\"assets/basic7b.jpg\") # hide","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"(Image: )","category":"page"},{"location":"basic/#plots3d-1","page":"Basic usage","title":"3D plots","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./20 \"w p pt 7 ps var lc pal\"\nsaveas(\"basic8\") # 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-types-1","page":"Basic usage","title":"Palettes and line types","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./20 \"w p pt 7 ps var lc pal\"\nsaveas(\"basic8a\") # 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 types (actually just color attributes), by means of the linetypes() function, e.g.","category":"page"},{"location":"basic/#","page":"Basic usage","title":"Basic usage","text":"@gp linetypes(:deepsea)\nx = 1:0.1:4pi\nfor i in 1:5\n @gp :- x i.* sin.(x) \"w l notit lw 5\"\nend\nsaveas(\"basic9\") # 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=\"pngcairo size 480,360\", output=\"assets/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=\"assets/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-sessions-1","page":"Advanced techniques","title":"Multiple sessions","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":"using Gnuplot\nGnuplot.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 2D plots). 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"},{"location":"tips/#Tips-1","page":"Tips","title":"Tips","text":"","category":"section"},{"location":"tips/#","page":"Tips","title":"Tips","text":"This page collects useful tips in using Gnuplot.jl.","category":"page"},{"location":"tips/#Which-terminal-should-I-use-?-1","page":"Tips","title":"Which terminal should I use ?","text":"","category":"section"},{"location":"tips/#","page":"Tips","title":"Tips","text":"Gnuplot provides dozens of terminals to display and export plots. Here we report a few tips on how to exploit the most used terminals.","category":"page"},{"location":"tips/#wxt-and-qt-1","page":"Tips","title":"wxt and qt","text":"","category":"section"},{"location":"tips/#Mouse-interactions-1","page":"Tips","title":"Mouse interactions","text":"","category":"section"},{"location":"tips/#dumb-and-sixelgd-1","page":"Tips","title":"dumb and sixelgd","text":"","category":"section"},{"location":"tips/#cairopng-1","page":"Tips","title":"cairopng","text":"","category":"section"},{"location":"tips/#gif-1","page":"Tips","title":"gif","text":"","category":"section"},{"location":"tips/#","page":"Tips","title":"Tips","text":"see Animations.","category":"page"},{"location":"tips/#pdf-1","page":"Tips","title":"pdf","text":"","category":"section"},{"location":"tips/#latex-and-cairolatex-1","page":"Tips","title":"latex and cairolatex","text":"","category":"section"},{"location":"tips/#unknown-1","page":"Tips","title":"unknown","text":"","category":"section"},{"location":"tips/#","page":"Tips","title":"Tips","text":"This is a dummy terminal, it produces no output. It is mainly used for debugging purposes.","category":"page"}]
|
|
}
|