Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for [[/eggref/5/ploticus|the CHICKEN 5 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[https://wiki.call-cc.org/chicken-projects/egg-index-5.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[tags:egg]] == ploticus An interface to the ploticus library. [[toc:]] == Usage (require-extension ploticus) == Documentation [[http://ploticus.sourceforge.net|ploticus]] is software package for producing plots, charts, and graphics from data, which can generate PNG, GIF, JPEG, PostScript, EPS, SVG and SWF output formats. The Chicken {{ploticus}} library provides a Scheme interface to the {{ploticus}} procedures. This interface follows closely the {{ploticus}} API, so the main reference is the [[http://ploticus.sourceforge.net/doc/api.html|ploticus]] manual. === Parameters <procedure> procdebug:: [BOOL] => VOID </procedure> If this parameter is set to {{#t}}, every line of a ploticus procedure will be printed as it is executed. === Procedures <procedure> init:: SYMBOL * STRING => INTEGER </procedure> Initializes {{ploticus}}. The first argument is the output device, which is a symbol that can be one of 'png, 'gif, 'x11, 'svg, 'jpeg, 'eps, or 'swf. (Not all devices may be available, depending on the build.) The second argument is a string pathname of the file where the result will be written. <procedure> arg:: STRING [* STRING] => INTEGER </procedure> Specifies a [[http://ploticus.sourceforge.net/doc/pl.1.html#options|ploticus command line argument]]. The first argument specifies the argument name and the second is the argument value. If there is no argument value, the value is passed as empty string. Arguments {{-f}}, {{-prefab}}, and {{-ver}} are not supported. If needed, this procedure should be called after {{init}} but before any other ploticus procedure. <procedure> execline:: STRING => INTEGER </procedure> Executes one [[http://ploticus.sourceforge.net/doc/scripts.html|ploticus script line]]. Script lines can contain only these directives: {{#proc}}, {{#procdef}}, {{#endproc}}, {{#clone}} and {{#saveas}}. They cannot contain flow-of-control directives and do not undergo a variable-evaluation pass, so variables cannot be referenced, and select statements (etc.) that reference data field names should use one at sign (@) instead of two (@@). {{ploticus}} variables can be accessed by {{getvar}}, described below. An alternative is to use {{execscript}} (described below) to execute an entire script file. {{execline}} and {{execscript}} cannot be used in the same application. <procedure> execscript:: STRING => INTEGER </procedure> Executes an entire [[http://ploticus.sourceforge.net/doc/scripts.html|ploticus script file]]. The argument is the name of a ploticus script file. {{execscript}} and {{execline}} cannot be used in the same application. <procedure> execprefab:: STRING => INTEGER </procedure> Executes a [[http://ploticus.sourceforge.net/doc/prefabs.html|ploticus prefab]]. The argument is the name of the prefab. {{execprefab}} and {{execline}} cannot be used in the same application. <procedure> end:: VOID => INTEGER </procedure> Finishes up the plot, writes it to the output file, and frees up allocated memory. <procedure> getvar:: STRING => STRING </procedure> Returns the contents of the given {{ploticus}} variable name or {{#f}}. <procedure> setvar:: STRING * STRING => INTEGER </procedure> Sets the contents of the given {{ploticus}} variable name to the given value. <procedure> proc:: STRING * FIELD-LIST => INTEGER </procedure> A convenience procedure for {{#proc}} directives ([[http://ploticus.sourceforge.net/doc/scriptsyntax.html#directives|ploticus procedures]]). The first arguments is the name of the procedure, the second argument is a list of elements of the form (NAME . VALUE), where {{NAME}} is a field name, and {{VALUE}} is the corresponding field value. == Examples === Text annotation <enscript highlight=scheme> (use ploticus) (init "svg" "chicken.svg" ) (arg "-scale" "0.8") (for-each execline '("#proc annotate" "location: 2 2" "text: Chicken" "Scheme" "")) (end) </enscript> === Horizontal bars <enscript highlight=scheme> (use ploticus) (init "svg" "hbars.svg") (define data '((X . 1) (Y . 2) (Z . 3))) (proc "getdata" `(("data" . ,@(map (lambda (x) (sprintf "~S\t~A" (car x) (cdr x))) data)))) (proc "bars" `(("horizontalbars" . "yes") ("color" . "rgb(0,0.5,0.8)") ("lenfield" . "2") ("barwidth" . "0.3") ("labeldetails" . "adjust=0,-0.03 color=rgb(0,0.5,0.8)") ("showvalues" . "yes") )) (end) </enscript> == About this egg === Author [[/users/ivan-raikov|Ivan Raikov]] === Version history ; 1.1 : Added procdebug parameter ; 1.1 : Added proc ; 1.0 : Initial release === License Copyright 2011-2012 Ivan Raikov. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A full copy of the GPL license can be found at <http://www.gnu.org/licenses/>.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 2 by 2?