@@ -71,6 +71,56 @@ class PlotImageExportVisualTest {
7171 assertPlot(" plot_latex_formula_test.png" , plotSpec)
7272 }
7373
74+ @Test
75+ fun superscript () {
76+ val spec = """
77+ |{
78+ | "kind": "subplots",
79+ | "layout": { "ncol": 2.0, "nrow": 1.0, "name": "grid" },
80+ | "figures": [
81+ | {
82+ | "kind": "plot",
83+ | "ggtitle": { "text": "Default limits" },
84+ | "theme": { "name": "classic", "exponent_format": "pow", "text": { "family": "Noto Sans" }, "axis_title_y": { "blank": true } },
85+ | "scales": [ { "aesthetic": "y", "limits": [ 1e-08, 10000000.0 ], "trans": "log10" } ],
86+ | "layers": [
87+ | {
88+ | "geom": "text",
89+ | "mapping": {
90+ | "y": [ 1e-07, 1e-06, 1e-05, 0.0001, 0.001, 0.01, 0.1, 1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0 ],
91+ | "label": [ 1e-07, 1e-06, 1e-05, 0.0001, 0.001, 0.01, 0.1, 1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0 ]
92+ | },
93+ | "family": "Noto Sans",
94+ | "size": 10.0
95+ | }
96+ | ]
97+ | },
98+ | {
99+ | "kind": "plot",
100+ | "ggtitle": { "text": "Scientific notation for \\( x \\leq 10^{-3} \\) and \\( x \\geq 10^3 \\)" },
101+ | "theme": { "name": "classic", "exponent_format": [ "pow", -3.0, 3.0 ], "text": { "family": "Noto Sans" }, "axis_title_y": { "blank": true } },
102+ | "scales": [ { "aesthetic": "y", "limits": [ 1e-08, 10000000.0 ], "trans": "log10" } ],
103+ | "layers": [
104+ | {
105+ | "geom": "text",
106+ | "mapping": {
107+ | "y": [ 1e-07, 1e-06, 1e-05, 0.0001, 0.001, 0.01, 0.1, 1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0 ],
108+ | "label": [ 1e-07, 1e-06, 1e-05, 0.0001, 0.001, 0.01, 0.1, 1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0 ]
109+ | },
110+ | "family": "Noto Sans",
111+ | "size": 10.0
112+ | }
113+ | ]
114+ | }
115+ | ]
116+ |}
117+ |""" .trimMargin()
118+
119+ val plotSpec = parsePlotSpec(spec)
120+
121+ assertPlot(" plot_superscript_test.png" , plotSpec)
122+ }
123+
74124 @Test
75125 fun `multi-level latex formula` () {
76126 val spec = """
@@ -255,6 +305,7 @@ class PlotImageExportVisualTest {
255305
256306 assertPlot(" plot_markdown2Xscale_test.png" , plotSpec, scale = 2 )
257307 }
308+
258309 @Test
259310 fun markdown () {
260311 val spec = """
0 commit comments