LINE: Draw scatter diagrams; line charts; contour lines; histograms; topographic maps etc. (H+)

⇒Help ⇒Contents ⇒Graphics (⇒Optional Keywords Syntax)

Bookmarks:
  ⇒appearance of lines   ⇒bar charts   ⇒decorate area   ⇒draw_line   ⇒fill area   ⇒function plot   ⇒histograms   ⇒line_drawing options   ⇒move pen   ⇒pie charts   ⇒plot vector   ⇒poly-line   ⇒step plot   ⇒text_draw   ⇒topographic maps

Optional keywords:
Axis BaCkcolor Color DaSH Draw Line lineWidth NoLine NoZero OneWay PenUp Points PRint STeps Symbol SymbolDiameter Text X Y
optional keyword type mini Basic

line_drawing options


¹ values incremented by next Y=.., ² passed on to next Y=...

X

num x=xpos x coordinate to

draw_line

or

move pen

to (PenUP) ²
  • LINE(PenUp, x=1, y=82) ! move (invisibly) to (1,82)
  • LINE(x=8, y=4) ! draw from current (x,y) to (8,4)
  • LINE(PenUp, x=0, y=0, x=10, y=100) ! draw from (0,0) to (10,100)
arr x=xVect x values for

poly-line

²

Y

num y=ypos y coordinate to draw or move to
  • ! draw 3 lines a, b, c at the same x=xpos:
  • LINE(x=xpos, y=a, y=b, y=c) ! this could be in a DO loop
  • ! (Colors and Symbols are auto-incremented)
arr y=yVect y values for a poly-line
  • AXIS() ! draw an all default xy coordinates system
  • yVect = $^2 ! = 1, 4, 9, 16, ...
  • LINE(Y=yVect) ! yVect is plotted versus 1, 2, 3, 4, ...
  • LINE(X=xVect, Y=yVect) ! yVect is plotted versus xVect

Points

num p=n

function plot

Y = f(xpos) with n values in the limits of the current x-axis min/max settings.
  • AXIS(MiN=0, MaX=6, Title="x", Y=14, Title="SIN(x)"
  • LINE(X=var, Y=SIN(var), Points=100, Color=1, Width=5)

Line

num l=0 line identification number 0...31, default is Line=0. Useful when not all current lines are updated in a single statement. ¹

Axis

[1] a=3 axis identification 1....8, default=1, set and drawn by AXIS(). Needed to draw curves in more than 1 xy-system. ²
Draw

histograms

,

bar charts

,

pie charts

,

topographic maps

etc.

BaCkcolor

num bc=3.21
  • fill area

    and

    decorate area

    enclosed by xVect and yVect
  • BaCkcolor is coded as COLOR.STYLE HATCH
  • e.g. BC=3.21: COLOR=3=cyan, STYLE=2=hatched, HATCH=1=lll
  • for COLOR see Colors
  • STYLE: 0=solid, 1=transparent, 2=hatched
  • HATCH: 0=, 1=lll, 2=\\\, 3=///, 4:+++, >4=/\/\
  • the outline of the polygon is set by the Color option
    • SUBROUTINE PlotBar(x, y, ColStyHat)
    • DIMENSION xbar(4), ybar(4)
    • xbar = (x-x/8, x+x/8, x+x/8, x-x/8)
    • ybar = (0, 0, y, y)
    • LINE(X=xbar, Y=ybar, BaCkcolor=ColStyHat, Width=x, Color=x)
    • END
    • AXIS(Grid=1, Y, Grid=1, Height=1/3)
    • CALL PlotBar(1, 9.1, 1.00)
    • CALL PlotBar(3, 8.2, 2.00)
    • CALL PlotBar(5, 6.2, 3.10)
    • CALL PlotBar(8, 4.3, 4.25)
  • An interactive demo of contour plotting is found in Tutorial.hic(Contours). Arrays xvec and yvec are variied in a loop along with colors and LINE is called:
    • LINE(X=xvec, Y=yvec, C=outline_color, BC=fillcolor)
Changing the

appearance of lines

. Options are in effect until changed or until the x-y coordinate system is redrawn by a new call to AXIS(...)

Color

num c=1 for color values see Colors ¹
  • LINE(Color=16+1, Y=yvec) ! draw yvec soft blue

DaSH

num dsh=0 0=solid, 1=--- 2=... 3=-.-.-. 4:-..-.. (works only with lineWidth=1) ²
  • LINE(DaSH=2, Y=yvec, DaSH=3, Y=zvec) ! draw yvec dotted, zvec dash-dot

lineWidth

num w=8 line width, default = 2 (W <= 1 for dashed lines) ²
  • LINE(lineWidth=12, Color=1, Y=yvec, W=3, C=14, Y=yvec) ! draw blue 12 pixel yvec, fill with yellow 3 pixel yvec

NoLine

[T] nl no line drawn between data points. Data points are shown by Symbol only ²

NoZero

[T] nz=1 no plot of y == 0 data to avoid a corrupted graph caused by sparse data ²

OneWay

num ow=-1
  • OneWay=0 (default): connecting line between all data points
  • OneWay=1: a connecting line only if X(n) <= X(n+1)
  • OneWay=-1: a connecting line only if X(n) >= X(n+1)

PenUp

[T] pu PenUp or PenUp=1: move only, no draw, PenUp=0: draw ²

STeps

[T] st

step plot

²: steplike line between data points, i.e. (X1,Y1) --> (X2,Y1) --> (X2,Y2)

Symbol

num s=65 draw symbol at current (x,y):
  • 1=square, 2=diamond, 3=octagon, 4=Xsquare, 5=+diamond, 6=+octagon, 7=triangle up, 8=triangle down, 9=arrow up, 10=arrow down, 11=/, 12=\, 13=X, 14=-, 15=l, 16=+, 17=*,
  • 33...128 ASCII,
  • -1...-255 ASCII character of currently selected Windows font ¹
  • LINE(Symbol=-ICHAR("A"), Y=yvec, Y=zvec) ! vector yvec with "A" symbols, zvec with "B" symbols

SymbolDiameter

num sd=1 Size of symbols, default = 3 (approx. 3 mm) ²

text_draw

to x-y graphs:

Text

txt t="note" write at X,Y (default: horizontal, left adjust)
  • LINE(X=10, Y=10, Text="start", Draw=2+4) ! move to (10,10), draw text vertical right-aligned
num t=12.3 write "12.3" at position X,Y

Draw

num d=type type= +1 (vertical) +2 (right adjust) +4 (pen up) +8 (X,Y in characters from bottom left of frame)
  • LINE(X=5, Y=1.33, Text="1.33 character heights from bottom", Draw=8)

print x-y graphs

:

PRint

num pr=1+8 for details see Print



©2000-2008 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.
Impressum