glgui scatterplot - part-cw/lambdanative GitHub Wiki
(glgui-scatterplot g x y w h xval yval color . axis)
glgui-scatterplot adds a scatter plot (dot plot) 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 to the screen.
(set! gui (make-glgui))
(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-scatterplot gui 0 300 300 300 x y Blue)
)
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 |