pole.gle
Library about polar plots and grids.
Copyright (c) 2020 Francois Tonneau
License: MIT
INTRODUCTION
This GLE library provides subroutines for plotting polar functions or polar
datasets read from a text file. Numeric values are plotted on a "wheel" which
may cover fewer than 360 degrees and may also be perforated at its center. The
colored background for plotting may coincide with the entire wheel or with
only an angular subset of it (the "fan"). The wheel can be decorated with
rays, rings, or threads pinned at regular angles (as in a spider web). The
wheel can also be annotated with angle values, arbitrary labels around the
outer wheel border, and tags along any ray of the wheel.
The labels around the wheel must be specified in a text file, either along the
data to be plotted or in a separated file. In all cases, the file must contain
on each line:
label angle count datum1 datum2 datum3 ...
where 'label' is the label for the current angle and where 'count' tells how
many data values appear on the remainder of the line. For example:
East 90 3 0.53 0.10 0.37
^-- angle ^-- count ^..................^.. data
An empty label should be replaced by two dashes. For example:
-- 90 3 0.53 0.10 0.37
Each line of a file used to specify labels instead of data must end with a
zero data count. For example:
North 0 0
East 90 0
^-- label ^-- angle
SUBROUTINE SUMMARY
wheelcenter x y # x, y coordinates in cm
wheeldims inner outer # inner, outer dimensions in cm
wheelvalues inner outer # [inner, outer] = numeric data range
startangles at going$ # 'going' = clockwise|counterclockwise
stopangles at
setfan from to # from, to: angles that limit clothing
resetfan # => fan coincides with whole wheel
fillcloth fill$
drawclothcontour
drawrings from to by no$ # write 'no last' to omit last value
drawsomerings p0$ p1$ p2$ p3$ p4$ p5$ p6$ p7$ p8$ p9$ # => up to 10 values
drawrays from to by no$ # write 'no last' to omit last value
drawsomerays p0$ p1$ p2$ p3$ p4$ p5$ p6$ p7$ p8$ p9$ # => up to 10 values
ticklength length
drawticks from to by no$ # write 'no last' to omit last value
drawsometicks p0$ p1$ p2$ p3$ p4$ p5$ p6$ p7$ p8$ p9$ # => up to 10 values
fillweb fill$ pin # 'pin': angle at which a web thread is pinned
drawthreads from to by pin # from, to, by: from inner to outer values
drawthreadaround pin # puts a pinned thread on the outer border
angleformat format$
writeangles from to by no$
writesomeangles p0$ p1$ p2$ p3$ p4$ p5$ p6$ p7$ p8$ p9$
labelstyle dist just$ # 'just' = basic|circular|radial|textual
writelabelsfrom filename$
tagstyle xoffset yoffset just$ format$ rotate$
writetags at from to by no$ # write 'no last' to omit last value
writesometags at p0$ p1$ p2$ p3$ p4$ p5$ p6$ p7$ p8$ p9$ # => up to 10 values
drawpolareq expr$ from to step color$ lwidth lstyle fill$
drawpolarline dataset$ color$ lwidth lstyle fill$ from to close$
drawpolarpoints dataset$ marker$ color$ msize lwidth from to
drawpolarimpulses number dataset$ color$ lwidth lstyle arrow$ from to
drawpolarerrors dataset$ errset$ pos$ color$ lwidth lstyle errwidth from to
drawpolarhist filename$ width color$ lwidth direction$
drawpolarmosaic filename$ expr$ width height color$ lwidth
xpp value angle # return x coordinate in cm
ypp value angle # return y coordinate in cm
movepp value angle # move to (value, angle) point
linepp value angle arrow$ # line to (value, angle) point
Private variables
Private subroutines
Public subroutines
Spiderweb drawing only supports full circles (from 0 to 360 degrees).