Skip to content

UI.PlotPoints

Name - Description Default Type
<input> A sequence of point coordinates. [Float2]
<output> The output of this shard will be its input. [Float2]
Name Name of this chart, displayed in the plot legend. None String
Color Stroke color. None Color&Color
Shape Shape of the marker. None MarkerShape
Radius Radius of the marker. None Float

Scattered points on a plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(def N 32)
(GFX.MainWindow
 :Contents
 (->
  (Setup
   (GFX.DrawQueue) >= .ui-draw-queue
   (GFX.UIPass .ui-draw-queue) >> .render-steps)
  (UI
   .ui-draw-queue
   (UI.CentralPanel
    (UI.Plot
     :Legend true
     :Contents
     (->
      [] >= .sin
      (ForRange
       (- N) N
       (->
        (ToFloat) (Math.Divide  (/ N 3.1415926535)) >= .x
        .x (Math.Sin) >= .y
        [.x .y] (ToFloat2) >> .sin))
      .sin (ExpectLike [(float2 0)])
      (UI.PlotPoints
       :Color (color 200 100 100)
       :Name "sin")))))

  (GFX.Render :Steps .render-steps)))