Ported everything to typst now
This commit is contained in:
parent
9aca6c3042
commit
ea1d02ce9f
15 changed files with 439 additions and 30 deletions
30
graphics/quantizers/s-metric/2_2_en.typ
Normal file
30
graphics/quantizers/s-metric/2_2_en.typ
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#import "@preview/cetz:0.2.2": canvas, plot, draw, decorations, vector
|
||||
|
||||
#let line_style = (stroke: (paint: black, thickness: 2pt))
|
||||
#let dashed = (stroke: (dash: "dashed"))
|
||||
#canvas({
|
||||
plot.plot(size: (8,6),
|
||||
x-tick-step: 0.25,
|
||||
y-label: $cal(E)(2, 2, tilde(x))$,
|
||||
x-label: $tilde(x)$,
|
||||
y-tick-step: none,
|
||||
y-ticks: ((0.125, [M1]) ,(0.25, [M2]),(0.375, [M1]) ,(0.5, [M2]),(0.625, [M1]) ,(0.75, [M2]),(0.875, [M1]) ,(1, [M2])),
|
||||
axis-style: "left",
|
||||
x-min: 0,
|
||||
x-max: 1,
|
||||
y-min: 0,
|
||||
y-max: 1,{
|
||||
plot.add(((0,0), (0.125, 0.125), (0.25,0.25), (0.375, 0.375),(0.5,0.5), (0.625, 0.625),(0.75,0.75), (0.875, 0.875),(1, 1)), line: "vh", style: line_style)
|
||||
plot.add-hline(0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1, style: dashed)
|
||||
plot.add-vline(0.25, 0.5, 0.75, 1, style: dashed)
|
||||
})
|
||||
decorations.brace((-0.9,0.63), (-0.9,1.63), name: "00")
|
||||
decorations.brace((-0.9,2.13), (-0.9,3.13), name: "01")
|
||||
decorations.brace((-0.9,3.63), (-0.9,4.63), name: "10")
|
||||
decorations.brace((-0.9,5.13), (-0.9,6.13), name: "11")
|
||||
|
||||
draw.content((v => vector.add(v, (-0.3, 0)), "00.west"), [00])
|
||||
draw.content((v => vector.add(v, (-0.3, 0)), "01.west"), [01])
|
||||
draw.content((v => vector.add(v, (-0.3, 0)), "10.west"), [10])
|
||||
draw.content((v => vector.add(v, (-0.3, 0)), "11.west"), [11])
|
||||
})
|
||||
30
graphics/quantizers/s-metric/3_2_en.typ
Normal file
30
graphics/quantizers/s-metric/3_2_en.typ
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#import "@preview/cetz:0.2.2": canvas, plot, draw, decorations, vector
|
||||
|
||||
#let line_style = (stroke: (paint: black, thickness: 2pt))
|
||||
#let dashed = (stroke: (dash: "dashed"))
|
||||
#canvas({
|
||||
plot.plot(size: (8,6),
|
||||
x-tick-step: 0.25,
|
||||
y-label: $cal(E)(3, 2, tilde(x))$,
|
||||
x-label: $tilde(x)$,
|
||||
y-tick-step: none,
|
||||
y-ticks: ((1/12, [M1]) ,(2/12, [M2]),(3/12, [M3]) ,(4/12, [M1]),(5/12, [M2]) ,(6/12, [M3]),(7/12, [M1]) ,(8/12, [M2]), (9/12, [M3]), (10/12, [M1]), (11/12, [M2]), (1, [M3])),
|
||||
axis-style: "left",
|
||||
x-min: 0,
|
||||
x-max: 1,
|
||||
y-min: 0,
|
||||
y-max: 1,{
|
||||
plot.add(((0,0), (1/12, 1/12), (2/12,2/12), (3/12, 3/12),(4/12,4/12), (5/12, 5/12),(6/12,6/12), (7/12, 7/12),(8/12, 8/12), (9/12, 9/12), (10/12, 10/12), (11/12, 11/12), (1, 1)), line: "vh", style: line_style)
|
||||
plot.add-hline(1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 1, style: dashed)
|
||||
plot.add-vline(0.25, 0.5, 0.75, 1, style: dashed)
|
||||
})
|
||||
decorations.brace((-0.9,0.4), (-0.9,1.63), name: "00")
|
||||
decorations.brace((-0.9,1.9), (-0.9,3.13), name: "01")
|
||||
decorations.brace((-0.9,3.4), (-0.9,4.63), name: "10")
|
||||
decorations.brace((-0.9,4.9), (-0.9,6.13), name: "11")
|
||||
|
||||
draw.content((v => vector.add(v, (-0.3, 0)), "00.west"), [00])
|
||||
draw.content((v => vector.add(v, (-0.3, 0)), "01.west"), [01])
|
||||
draw.content((v => vector.add(v, (-0.3, 0)), "10.west"), [10])
|
||||
draw.content((v => vector.add(v, (-0.3, 0)), "11.west"), [11])
|
||||
})
|
||||
25
graphics/quantizers/s-metric/s-metric-compar1.typ
Normal file
25
graphics/quantizers/s-metric/s-metric-compar1.typ
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#import "@preview/cetz:0.2.2": canvas, plot, draw
|
||||
|
||||
#let line_style = (stroke: (paint: black, thickness: 2pt))
|
||||
#let dashed = (stroke: (dash: "dashed"))
|
||||
#let fill_aqua = (stroke: none, fill: teal)
|
||||
#let fill_olive = (stroke: none, fill: maroon)
|
||||
#canvas({
|
||||
plot.plot(size: (7,3),
|
||||
legend: "legend.south",
|
||||
legend-style: (orientation: ltr, item: (spacing: 0.5)),
|
||||
x-tick-step: none,
|
||||
x-ticks: ((-1.25, [-a]), (1.25, [a]), (0, [0])),
|
||||
y-label: $cal(E)(1, 2, x)$,
|
||||
x-label: $x$,
|
||||
y-tick-step: none,
|
||||
y-ticks: ((0, [0]), (1, [1])),
|
||||
axis-style: "left",
|
||||
x-min: -3,
|
||||
x-max: 3,
|
||||
y-min: 0,
|
||||
y-max: 1,{
|
||||
plot.add(((-3,0), (-1.25,0), (-1.25,1), (1.25,1), (1.25, 0), (3, 0)), line: "vh", style: line_style)
|
||||
plot.add-hline(1, style: dashed)
|
||||
})
|
||||
})
|
||||
25
graphics/quantizers/s-metric/s-metric-compar2.typ
Normal file
25
graphics/quantizers/s-metric/s-metric-compar2.typ
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#import "@preview/cetz:0.2.2": canvas, plot, draw
|
||||
|
||||
#let line_style = (stroke: (paint: black, thickness: 2pt))
|
||||
#let dashed = (stroke: (dash: "dashed"))
|
||||
#let fill_aqua = (stroke: none, fill: teal)
|
||||
#let fill_olive = (stroke: none, fill: maroon)
|
||||
#canvas({
|
||||
plot.plot(size: (7,3),
|
||||
legend: "legend.south",
|
||||
legend-style: (orientation: ltr, item: (spacing: 0.5)),
|
||||
x-tick-step: none,
|
||||
x-ticks: (0, 0),
|
||||
y-label: $cal(E)(1, 2, x)$,
|
||||
x-label: $x$,
|
||||
y-tick-step: none,
|
||||
y-ticks: ((0, [0]), (1, [1])),
|
||||
axis-style: "left",
|
||||
x-min: -3,
|
||||
x-max: 3,
|
||||
y-min: 0,
|
||||
y-max: 1,{
|
||||
plot.add(((-3,0), (0,0), (0,1), (3,1)), line: "vh", style: line_style)
|
||||
plot.add-hline(1, style: dashed)
|
||||
})
|
||||
})
|
||||
30
graphics/quantizers/two-metric/enrollment.typ
Normal file
30
graphics/quantizers/two-metric/enrollment.typ
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#import "@preview/cetz:0.2.2": canvas, plot
|
||||
|
||||
#let line_style = (stroke: (paint: black, thickness: 2pt))
|
||||
#let dashed = (stroke: (dash: "dashed"))
|
||||
#let fill_aqua = (stroke: none, fill: teal)
|
||||
#let fill_olive = (stroke: none, fill: maroon)
|
||||
#canvas({
|
||||
plot.plot(size: (7,3),
|
||||
legend: "legend.south",
|
||||
legend-style: (orientation: ltr, item: (spacing: 0.5)),
|
||||
x-tick-step: none,
|
||||
x-ticks: ((-1.25, [-a]), (1.25, [a]), (0, [0])),
|
||||
y-label: $cal(E)(1, 2, x)$,
|
||||
x-label: $x$,
|
||||
y-tick-step: none,
|
||||
y-ticks: ((0, [0]), (1, [1])),
|
||||
axis-style: "left",
|
||||
x-min: -3,
|
||||
x-max: 3,
|
||||
y-min: 0,
|
||||
y-max: 1,{
|
||||
plot.add(((-3,0), (-1.25,0), (-1.25,1), (1.25,1), (1.25, 0), (3, 0)), line: "vh", style: line_style)
|
||||
plot.add-fill-between(((-3, 0), (-1.25, 0)), ((-3, 1), (-1.25, 1)), style: fill_aqua, label: [Use metric 1])
|
||||
plot.add-fill-between(((-1.25, 0), (0, 0)), ((-1.25, 1), (0, 1)), style: fill_olive,
|
||||
label: [Use metric 2])
|
||||
plot.add-fill-between(((0, 0), (1.25, 0)), ((0, 1), (1.25, 1)), style: fill_aqua)
|
||||
plot.add-fill-between(((1.25, 0), (3, 0)), ((1.25, 1), (3, 1)), style: fill_olive)
|
||||
plot.add-hline(1, style: dashed)
|
||||
})
|
||||
})
|
||||
27
graphics/quantizers/two-metric/example_enroll.typ
Normal file
27
graphics/quantizers/two-metric/example_enroll.typ
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#import "@preview/cetz:0.2.2": canvas, plot, draw
|
||||
|
||||
#let line_style = (stroke: (paint: black, thickness: 2pt))
|
||||
#let dashed = (stroke: (dash: "dashed"))
|
||||
#let fill_aqua = (stroke: none, fill: teal)
|
||||
#let fill_olive = (stroke: none, fill: maroon)
|
||||
#canvas({
|
||||
plot.plot(size: (7,3),
|
||||
legend: "legend.south",
|
||||
legend-style: (orientation: ltr, item: (spacing: 0.5)),
|
||||
x-tick-step: none,
|
||||
x-ticks: ((-1.25, [-a]), (1.25, [a]), (0, [0])),
|
||||
y-label: $cal(E)(1, 2, x)$,
|
||||
x-label: $x$,
|
||||
y-tick-step: none,
|
||||
y-ticks: ((0, [0]), (1, [1])),
|
||||
axis-style: "left",
|
||||
x-min: -3,
|
||||
x-max: 3,
|
||||
y-min: 0,
|
||||
y-max: 1,{
|
||||
plot.add(((-3,0), (-1.25,0), (-1.25,1), (1.25,1), (1.25, 0), (3, 0)), line: "vh", style: line_style)
|
||||
plot.add(((-1.8, 0), (-1.1, 0)), mark: "|", mark-size: .4, mark-style: (stroke: (thickness: 2pt, paint: blue)), style: (stroke: (paint: blue, thickness: 2pt)))
|
||||
plot.add(((-1.45, 0), (-1.45, 0)), mark: "o", mark-style: (stroke: (paint: red), fill: red))
|
||||
plot.add-hline(1, style: dashed)
|
||||
})
|
||||
})
|
||||
27
graphics/quantizers/two-metric/example_reconstruct.typ
Normal file
27
graphics/quantizers/two-metric/example_reconstruct.typ
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#import "@preview/cetz:0.2.2": canvas, plot, draw
|
||||
|
||||
#let line_style = (stroke: (paint: black, thickness: 2pt))
|
||||
#let dashed = (stroke: (dash: "dashed"))
|
||||
#let fill_aqua = (stroke: none, fill: teal)
|
||||
#let fill_olive = (stroke: none, fill: maroon)
|
||||
#canvas({
|
||||
plot.plot(size: (7,3),
|
||||
legend: "legend.south",
|
||||
legend-style: (orientation: ltr, item: (spacing: 0.5)),
|
||||
x-tick-step: none,
|
||||
x-ticks: ((-1.25, [-a]), (1.25, [a]), (0, [0])),
|
||||
y-label: $cal(R)(1, 2, x)$,
|
||||
x-label: $x$,
|
||||
y-tick-step: none,
|
||||
y-ticks: ((0, [0]), (1, [1])),
|
||||
axis-style: "left",
|
||||
x-min: -3,
|
||||
x-max: 3,
|
||||
y-min: 0,
|
||||
y-max: 1,{
|
||||
plot.add(((-3,0), (-2.125,0), (-2.125,1), (0.375,1), (0.375, 0), (3, 0)), line: "vh", style: line_style)
|
||||
plot.add(((-1.8, 0), (-1.1, 0)), mark: "|", mark-size: .4, mark-style: (stroke: (thickness: 2pt, paint: blue)), style: (stroke: (paint: blue, thickness: 2pt)))
|
||||
plot.add(((-1.45, 0), (-1.45, 0)), mark: "o", mark-style: (stroke: (paint: red), fill: red))
|
||||
plot.add-hline(1, style: dashed)
|
||||
})
|
||||
})
|
||||
28
graphics/quantizers/two-metric/reconstruction.typ
Normal file
28
graphics/quantizers/two-metric/reconstruction.typ
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#import "@preview/cetz:0.2.2": canvas, plot
|
||||
|
||||
#let line_style_aqua = (stroke: (paint: teal, thickness: 2pt))
|
||||
#let line_style_eastern = (stroke: (paint: maroon, thickness: 2pt))
|
||||
#let dashed = (stroke: (dash: "dashed"))
|
||||
#let fill_aqua = (stroke: none, fill: aqua)
|
||||
#let fill_olive = (stroke: none, fill: eastern)
|
||||
#canvas({
|
||||
plot.plot(size: (7,3),
|
||||
legend: "legend.south",
|
||||
legend-style: (orientation: ltr, item: (spacing: 0.5)),
|
||||
x-tick-step: none,
|
||||
x-ticks: ((-1.25, [-a]), (1.25, [a]), (0, [0]), (-2.125, [-T1]), (2.125, [T1]), (0.375, [T2]), (-0.375, [-T2])),
|
||||
y-label: $cal(R)(1, 2, x)$,
|
||||
x-label: $x$,
|
||||
y-tick-step: none,
|
||||
y-ticks: ((0, [0]), (1, [1])),
|
||||
axis-style: "left",
|
||||
x-min: -3,
|
||||
x-max: 3,
|
||||
y-min: 0,
|
||||
y-max: 1,{
|
||||
plot.add(((-3,0), (-2.125,0), (-2.125,1), (0.375,1), (0.375, 0), (3, 0)), line: "vh", style: line_style_aqua, label: [Metric 1])
|
||||
plot.add(((-3, 0), (-0.375, 0), (-0.375, 1), (2.125, 1), (2.125, 0), (3, 0)), line: "vh", style: line_style_eastern, label: [Metric 2])
|
||||
//plot.add-fill-between(((1.25, 0), (3, 0)), ((1.25, 1), (3, 1)), style: fill_olive)
|
||||
plot.add-hline(1, style: dashed)
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue