octive-lean/OctiveLean/PlotData.lean
Maximus Gorog db79eb3fde
Some checks are pending
Lean Action CI / build (push) Waiting to run
Initial commit: Lean 4 reimplementation of GNU Octave
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 09:40:46 -06:00

42 lines
1.3 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace OctiveLean
def plotColors : Array String := #[
"#1f77b4", "#ff7f0e", "#2ca02c", "#d62728",
"#9467bd", "#8c564b", "#e377c2", "#bcbd22"
]
inductive MarkType where
| line | scatter | bar | stem | histogram
| scatter3 -- 3-D scatter
| line3 -- 3-D line
| surface -- 3-D surface (mesh grid)
| waterfall -- waterfall / ribbon
| contour -- filled contour
deriving Repr, BEq, Inhabited
structure PlotSeries where
xData : Array Float := #[]
yData : Array Float := #[]
zData : Array Float := #[] -- empty for 2-D series
markType : MarkType := .line
label : String := ""
color : String := "#1f77b4"
-- for surface/contour: grid dimensions (rows × cols)
gridRows : Nat := 0
gridCols : Nat := 0
deriving Repr, Inhabited
structure Figure where
series : Array PlotSeries := #[]
title : String := ""
xlabel : String := ""
ylabel : String := ""
zlabel : String := ""
xRange : Option (Float × Float) := none
yRange : Option (Float × Float) := none
zRange : Option (Float × Float) := none
holdOn : Bool := false
is3D : Bool := false
deriving Repr, Inhabited
end OctiveLean