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 3, the unsupported old release. You're almost certainly looking for [[/eggref/4/charplot|the CHICKEN 4 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-4.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[toc:]] [[tags: egg]] == charplot === Introduction An extension for character-mode plotting (originally from SLIB). === Requirements [[http://code.call-cc.org/legacy-eggs/3/array-lib.html|array-lib]] === Documentation ==== charplot:dimensions [variable] charplot:dimensions A list of the maximum height (number of lines) and maximum width (number of columns) for the graph, its scales, and labels. The default value for {{charplot:dimensions}} is the {{output-port-height}} and {{output-port-width}} of {{current-output-port}}. ==== charplot-width, charplot-height [parameter] charplot-width [parameter] charplot-height The default width and height of the plot. Defaults to {{79}} and {{24}}, respectively. ==== plot [proedure] (plot coords x-label y-label) {{coords}} is a list or vector of coordinates, lists of x and y coordinates. {{x-label}} and {{y-label}} are strings with which to label the x and y axes. Example: (set! charplot:dimensions '(20 55)) (define (make-points n) (if (zero? n) '() (cons (list (/ n 6) (sin (/ n 6))) (make-points (sub1 n))))) (plot (make-points 40) "x" "Sin(x)") Sin(x) _________________________________________ 1|- **** | | ** ** | 0.75|- * * | | * * | 0.5|- * * | | * *| 0.25|- * * | | * * | 0|-------------------*------------------*--| | * | -0.25|- * * | | * * | -0.5|- * | | * * | -0.75|- * * | | ** ** | -1|- **** | |:_____._____:_____._____:_____._____:____| x 2 4 6 [procedure] (plot func x1 x2) [procedure] (plot func x1 x2 npts) Plots the function of one argument FUNC over the range X1 to X2. If the optional integer argument NPTS is supplied, it specifies the number of points to evaluate FUNC at. (plot sin 0 (* 2 3.14)) _________________________________________ 1|-: **** | | : ** ** | 0.75|-: * * | | : * * | 0.5|-: ** ** | | : * * | 0.25|-:** ** | | :* * | 0|-*------------------*--------------------| | : * * | -0.25|-: ** ** | | : * * | -0.5|-: * ** | | : * * | -0.75|-: * ** | | : ** ** | -1|-: **** | |_:_____._____:_____._____:_____._____:___| 0 2 4 6 ==== histograph [procedure] (histograph data label) Creates and displays a histogram of the numerical values contained in vector or list DATA (define (random:normal) (/ (- (random 2000) 1000) 1000) ) (histograph (do ((idx 99 (+ -1 idx)) (lst '() (cons (* .02 (random:normal)) lst))) ((negative? idx) lst)) "normal") _________________________________________ 8|- : I | | : I | 7|- I I : I | | I I : I | 6|- III I :I I | | III I :I I | 5|- IIIIIIIIII I | | IIIIIIIIII I | 4|- IIIIIIIIIIII | | IIIIIIIIIIII | 3|-I I I IIIIIIIIIIII II I | | I I I IIIIIIIIIIII II I | 2|-I I I IIIIIIIIIIIIIIIII I | | I I I IIIIIIIIIIIIIIIII I | 1|-II I I IIIIIIIIIIIIIIIIIIIII I I I | | II I I IIIIIIIIIIIIIIIIIIIII I I I | 0|-IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII----| |__.____:____.____:____.____:____.____:___| normal -0.025 0 0.025 0.05 === Authors Aubrey Jaffer, CHICKEN port by [[/users/felix winkelmann|felix winkelmann]] === License Copyright (C) 1992, 1993, 2001, 2003 Aubrey Jaffer Permission to copy this software, to modify it, to redistribute it, to distribute modified versions, and to use it for any purpose is granted, subject to the following restrictions and understandings. 1. Any copy made of this software must include this copyright notice in full. 2. I have made no warranty or representation that the operation of this software will be error-free, and I am under no obligation to provide any services, by way of maintenance, update, or otherwise. 3. In conjunction with products arising from the use of this material, there shall be no use of my name in any advertising, promotional, or sales literature without prior written consent in each case. === Version history ; 0.1 : first release
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you add 20 to 13?