Gnuplot.jl/dev/api/index.html
Giorgio Calderone a180e1ad80 Docs updated
2020-03-26 13:00:24 +01:00

8 lines
14 KiB
HTML

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>API · Gnuplot.jl</title><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="Gnuplot.jl logo"/></a><div class="docs-package-name"><span class="docs-autofit">Gnuplot.jl</span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../install/">Installation</a></li><li><a class="tocitem" href="../basic/">Basic usage</a></li><li><a class="tocitem" href="../advanced/">Advanced techniques</a></li><li><a class="tocitem" href="../tips/">Tips</a></li><li><a class="tocitem" href="../examples/">Examples</a></li><li class="is-active"><a class="tocitem" href>API</a><ul class="internal"><li><a class="tocitem" href="#Exported-symbols-1"><span>Exported symbols</span></a></li><li><a class="tocitem" href="#Non-exported-symbols-1"><span>Non-exported symbols</span></a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>API</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>API</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/gcalderone/Gnuplot.jl/blob/master/docs/src/api.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="API-1"><a class="docs-heading-anchor" href="#API-1">API</a><a class="docs-heading-anchor-permalink" href="#API-1" title="Permalink"></a></h1><h2 id="Exported-symbols-1"><a class="docs-heading-anchor" href="#Exported-symbols-1">Exported symbols</a><a class="docs-heading-anchor-permalink" href="#Exported-symbols-1" title="Permalink"></a></h2><p>The list of <strong>Gnuplot.jl</strong> exported symbols is as follows:</p><article class="docstring"><header><a class="docstring-binding" id="Gnuplot.@gp" href="#Gnuplot.@gp"><code>Gnuplot.@gp</code></a><span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia">@gp args...</code></pre><p>The <code>@gp</code> macro, and its companion <code>@gsp</code> for 3D plots, allows to send data and commands to the <em>gnuplot</em> using an extremely concise syntax. The macros accepts any number of arguments, with the following meaning:</p><ul><li><p>one, or a group of consecutive, array(s) build up a dataset. The different arrays are accessible as columns 1, 2, etc. from the <code>gnuplot</code> process. The number of required input arrays depends on the chosen plot style (see <code>gnuplot</code> documentation);</p></li><li><p>a string occurring before a dataset is interpreted as a <code>gnuplot</code> command (e.g. <code>set grid</code>);</p></li><li><p>a string occurring immediately after a dataset is interpreted as a <em>plot element</em> for the dataset, by which you can specify <code>using</code> clause, <code>with</code> clause, line styles, etc.. All keywords may be abbreviated following <em>gnuplot</em> conventions. Moreover, &quot;plot&quot; and &quot;splot&quot; can be abbreviated to &quot;p&quot; and &quot;s&quot; respectively;</p></li><li><p>the special symbol <code>:-</code>, 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;</p></li><li><p>any other symbol is interpreted as a session ID;</p></li><li><p>an <code>Int</code> (&gt; 0) is interpreted as the plot destination in a multi-plot session (this specification applies to subsequent arguments, not previous ones);</p></li><li><p>an input in the form <code>keyword=value</code> is interpreted as a keyword/value pair. The accepted keywords and their corresponding <em>gnuplot</em> commands are as follows:</p><ul><li><code>xrange=[low, high]</code> =&gt; <code>&quot;set xrange [low:high]</code>;</li><li><code>yrange=[low, high]</code> =&gt; <code>&quot;set yrange [low:high]</code>;</li><li><code>zrange=[low, high]</code> =&gt; <code>&quot;set zrange [low:high]</code>;</li><li><code>cbrange=[low, high]</code>=&gt; <code>&quot;set cbrange[low:high]</code>;</li><li><code>key=&quot;...&quot;</code> =&gt; <code>&quot;set key ...&quot;</code>;</li><li><code>title=&quot;...&quot;</code> =&gt; <code>&quot;set title &quot;...&quot;&quot;</code>;</li><li><code>xlabel=&quot;...&quot;</code> =&gt; <code>&quot;set xlabel &quot;...&quot;&quot;</code>;</li><li><code>ylabel=&quot;...&quot;</code> =&gt; <code>&quot;set ylabel &quot;...&quot;&quot;</code>;</li><li><code>zlabel=&quot;...&quot;</code> =&gt; <code>&quot;set zlabel &quot;...&quot;&quot;</code>;</li><li><code>xlog=true</code> =&gt; <code>set logscale x</code>;</li><li><code>ylog=true</code> =&gt; <code>set logscale y</code>;</li><li><code>zlog=true</code> =&gt; <code>set logscale z</code>.</li></ul></li></ul><p>All Keyword names can be abbreviated as long as the resulting name is unambiguous. E.g. you can use <code>xr=[1,10]</code> in place of <code>xrange=[1,10]</code>;</p><ul><li>an input in the form <code>&quot;name&quot;=&gt;(array1, array2, etc...)</code> is interpreted as a named dataset.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/gcalderone/Gnuplot.jl/blob/fb7c00eac02f105bab21c30c9b77273e7c8df741/src/Gnuplot.jl#L849-L882">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Gnuplot.@gsp" href="#Gnuplot.@gsp"><code>Gnuplot.@gsp</code></a><span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia">@gsp args...</code></pre><p>This macro accepts the same syntax as <a href="#Gnuplot.@gp"><code>@gp</code></a>, but produces a 3D plot instead of a 2D one.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/gcalderone/Gnuplot.jl/blob/fb7c00eac02f105bab21c30c9b77273e7c8df741/src/Gnuplot.jl#L900-L904">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Gnuplot.save" href="#Gnuplot.save"><code>Gnuplot.save</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">save(sid::Symbol; term=&quot;&quot;, output=&quot;&quot;)
save(sid::Symbol, script_filename::String, ;term=&quot;&quot;, output=&quot;&quot;)
save(; term=&quot;&quot;, output=&quot;&quot;)
save(script_filename::String ;term=&quot;&quot;, output=&quot;&quot;)</code></pre><p>Export a (multi-)plot into the external file name provided in the <code>output=</code> keyword. The <em>gnuplot</em> terminal to use is provided through the <code>term=</code> keyword.</p><p>If the <code>script_filename</code> argument is provided a <em>gnuplot script</em> will be written in place of the output image. The latter can then be used in a pure <em>gnuplot</em> session (Julia is no longer needed) to generate exactly the same original plot.</p><p>If the <code>sid</code> argument is provided the operation applies to the corresponding session.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/gcalderone/Gnuplot.jl/blob/fb7c00eac02f105bab21c30c9b77273e7c8df741/src/Gnuplot.jl#L914-L925">source</a></section></article><h2 id="Non-exported-symbols-1"><a class="docs-heading-anchor" href="#Non-exported-symbols-1">Non-exported symbols</a><a class="docs-heading-anchor-permalink" href="#Non-exported-symbols-1" title="Permalink"></a></h2><p>The following functions are not exported by the <strong>Gnuplot.jl</strong> 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.</p><p>In order to call these functions you should add the <code>Gnuplot.</code> prefix to the function name.</p><article class="docstring"><header><a class="docstring-binding" id="Gnuplot.exec" href="#Gnuplot.exec"><code>Gnuplot.exec</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">Gnuplot.exec(sid::Symbol, command::String)
Gnuplot.exec(command::String)</code></pre><p>Execute the <em>gnuplot</em> command <code>command</code> on the underlying <em>gnuplot</em> process of the <code>sid</code> session, and return the results as a <code>Vector{String}</code>. If a <em>gnuplot</em> error arises it is propagated as an <code>ErrorException</code>.</p><p>The <code>sid</code> argument is (optional): if not given, <code>:default</code> is used.</p><p><strong>Examples:</strong></p><pre><code class="language-julia-repl">Gnuplot.exec(&quot;print GPVAL_TERM&quot;)
Gnuplot.exec(&quot;plot sin(x)&quot;)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/gcalderone/Gnuplot.jl/blob/fb7c00eac02f105bab21c30c9b77273e7c8df741/src/Gnuplot.jl#L803-L816">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Gnuplot.gpversion" href="#Gnuplot.gpversion"><code>Gnuplot.gpversion</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">Gnuplot.gpversion()</code></pre><p>Returns the <em>gnuplot</em> application version.</p><p>Raise an error if version is &lt; 4.7 (required to use data blocks).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/gcalderone/Gnuplot.jl/blob/fb7c00eac02f105bab21c30c9b77273e7c8df741/src/Gnuplot.jl#L768-L774">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Gnuplot.quit" href="#Gnuplot.quit"><code>Gnuplot.quit</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">Gnuplot.quit(sid::Symbol)</code></pre><p>Quit the session identified by <code>sid</code> and the associated gnuplot process (if any).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/gcalderone/Gnuplot.jl/blob/fb7c00eac02f105bab21c30c9b77273e7c8df741/src/Gnuplot.jl#L822-L826">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Gnuplot.quitall" href="#Gnuplot.quitall"><code>Gnuplot.quitall</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">Gnuplot.quitall()</code></pre><p>Quit all the sessions and the associated <em>gnuplot</em> processes.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/gcalderone/Gnuplot.jl/blob/fb7c00eac02f105bab21c30c9b77273e7c8df741/src/Gnuplot.jl#L837-L841">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Gnuplot.version" href="#Gnuplot.version"><code>Gnuplot.version</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">Gnuplot.version()</code></pre><p>Returns the <strong>Gnuplot.jl</strong> package version.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/gcalderone/Gnuplot.jl/blob/fb7c00eac02f105bab21c30c9b77273e7c8df741/src/Gnuplot.jl#L760-L764">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../examples/">« Examples</a></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Thursday 26 March 2020 12:59">Thursday 26 March 2020</span>. Using Julia version 1.3.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>