mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
feat: enhance matplotlib
type defs
This commit is contained in:
parent
ea132e2345
commit
0b87a49b85
13 changed files with 38 additions and 0 deletions
|
@ -1 +1,4 @@
|
|||
.pyplot = pyimport "./pyplot"
|
||||
.scale = pyimport "./scale"
|
||||
|
||||
.use!: Str => NoneType
|
||||
|
|
3
crates/erg_compiler/lib/external/matplotlib.d/axes.d/__init__.d.er
vendored
Normal file
3
crates/erg_compiler/lib/external/matplotlib.d/axes.d/__init__.d.er
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
._axes = pyimport "./_axes"
|
||||
|
||||
.Axes! = ._axes.Axes!
|
21
crates/erg_compiler/lib/external/matplotlib.d/axes.d/_axes.d.er
vendored
Normal file
21
crates/erg_compiler/lib/external/matplotlib.d/axes.d/_axes.d.er
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
.Axes!: ClassType
|
||||
.Axes!.
|
||||
scatter!: (
|
||||
self: RefMut(.Axes!),
|
||||
x: Num, # TODO: Float | ArrayLike
|
||||
y: Num,
|
||||
s := Num,
|
||||
c := Iterable(Int),
|
||||
vmin := Float,
|
||||
vmax := Float,
|
||||
) => NoneType
|
||||
set!: (
|
||||
self: RefMut(.Axes!),
|
||||
xlabel := Str,
|
||||
xlim := (Float, Float),
|
||||
xticks := Iterable(Obj),
|
||||
ylabel := Str,
|
||||
ylim := (Float, Float),
|
||||
yticks := Iterable(Obj),
|
||||
title := Str
|
||||
) => NoneType
|
1
crates/erg_compiler/lib/external/matplotlib.d/figure.d.er
vendored
Normal file
1
crates/erg_compiler/lib/external/matplotlib.d/figure.d.er
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.Figure: ClassType
|
0
crates/erg_compiler/lib/external/matplotlib.d/path.d.er
vendored
Normal file
0
crates/erg_compiler/lib/external/matplotlib.d/path.d.er
vendored
Normal file
|
@ -1,6 +1,9 @@
|
|||
# lines = pyimport "../lines"
|
||||
text = pyimport "../text"
|
||||
legend = pyimport "../legend"
|
||||
.style = pyimport "../style"
|
||||
figure = pyimport "../figure"
|
||||
axes = pyimport "../axes"
|
||||
|
||||
.plot!: (*args: Obj, scaleX := Bool, scaleY := Bool) => [Obj; _]
|
||||
.show!: () => NoneType
|
||||
|
@ -8,3 +11,8 @@ legend = pyimport "../legend"
|
|||
.xlabel!: (label: Str) => text.Text
|
||||
.ylabel!: (label: Str) => text.Text
|
||||
.legend!: (labels := [Str; _]) => legend.Legend
|
||||
.subplots!: (() => (figure.Figure, axes.Axes!)) \
|
||||
and ((nrows: {1}, ncols: {1}) => (figure.Figure, axes.Axes!)) \
|
||||
and ((nrows: {1}, ncols: Nat) => (figure.Figure, [axes.Axes!; _])) \
|
||||
and ((nrows: Nat, ncols: {1}) => (figure.Figure, [axes.Axes!; _])) \
|
||||
and ((nrows: Nat, ncols: Nat) => (figure.Figure, [[axes.Axes!; _]; _]))
|
||||
|
|
0
crates/erg_compiler/lib/external/matplotlib.d/scale.d.er
vendored
Normal file
0
crates/erg_compiler/lib/external/matplotlib.d/scale.d.er
vendored
Normal file
1
crates/erg_compiler/lib/external/matplotlib.d/style.d/__init__.d.er
vendored
Normal file
1
crates/erg_compiler/lib/external/matplotlib.d/style.d/__init__.d.er
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.use!: Str => NoneType
|
0
crates/erg_compiler/lib/external/matplotlib.d/testing.d/__init__.d.er
vendored
Normal file
0
crates/erg_compiler/lib/external/matplotlib.d/testing.d/__init__.d.er
vendored
Normal file
|
@ -1,5 +1,6 @@
|
|||
# TODO: dependent (static shaped)
|
||||
.NDArray = 'ndarray': ClassType
|
||||
.NDArray <: Iterable Obj
|
||||
.NDArray <: Num
|
||||
.NDArray.
|
||||
shape: [Nat; _]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue