Skip to content
Matthias Görges edited this page May 11, 2015 · 1 revision

glgui-lineplot adds a line plot (or multiple line plots) to the screen.

Parameter Description
g The Graphical User Interface (GUI) this widget belongs to
x Lower left corner along the x-axis in pixels
y Lower left corner along the y-axis in pixels
w Width of the widget in pixels
h Height of the widget in pixels
xval List (or list of lists) of x-values to be plotted
yval List (or list of lists) of y-values to be plotted
color Dot color (or list of colors)
axis Optional: Axis limits '(xmin xmax ymin ymax)

Example

Example 1: Draw a simple line plot, in Red, as well as a lineplot with two lines, in Yellow and White, to the screen.

(let* ((w (glgui-width-get))
       (h (glgui-height-get))
       (dim (min (/ w 2) (/ h 2)))
       (x (list 0 1 2 3 4 5 5 6 7 8))
       (y (list 9 8 7 5 4 3 0 2 3 1))
      )
  (glgui-lineplot gui 0 0 300 300 x y Red)
  (glgui-lineplot gui 300 0 300 300 (list x y) (list y x) (list Yellow White) (list -5 15 -5 15))
)  

Attributes

Besides the parameters set in the above procedure, the widget has the following attributes that can be set using glgui-widget-set! and retrieved using glgui-widget-get:

Attribute Default Value Description
axiscolor (color-fade White 0.25) Color of x and y axis, drawn if axis are set
Clone this wiki locally