Skip to content

Commit c9c39a3

Browse files
plot: Fix SCI formatter (#114)
2 parents 901dd6c + 6c6b2a0 commit c9c39a3

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/plot/formats.typ

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
0
129129
}
130130

131-
let ee = calc.pow(10, calc.abs(exponent + 1))
131+
let ee = calc.pow(10.0, calc.abs(exponent + 1))
132132
if exponent > 0 {
133133
value = value / ee * 10
134134
} else if exponent < 0 {

tests/plot/format/ref/1.png

5.68 KB
Loading

tests/plot/format/test.typ

+12
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,15 @@
3737
plot.add(data)
3838
})
3939
})
40+
41+
#test-case({
42+
plot.plot(
43+
size: (8, 4),
44+
x-min: -1e10,
45+
x-max: +1e10,
46+
x-tick-step: 1e10,
47+
y-format: none,
48+
x-format: plot.formats.sci, {
49+
plot.add(data)
50+
})
51+
})

0 commit comments

Comments
 (0)