-
Notifications
You must be signed in to change notification settings - Fork 86
glgui recurrence
Matthias Görges edited this page Apr 15, 2015
·
3 revisions
glgui-recurrence adds a recurrence 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 |
data | List (or list of two lists) of data to be plotted |
color | Colormap to be used (GRADIENT_THERMAL if White, GRADIENT_GRAY otherwise) |
bgcolor | Optional: The widget background color |
Example 1: Draw a simple recurrence plot for 200msec of a 8Hz signal.
(set! gui:main (make-glgui))
(define pi (* (atan 1) 4))
(define data (let loop ((i 0) (ret '()))
(if (fx= i 100)
ret
(loop (fx+ i 1) (append ret (list (sin (/ (* 2 pi 8 i) 1000))))))
))
(glgui-recurrence gui 100 100 200 200 data White))
Example 2: Show the recurrance plot for two signals: 7Hz and 7+35 Hz.
(set! gui:main (make-glgui))
(define pi (* (atan 1) 4))
(define data1 (let loop ((i 0) (ret '()))
(if (fx= i 300)
ret (loop (fx+ i 1)
(append ret (list (sin (/ (* 2 pi 7 i) 1000))))))
))
(define data2 (let loop ((i 0) (ret '()))
(if (fx= i 300)
ret
(loop (fx+ i 1) (append ret (list (+ (list-ref data1 i)
(sin (/ (* 2 pi 35 i) 1000)))))))
))
(define data (list data1 data2))
(glgui-recurrence gui 0 0 300 300 data Red Blue))
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 |
---|---|---|
gradient | (if (= color White) GRADIENT_THERMAL GRADIENT_GRAY) | Colorspace used for plotting |
-
- accelerometer
- alist
- audio
- audioaux
- base64
- btle-scan
- camera
- cdb
- cgi
- config
- csv
- curl
- digest
- dmtx
- download
- eventloop
- fcgi
- fft
- generalized-arrays
- gps
- graph
- gyro
- hidapi
- hpdf
- html
- httpsclient
- hybridapp
- json
- lmdb
- ln_core
- ln_glcore
- ln_glgui
- ln_store
- localization
- localization_gui
- localnotification
- magnetometer
- mdns
- mqtt
- mqtt-store
- multitouch
- oauth
- orientation
- p256ecdsa
- png
- portaudio
- pregexp
- pressure
- prime
- pushnotification
- redcap
- rsa
- rtaudio
- rupi
- rotation
- sanestring
- scheduler
- serial
- sets
- settings
- simplexnoise
- sqlite
- ssax
- syntax-case
- timestamp
- ttf
- uiform
- url
- uuid
- vibrate
- videoplayer
- watchdog
- website
- xml
- zip