From 142d20c4b58fbaf0ebfe3d852c514abafb1383a0 Mon Sep 17 00:00:00 2001 From: walnut07 Date: Fri, 7 Feb 2025 15:14:46 +0900 Subject: [PATCH 1/2] add validation to breaksLabeled --- .../scales/guide/model/LetsPlotAxis.kt | 7 +++- .../scales/guide/model/LetsPlotLegend.kt | 7 +++- .../kandy/letsplot/scales/guide/model/axis.kt | 35 +++++++++++++++++++ .../letsplot/scales/guide/model/legend.kt | 35 +++++++++++++++++++ 4 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/axis.kt create mode 100644 kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/legend.kt diff --git a/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/LetsPlotAxis.kt b/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/LetsPlotAxis.kt index 7ff3df5b..063c5c13 100644 --- a/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/LetsPlotAxis.kt +++ b/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/LetsPlotAxis.kt @@ -55,9 +55,14 @@ public data class Axis @PublishedApi internal constructor( * * @param breaks list of breaks. * @param labels list of corresponding labels. + * @throws IllegalArgumentException if the size of breaks and labels do not match. */ public fun breaksLabeled(breaks: List, labels: List) { - // TODO(https://github.com/Kotlin/kandy/issues/416) + if (breaks.size != labels.size) { + throw IllegalArgumentException( + "The number of breaks (${breaks.size}) must match the number of labels (${labels.size})." + ) + } this.breaks = breaks this.labels = labels } diff --git a/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/LetsPlotLegend.kt b/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/LetsPlotLegend.kt index d0216f7f..06da1830 100644 --- a/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/LetsPlotLegend.kt +++ b/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/LetsPlotLegend.kt @@ -50,9 +50,14 @@ public data class Legend @PublishedApi internal const * * @param breaks list of breaks. * @param labels list of corresponding labels. + * @throws IllegalArgumentException if the size of breaks and labels do not match. */ public fun breaksLabeled(breaks: List, labels: List) { - // TODO(https://github.com/Kotlin/kandy/issues/416) + if (breaks.size != labels.size) { + throw IllegalArgumentException( + "The number of breaks (${breaks.size}) must match the number of labels (${labels.size})." + ) + } this.breaks = breaks this.labels = labels } diff --git a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/axis.kt b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/axis.kt new file mode 100644 index 00000000..b6d47092 --- /dev/null +++ b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/axis.kt @@ -0,0 +1,35 @@ +package org.jetbrains.kotlinx.kandy.letsplot.scales + +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertFailsWith +import org.jetbrains.kotlinx.kandy.letsplot.scales.guide.model.Axis + +class AxisTest { + + @Test + fun `test breaksLabeled valid pair`() { + val axis = Axis() + axis.breaksLabeled(1 to "One", 2 to "Two", 3 to "Three") + + assertEquals(listOf(1, 2, 3), axis.breaks) + assertEquals(listOf("One", "Two", "Three"), axis.labels) + } + + @Test + fun `test breaksLabeled with valid lists`() { + val axis = Axis() + axis.breaksLabeled(listOf(1.0, 2.0, 3.0), listOf("Low", "Medium", "High")) + + assertEquals(listOf(1.0, 2.0, 3.0), axis.breaks) + assertEquals(listOf("Low", "Medium", "High"), axis.labels) + } + + @Test + fun `test breaksLabeled with lists mismatched sizes`() { + val axis = Axis() + assertFailsWith { + axis.breaksLabeled(listOf(1.0, 2.0), listOf("Low")) + } + } +} diff --git a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/legend.kt b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/legend.kt new file mode 100644 index 00000000..f0aab3ad --- /dev/null +++ b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/legend.kt @@ -0,0 +1,35 @@ +package org.jetbrains.kotlinx.kandy.letsplot.scales + +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertFailsWith +import org.jetbrains.kotlinx.kandy.letsplot.scales.guide.model.Legend + +class LegendTest { + + @Test + fun `test breaksLabeled with valid pair`() { + val legend = Legend() + legend.breaksLabeled('A' to "Label A", 'B' to "Label B") + + assertEquals(listOf('A', 'B'), legend.breaks) + assertEquals(listOf("Label A", "Label B"), legend.labels) + } + + @Test + fun `test breaksLabeled with valid lists`() { + val legend = Legend() + legend.breaksLabeled(listOf('X', 'Y', 'Z'), listOf("X-label", "Y-label", "Z-label")) + + assertEquals(listOf('X', 'Y', 'Z'), legend.breaks) + assertEquals(listOf("X-label", "Y-label", "Z-label"), legend.labels) + } + + @Test + fun `test breaksLabeled with lists mismatched sizes`() { + val legend = Legend() + assertFailsWith { + legend.breaksLabeled(listOf('A', 'B'), listOf("Only Label A")) + } + } +} From 6df18b25228c6c81680e2424db4809aca8d790c3 Mon Sep 17 00:00:00 2001 From: "andrei.kislitsyn" Date: Mon, 17 Feb 2025 17:48:59 +0400 Subject: [PATCH 2/2] remove ..AxisLabel from layout --- docs/images/samples/area/area_fixed.svg | 4 +- docs/images/samples/area/area_fixed_dark.svg | 4 +- docs/images/samples/bars/bar_settings.svg | 124 +-- .../images/samples/bars/bar_settings_dark.svg | 124 +-- docs/topics/guides/ErrorBars-Guide.md | 45 +- docs/topics/guides/Formatting-Guide.md | 2 +- docs/topics/guides/Legend-and-Axis-Guide.md | 4 +- docs/topics/guides/Plot-Bunch-Guide.md | 28 +- docs/topics/samples/area/Area-Settings.md | 6 +- .../samples/area/Fixed-Area-Coordinate.md | 38 +- docs/topics/samples/bars/Bar-Settings.md | 20 +- docs/topics/samples/line/Path-Line.md | 16 +- .../lets-plot/guides/error_bars.ipynb | 789 ++++++++++-------- .../lets-plot/guides/label_format.ipynb | 370 ++++---- .../lets-plot/guides/legend_and_axis.ipynb | 440 +++++----- .../lets-plot/guides/plot_bunch.ipynb | 499 +++++------ .../lets-plot/samples/area/area_fixed.ipynb | 108 ++- .../lets-plot/samples/bars/bar_settings.ipynb | 193 +++-- .../lets-plot/samples/line/path_line.ipynb | 77 +- .../kotlinx/kandy/letsplot/feature/Layout.kt | 7 - .../kandy/letsplot/translator/feature.kt | 2 +- .../kotlinx/kandy/letsplot/feature/layout.kt | 4 - .../kotlinx/kandy/letsplot/samples/area.kt | 44 +- .../kotlinx/kandy/letsplot/samples/bars.kt | 21 +- .../letsplot/samples/guides/errorBars.kt | 46 +- .../letsplot/samples/guides/labelFormat.kt | 2 +- .../letsplot/samples/guides/legendAndAxis.kt | 4 +- .../letsplot/samples/guides/plotBunch.kt | 28 +- .../kandy/letsplot/samples/kdoc/layout.kt | 2 - .../kotlinx/kandy/letsplot/samples/lines.kt | 16 +- .../jupyter/layout output in jupyter.out | 2 +- 31 files changed, 1469 insertions(+), 1600 deletions(-) diff --git a/docs/images/samples/area/area_fixed.svg b/docs/images/samples/area/area_fixed.svg index 7bea7c73..c99002dd 100644 --- a/docs/images/samples/area/area_fixed.svg +++ b/docs/images/samples/area/area_fixed.svg @@ -384,12 +384,12 @@ font-size: 13.0px; - Month + Water Level (meters) - Water Level (meters) + Month diff --git a/docs/images/samples/area/area_fixed_dark.svg b/docs/images/samples/area/area_fixed_dark.svg index 14ee6dde..d0607d3c 100644 --- a/docs/images/samples/area/area_fixed_dark.svg +++ b/docs/images/samples/area/area_fixed_dark.svg @@ -384,12 +384,12 @@ font-size: 13.0px; - Month + Water Level (meters) - Water Level (meters) + Month diff --git a/docs/images/samples/bars/bar_settings.svg b/docs/images/samples/bars/bar_settings.svg index c86626b0..9173b841 100644 --- a/docs/images/samples/bars/bar_settings.svg +++ b/docs/images/samples/bars/bar_settings.svg @@ -134,82 +134,74 @@ font-size: 13.0px; - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - + - - + + - + - + - + - + - + - + - + - + - - + + @@ -218,7 +210,7 @@ font-size: 13.0px; - + @@ -227,7 +219,7 @@ font-size: 13.0px; - + @@ -236,7 +228,7 @@ font-size: 13.0px; - + @@ -245,7 +237,7 @@ font-size: 13.0px; - + @@ -254,7 +246,7 @@ font-size: 13.0px; - + @@ -263,7 +255,7 @@ font-size: 13.0px; - + @@ -272,10 +264,10 @@ font-size: 13.0px; - + - + @@ -283,80 +275,52 @@ font-size: 13.0px; - + 10 - + 20 - + 30 - + 40 - + 50 - + 60 - - - - 70 - - - - - - - 80 - - - - - - - 90 - - - - - - - 100 - - - - + Sugar content @@ -366,7 +330,7 @@ font-size: 13.0px; Sugar Content (g per 100g) - + Candy Name diff --git a/docs/images/samples/bars/bar_settings_dark.svg b/docs/images/samples/bars/bar_settings_dark.svg index d95b6006..add5df7c 100644 --- a/docs/images/samples/bars/bar_settings_dark.svg +++ b/docs/images/samples/bars/bar_settings_dark.svg @@ -134,52 +134,44 @@ font-size: 13.0px; - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - + - - + + @@ -188,7 +180,7 @@ font-size: 13.0px; - + @@ -197,7 +189,7 @@ font-size: 13.0px; - + @@ -206,7 +198,7 @@ font-size: 13.0px; - + @@ -215,7 +207,7 @@ font-size: 13.0px; - + @@ -224,7 +216,7 @@ font-size: 13.0px; - + @@ -233,7 +225,7 @@ font-size: 13.0px; - + @@ -242,10 +234,10 @@ font-size: 13.0px; - + - + @@ -253,102 +245,74 @@ font-size: 13.0px; - + 10 - + 20 - + 30 - + 40 - + 50 - + 60 - - - - 70 - - - - - - - 80 - - - - - - - 90 - - - - - - - 100 - - - - - + + - + - + - + - + - + - + - + - + @@ -356,7 +320,7 @@ font-size: 13.0px; - + Sugar content @@ -366,7 +330,7 @@ font-size: 13.0px; Sugar Content (g per 100g) - + Candy Name diff --git a/docs/topics/guides/ErrorBars-Guide.md b/docs/topics/guides/ErrorBars-Guide.md index c98f31c5..bd798652 100644 --- a/docs/topics/guides/ErrorBars-Guide.md +++ b/docs/topics/guides/ErrorBars-Guide.md @@ -187,11 +187,12 @@ plot(dataset) { position = posD } + x.axis.name = "Dose (mg)" + y.axis.name = "Tooth length (mm)" + layout { title = "The Effect of Vitamin C on Tooth Growth in Guinea Pigs" size = 700 to 400 - xAxisLabel = "Dose (mg)" - yAxisLabel = "Tooth length (mm)" style { legend { @@ -235,11 +236,11 @@ plot(dataset) { } } + x.axis.name = "Dose (mg)" + y.axis.name = "Tooth length (mm)" layout { size = 700 to 400 - xAxisLabel = "Dose (mg)" - yAxisLabel = "Tooth length (mm)" style { legend { @@ -273,11 +274,10 @@ plot(dataset) { position = Position.dodge(0.95) } - layout { - size = 700 to 400 - xAxisLabel = "Dose (mg)" - yAxisLabel = "Tooth length (mm)" - } + x.axis.name = "Dose (mg)" + y.axis.name = "Tooth length (mm)" + + layout.size = 700 to 400 } ``` @@ -308,11 +308,10 @@ plot(dataset) { position = posD } - layout { - size = 700 to 400 - xAxisLabel = "Dose (mg)" - yAxisLabel = "Tooth length (mm)" - } + x.axis.name = "Dose (mg)" + y.axis.name = "Tooth length (mm)" + + layout.size = 700 to 400 } ``` @@ -344,11 +343,10 @@ plot(dataset) { position = posD } - layout { - size = 700 to 400 - xAxisLabel = "Dose (mg)" - yAxisLabel = "Tooth length (mm)" - } + x.axis.name = "Dose (mg)" + y.axis.name = "Tooth length (mm)" + + layout.size = 700 to 400 } ``` @@ -385,11 +383,10 @@ plot(dataset) { position = posD } - layout { - size = 700 to 400 - xAxisLabel = "Dose (mg)" - yAxisLabel = "Tooth length (mm)" - } + x.axis.name = "Dose (mg)" + y.axis.name = "Tooth length (mm)" + + layout.size = 700 to 400 } ``` diff --git a/docs/topics/guides/Formatting-Guide.md b/docs/topics/guides/Formatting-Guide.md index 3ec69e88..ccaeb81b 100644 --- a/docs/topics/guides/Formatting-Guide.md +++ b/docs/topics/guides/Formatting-Guide.md @@ -374,9 +374,9 @@ economics.plot { x.constant(LocalDate(2001, 1, 1).atStartOfDayIn(TimeZone.UTC).toEpochMilliseconds()) y.constant(unemploymentMean + 0.5) } + y.axis.name = "unemployment rate" layout { title = "The US Unemployment Rates 2000-2016." - yAxisLabel = "unemployment rate" size = 900 to 400 } } diff --git a/docs/topics/guides/Legend-and-Axis-Guide.md b/docs/topics/guides/Legend-and-Axis-Guide.md index 272b4cb2..fec7b4b2 100644 --- a/docs/topics/guides/Legend-and-Axis-Guide.md +++ b/docs/topics/guides/Legend-and-Axis-Guide.md @@ -194,6 +194,8 @@ mpgDf.plot { } } } + x.axis.name = "Engine displacement (L)" + y.axis.name = "Highway MPG" layout { size = 700 to 350 style { @@ -204,8 +206,6 @@ mpgDf.plot { direction = LegendDirection.HORIZONTAL } } - xAxisLabel = "Engine displacement (L)" - yAxisLabel = "Highway MPG" } } ``` diff --git a/docs/topics/guides/Plot-Bunch-Guide.md b/docs/topics/guides/Plot-Bunch-Guide.md index 1961c80f..ffd5f399 100644 --- a/docs/topics/guides/Plot-Bunch-Guide.md +++ b/docs/topics/guides/Plot-Bunch-Guide.md @@ -50,11 +50,7 @@ plot { color = Color.GREY alpha = .4 } - layout { - size = 600 to 200 - xAxisLabel = "x" - yAxisLabel = "y" - } + layout.size = 600 to 200 } ``` @@ -69,10 +65,7 @@ plot { histogram(xs) { fillColor = Color.named("dark_magenta") } - layout { - size = 600 to 200 - xAxisLabel = "x" - } + layout.size = 600 to 200 } ``` @@ -92,10 +85,7 @@ plotBunch { x { scale = scaleX } fillColor = Color.named("dark_magenta") } - layout { - size = 600 to 200 - xAxisLabel = "x" - } + layout.size = 600 to 200 }, 0, 0) add(plot { points { @@ -104,11 +94,7 @@ plotBunch { color = Color.GREY alpha = .4 } - layout { - size = 600 to 200 - xAxisLabel = "x" - yAxisLabel = "y" - } + layout.size = 600 to 200 }, 0, 200) } ``` @@ -151,7 +137,6 @@ plotBunch { } layout { size = 600 to 200 - xAxisLabel = "x" style(upperStyle) } }, 0, 0) @@ -164,8 +149,6 @@ plotBunch { } layout { size = 600 to 200 - xAxisLabel = "x" - yAxisLabel = "y" style(lowerStyle) } }, 0, 200) @@ -193,7 +176,6 @@ plotBunch { } layout { size = 600 to 200 - xAxisLabel = "x" style(upperStyle) } }, 0, 0, 600, 100) @@ -206,8 +188,6 @@ plotBunch { } layout { size = 600 to 200 - xAxisLabel = "x" - yAxisLabel = "y" style(lowerStyle) } }, 0, 100, 600, 300) diff --git a/docs/topics/samples/area/Area-Settings.md b/docs/topics/samples/area/Area-Settings.md index 56ec518f..e28ee33d 100644 --- a/docs/topics/samples/area/Area-Settings.md +++ b/docs/topics/samples/area/Area-Settings.md @@ -30,7 +30,6 @@ val time = column("time") val load = column("load") loadServer.plot { - layout.title = "Daily Server Load Dynamics" area { x(time) { axis.name = "Time" } y(load) { @@ -45,6 +44,8 @@ loadServer.plot { fillColor = Color.RED alpha = 0.7 } + + layout.title = "Daily Server Load Dynamics" } ``` @@ -56,7 +57,6 @@ val time = listOf("00:00", "03:00", "06:00", "09:00", "12:00", "15:00", "18:00", val load = listOf(10, 5, 15, 50, 75, 60, 80, 40) plot { - layout.title = "Daily Server Load Dynamics" area { x(time) { axis.name = "Time" } y(load) { axis.name = "Load (%)" } @@ -68,6 +68,8 @@ plot { fillColor = Color.RED alpha = 0.7 } + + layout.title = "Daily Server Load Dynamics" } ``` diff --git a/docs/topics/samples/area/Fixed-Area-Coordinate.md b/docs/topics/samples/area/Fixed-Area-Coordinate.md index 2cce32d8..2759409d 100644 --- a/docs/topics/samples/area/Fixed-Area-Coordinate.md +++ b/docs/topics/samples/area/Fixed-Area-Coordinate.md @@ -34,15 +34,13 @@ val waterLvl by columnOf(4.5, 4.7, 5.0, 5.5, 6.0, 6.5, 6.7, 6.2, 5.8, 5.3, 4.8, val reservoirDf = dataFrameOf(month, waterLvl) plot(reservoirDf) { - layout { - title = "Water Level" - subtitle = "Annual Water Level Fluctuations in Reservoir" - yAxisLabel = "Month" - xAxisLabel = "Water Level (meters)" + x(month) { + axis.name = "Month" + } + y.axis { + name = "Water Level (meters)" + limits = 3.0..8.0 } - - x(month) - y { axis.limits = 3.0..8.0 } line { y(waterLvl) } @@ -52,6 +50,11 @@ plot(reservoirDf) { alpha = 0.5 fillColor = Color.RED } + + layout { + title = "Water Level" + subtitle = "Annual Water Level Fluctuations in Reservoir" + } } ``` @@ -71,15 +74,13 @@ val reservoirDf = mapOf( ) plot(reservoirDf) { - layout { - title = "Water Level" - subtitle = "Annual Water Level Fluctuations in Reservoir" - yAxisLabel = "Month" - xAxisLabel = "Water Level (meters)" + x("month") { + axis.name = "Month" + } + y.axis { + name = "Water Level (meters)" + limits = 3.0..8.0 } - - x("month") - y { axis.limits = 3.0..8.0 } line { y("waterLvl") } @@ -89,6 +90,11 @@ plot(reservoirDf) { alpha = 0.5 fillColor = Color.RED } + + layout { + title = "Water Level" + subtitle = "Annual Water Level Fluctuations in Reservoir" + } } ``` diff --git a/docs/topics/samples/bars/Bar-Settings.md b/docs/topics/samples/bars/Bar-Settings.md index 48d39674..9014bbd9 100644 --- a/docs/topics/samples/bars/Bar-Settings.md +++ b/docs/topics/samples/bars/Bar-Settings.md @@ -29,11 +29,6 @@ val candy by columnOf( val sugar by columnOf(65, 58, 53, 35, 40, 45, 50) plot { - layout { - title = "Sugar content" - xAxisLabel = "Candy Name" - yAxisLabel = "Sugar Content (g per 100g)" - } bars { x(candy) y(sugar) { scale = continuous(0..100) } @@ -44,6 +39,11 @@ plot { width = 1.3 } } + + x.axis.name = "Candy Name" + y.axis.name = "Sugar Content (g per 100g)" + + layout.title = "Sugar content" } ``` @@ -58,11 +58,6 @@ val candy = listOf( val sugar = listOf(65, 58, 53, 35, 40, 45, 50) plot { - layout { - title = "Sugar content" - xAxisLabel = "Candy Name" - yAxisLabel = "Sugar Content (g per 100g)" - } bars { x(candy) y(sugar) { scale = continuous(0..100) } @@ -73,6 +68,11 @@ plot { width = 1.3 } } + + x.axis.name = "Candy Name" + y.axis.name = "Sugar Content (g per 100g)" + + layout.title = "Sugar content" } ``` diff --git a/docs/topics/samples/line/Path-Line.md b/docs/topics/samples/line/Path-Line.md index 72954b6c..40c0fe8f 100644 --- a/docs/topics/samples/line/Path-Line.md +++ b/docs/topics/samples/line/Path-Line.md @@ -22,20 +22,18 @@ val dist = listOf(100, 90, 80, 70, 60, 50, 40) val temp = listOf(-45.5, -44.4, -40.0, -43.2, -41.5, -35.5, -39.9) plot { + path { + y(dist,"Performance Measure") + x(temp, "Temperature (°C)") + color = Color.BLUE + type = LineType.LONGDASH + } + layout { title = "Performance Dependency on Temperature" subtitle = "Analysis of Material Performance Decline at Extremely Low Temperatures" - yAxisLabel = "Performance Measure" size = 600 to 550 } - path { - y(dist) - x(temp) { - axis.name = "Temperature (°C)" - } - color = Color.BLUE - type = LineType.LONGDASH - } } ``` diff --git a/examples/notebooks/lets-plot/guides/error_bars.ipynb b/examples/notebooks/lets-plot/guides/error_bars.ipynb index 3fe76a52..62adb824 100644 --- a/examples/notebooks/lets-plot/guides/error_bars.ipynb +++ b/examples/notebooks/lets-plot/guides/error_bars.ipynb @@ -4,8 +4,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:12:16.148421Z", - "start_time": "2025-02-03T09:12:03.289387Z" + "end_time": "2025-02-17T13:45:00.556652Z", + "start_time": "2025-02-17T13:44:56.084739Z" } }, "source": [ @@ -34,8 +34,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:12:19.039326Z", - "start_time": "2025-02-03T09:12:16.436189Z" + "end_time": "2025-02-17T13:45:01.017673Z", + "start_time": "2025-02-17T13:45:00.588945Z" } }, "source": [ @@ -61,8 +61,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:12:21.123360Z", - "start_time": "2025-02-03T09:12:19.049825Z" + "end_time": "2025-02-17T13:45:01.440512Z", + "start_time": "2025-02-17T13:45:01.043479Z" } }, "source": [ @@ -96,7 +96,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="fgR5vo"></div>\n", + " <div id="BqJ6Ye"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -200,7 +200,7 @@ "},\n", ""spec_id":"2"\n", "};\n", - " var containerDiv = document.getElementById("fgR5vo");\n", + " var containerDiv = document.getElementById("BqJ6Ye");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -223,7 +223,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -398,7 +398,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -476,19 +476,19 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -708,10 +708,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -889,8 +889,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:12:21.630156Z", - "start_time": "2025-02-03T09:12:21.152179Z" + "end_time": "2025-02-17T13:45:01.607290Z", + "start_time": "2025-02-17T13:45:01.490770Z" } }, "source": [ @@ -933,7 +933,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="P1Ar8Q"></div>\n", + " <div id="1naA1n"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -1046,7 +1046,7 @@ "},\n", ""spec_id":"5"\n", "};\n", - " var containerDiv = document.getElementById("P1Ar8Q");\n", + " var containerDiv = document.getElementById("1naA1n");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -1069,7 +1069,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1244,7 +1244,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1322,19 +1322,19 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1554,10 +1554,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -1744,8 +1744,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:12:22.192027Z", - "start_time": "2025-02-03T09:12:21.652349Z" + "end_time": "2025-02-17T13:45:01.773077Z", + "start_time": "2025-02-17T13:45:01.619014Z" } }, "source": [ @@ -1790,7 +1790,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="Yzb2Oa"></div>\n", + " <div id="pyZmT3"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -1836,8 +1836,8 @@ "},\n", ""stat":"identity",\n", ""data":{\n", - ""dose":[0.5,1.0,2.0,0.5,1.0,2.0],\n", ""&merged_groups":["OJ","OJ","OJ","VC","VC","VC"],\n", + ""dose":[0.5,1.0,2.0,0.5,1.0,2.0],\n", ""len_min":[11.83,21.2,24.5,4.24,15.26,23.35],\n", ""len_max":[15.63,24.9,27.11,10.72,19.28,28.93]\n", "},\n", @@ -1916,7 +1916,7 @@ "},\n", ""spec_id":"8"\n", "};\n", - " var containerDiv = document.getElementById("Yzb2Oa");\n", + " var containerDiv = document.getElementById("pyZmT3");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -1939,7 +1939,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2114,7 +2114,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2192,19 +2192,19 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2408,10 +2408,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -2638,8 +2638,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:12:22.338354Z", - "start_time": "2025-02-03T09:12:22.210676Z" + "end_time": "2025-02-17T13:45:01.827248Z", + "start_time": "2025-02-17T13:45:01.783753Z" } }, "source": [ @@ -2654,8 +2654,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:12:23.384962Z", - "start_time": "2025-02-03T09:12:22.525182Z" + "end_time": "2025-02-17T13:45:02.003096Z", + "start_time": "2025-02-17T13:45:01.834494Z" } }, "source": [ @@ -2690,11 +2690,12 @@ " position = posD\n", " }\n", "\n", + " x.axis.name = \"Dose (mg)\"\n", + " y.axis.name = \"Tooth length (mm)\"\n", + "\n", " layout {\n", " title = \"The Effect of Vitamin C on Tooth Growth in Guinea Pigs\"\n", " size = 700 to 400\n", - " xAxisLabel = \"Dose (mg)\"\n", - " yAxisLabel = \"Tooth length (mm)\"\n", "\n", " style {\n", " legend {\n", @@ -2716,7 +2717,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="rPLJSE"></div>\n", + " <div id="ustsq0"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -2728,14 +2729,6 @@ "},\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"Dose (mg)"\n", - "},\n", - ""y":{\n", - ""title":"Tooth length (mm)"\n", - "}\n", - "},\n", ""data":{\n", ""dose":[0.5,1.0,2.0,0.5,1.0,2.0],\n", ""supp":["OJ","OJ","OJ","VC","VC","VC"],\n", @@ -2767,6 +2760,14 @@ "},{\n", ""aesthetic":"color",\n", ""values":["#fc8452","dark_green"]\n", + "},{\n", + ""aesthetic":"x",\n", + ""name":"Dose (mg)",\n", + ""limits":[null,null]\n", + "},{\n", + ""aesthetic":"y",\n", + ""name":"Tooth length (mm)",\n", + ""limits":[null,null]\n", "}],\n", ""layers":[{\n", ""mapping":{\n", @@ -2866,7 +2867,7 @@ "},\n", ""spec_id":"11"\n", "};\n", - " var containerDiv = document.getElementById("rPLJSE");\n", + " var containerDiv = document.getElementById("ustsq0");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -2889,7 +2890,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3193,7 +3194,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3271,19 +3272,19 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3363,10 +3364,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -3375,14 +3376,6 @@ "text": "The Effect of Vitamin C on Tooth Growth in Guinea Pigs" }, "mapping": {}, - "guides": { - "x": { - "title": "Dose (mg)" - }, - "y": { - "title": "Tooth length (mm)" - } - }, "data": { "dose": [ 0.5, @@ -3463,6 +3456,22 @@ "#fc8452", "dark_green" ] + }, + { + "aesthetic": "x", + "name": "Dose (mg)", + "limits": [ + null, + null + ] + }, + { + "aesthetic": "y", + "name": "Tooth length (mm)", + "limits": [ + null, + null + ] } ], "layers": [ @@ -3636,8 +3645,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:12:24.409798Z", - "start_time": "2025-02-03T09:12:23.427810Z" + "end_time": "2025-02-17T13:45:02.125627Z", + "start_time": "2025-02-17T13:45:02.011772Z" } }, "source": [ @@ -3663,11 +3672,11 @@ " }\n", " }\n", "\n", + " x.axis.name = \"Dose (mg)\"\n", + " y.axis.name = \"Tooth length (mm)\"\n", "\n", " layout {\n", " size = 700 to 400\n", - " xAxisLabel = \"Dose (mg)\"\n", - " yAxisLabel = \"Tooth length (mm)\"\n", "\n", " style {\n", " legend {\n", @@ -3689,7 +3698,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="eiu8lm"></div>\n", + " <div id="F7Ex43"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -3698,14 +3707,6 @@ " var plotSpec={\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"Dose (mg)"\n", - "},\n", - ""y":{\n", - ""title":"Tooth length (mm)"\n", - "}\n", - "},\n", ""data":{\n", ""dose":[0.5,1.0,2.0,0.5,1.0,2.0],\n", ""supp":["OJ","OJ","OJ","VC","VC","VC"],\n", @@ -3728,6 +3729,14 @@ "},{\n", ""aesthetic":"x",\n", ""limits":[null,null]\n", + "},{\n", + ""aesthetic":"x",\n", + ""name":"Dose (mg)",\n", + ""limits":[null,null]\n", + "},{\n", + ""aesthetic":"y",\n", + ""name":"Tooth length (mm)",\n", + ""limits":[null,null]\n", "}],\n", ""layers":[{\n", ""mapping":{\n", @@ -3752,8 +3761,8 @@ "},\n", ""stat":"identity",\n", ""data":{\n", - ""dose":[0.5,1.0,2.0,0.5,1.0,2.0],\n", ""&merged_groups":["OJ","OJ","OJ","VC","VC","VC"],\n", + ""dose":[0.5,1.0,2.0,0.5,1.0,2.0],\n", ""len_min":[11.83,21.2,24.5,4.24,15.26,23.35],\n", ""len_max":[15.63,24.9,27.11,10.72,19.28,28.93]\n", "},\n", @@ -3809,7 +3818,7 @@ "},\n", ""spec_id":"14"\n", "};\n", - " var containerDiv = document.getElementById("eiu8lm");\n", + " var containerDiv = document.getElementById("F7Ex43");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -3832,7 +3841,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4167,7 +4176,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4237,13 +4246,13 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4308,23 +4317,15 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", "output": { "mapping": {}, - "guides": { - "x": { - "title": "Dose (mg)" - }, - "y": { - "title": "Tooth length (mm)" - } - }, "data": { "dose": [ 0.5, @@ -4384,6 +4385,22 @@ null, null ] + }, + { + "aesthetic": "x", + "name": "Dose (mg)", + "limits": [ + null, + null + ] + }, + { + "aesthetic": "y", + "name": "Tooth length (mm)", + "limits": [ + null, + null + ] } ], "layers": [ @@ -4549,8 +4566,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:12:24.978118Z", - "start_time": "2025-02-03T09:12:24.453380Z" + "end_time": "2025-02-17T13:45:02.211776Z", + "start_time": "2025-02-17T13:45:02.134931Z" } }, "source": [ @@ -4567,6 +4584,9 @@ " position = Position.dodge(0.95)\n", " }\n", "\n", + " x.axis.name = \"Dose (mg)\"\n", + " y.axis.name = \"Tooth length (mm)\"\n", + "\n", " layout {\n", " size = 700 to 400\n", " xAxisLabel = \"Dose (mg)\"\n", @@ -4585,7 +4605,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="IcChAR"></div>\n", + " <div id="h1jytn"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -4623,6 +4643,14 @@ "},{\n", ""aesthetic":"color",\n", ""values":["#fc8452","dark_green"]\n", + "},{\n", + ""aesthetic":"x",\n", + ""name":"Dose (mg)",\n", + ""limits":[null,null]\n", + "},{\n", + ""aesthetic":"y",\n", + ""name":"Tooth length (mm)",\n", + ""limits":[null,null]\n", "}],\n", ""layers":[{\n", ""mapping":{\n", @@ -4664,7 +4692,7 @@ "},\n", ""spec_id":"17"\n", "};\n", - " var containerDiv = document.getElementById("IcChAR");\n", + " var containerDiv = document.getElementById("h1jytn");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -4687,7 +4715,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4866,7 +4894,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4898,7 +4926,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -5114,10 +5142,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -5199,6 +5227,22 @@ "#fc8452", "dark_green" ] + }, + { + "aesthetic": "x", + "name": "Dose (mg)", + "limits": [ + null, + null + ] + }, + { + "aesthetic": "y", + "name": "Tooth length (mm)", + "limits": [ + null, + null + ] } ], "layers": [ @@ -5268,8 +5312,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:12:25.671835Z", - "start_time": "2025-02-03T09:12:25.010748Z" + "end_time": "2025-02-17T13:45:02.291295Z", + "start_time": "2025-02-17T13:45:02.219647Z" } }, "source": [ @@ -5291,11 +5335,10 @@ " position = posD\n", " }\n", "\n", - " layout {\n", - " size = 700 to 400\n", - " xAxisLabel = \"Dose (mg)\"\n", - " yAxisLabel = \"Tooth length (mm)\"\n", - " }\n", + " x.axis.name = \"Dose (mg)\"\n", + " y.axis.name = \"Tooth length (mm)\"\n", + "\n", + " layout.size = 700 to 400\n", "}" ], "outputs": [ @@ -5309,7 +5352,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="WrZXJC"></div>\n", + " <div id="6RZake"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -5318,14 +5361,6 @@ " var plotSpec={\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"Dose (mg)"\n", - "},\n", - ""y":{\n", - ""title":"Tooth length (mm)"\n", - "}\n", - "},\n", ""data":{\n", ""dose":[0.5,1.0,2.0,0.5,1.0,2.0],\n", ""supp":["OJ","OJ","OJ","VC","VC","VC"],\n", @@ -5353,6 +5388,14 @@ "},{\n", ""aesthetic":"color",\n", ""values":["#fc8452","dark_green"]\n", + "},{\n", + ""aesthetic":"x",\n", + ""name":"Dose (mg)",\n", + ""limits":[null,null]\n", + "},{\n", + ""aesthetic":"y",\n", + ""name":"Tooth length (mm)",\n", + ""limits":[null,null]\n", "}],\n", ""layers":[{\n", ""mapping":{\n", @@ -5408,7 +5451,7 @@ "},\n", ""spec_id":"20"\n", "};\n", - " var containerDiv = document.getElementById("WrZXJC");\n", + " var containerDiv = document.getElementById("6RZake");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -5431,7 +5474,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -5604,7 +5647,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -5634,13 +5677,13 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -5833,23 +5876,15 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", "output": { "mapping": {}, - "guides": { - "x": { - "title": "Dose (mg)" - }, - "y": { - "title": "Tooth length (mm)" - } - }, "data": { "dose": [ 0.5, @@ -5932,6 +5967,22 @@ "#fc8452", "dark_green" ] + }, + { + "aesthetic": "x", + "name": "Dose (mg)", + "limits": [ + null, + null + ] + }, + { + "aesthetic": "y", + "name": "Tooth length (mm)", + "limits": [ + null, + null + ] } ], "layers": [ @@ -6014,8 +6065,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:12:26.243205Z", - "start_time": "2025-02-03T09:12:25.699722Z" + "end_time": "2025-02-17T13:45:02.380395Z", + "start_time": "2025-02-17T13:45:02.299325Z" } }, "source": [ @@ -6038,11 +6089,10 @@ " position = posD\n", " }\n", "\n", - " layout {\n", - " size = 700 to 400\n", - " xAxisLabel = \"Dose (mg)\"\n", - " yAxisLabel = \"Tooth length (mm)\"\n", - " }\n", + " x.axis.name = \"Dose (mg)\"\n", + " y.axis.name = \"Tooth length (mm)\"\n", + "\n", + " layout.size = 700 to 400\n", "}" ], "outputs": [ @@ -6056,7 +6106,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="sqKxSu"></div>\n", + " <div id="GOHCbK"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -6065,14 +6115,6 @@ " var plotSpec={\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"Dose (mg)"\n", - "},\n", - ""y":{\n", - ""title":"Tooth length (mm)"\n", - "}\n", - "},\n", ""data":{\n", ""dose":[0.5,1.0,2.0,0.5,1.0,2.0],\n", ""supp":["OJ","OJ","OJ","VC","VC","VC"],\n", @@ -6103,6 +6145,14 @@ "},{\n", ""aesthetic":"color",\n", ""values":["#fc8452","dark_green"]\n", + "},{\n", + ""aesthetic":"x",\n", + ""name":"Dose (mg)",\n", + ""limits":[null,null]\n", + "},{\n", + ""aesthetic":"y",\n", + ""name":"Tooth length (mm)",\n", + ""limits":[null,null]\n", "}],\n", ""layers":[{\n", ""mapping":{\n", @@ -6159,7 +6209,7 @@ "},\n", ""spec_id":"23"\n", "};\n", - " var containerDiv = document.getElementById("sqKxSu");\n", + " var containerDiv = document.getElementById("GOHCbK");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -6182,7 +6232,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -6355,7 +6405,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -6415,13 +6465,13 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -6628,23 +6678,15 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", "output": { "mapping": {}, - "guides": { - "x": { - "title": "Dose (mg)" - }, - "y": { - "title": "Tooth length (mm)" - } - }, "data": { "dose": [ 0.5, @@ -6734,6 +6776,22 @@ "#fc8452", "dark_green" ] + }, + { + "aesthetic": "x", + "name": "Dose (mg)", + "limits": [ + null, + null + ] + }, + { + "aesthetic": "y", + "name": "Tooth length (mm)", + "limits": [ + null, + null + ] } ], "layers": [ @@ -6810,8 +6868,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:12:26.886484Z", - "start_time": "2025-02-03T09:12:26.331290Z" + "end_time": "2025-02-17T13:45:02.461076Z", + "start_time": "2025-02-17T13:45:02.388528Z" } }, "source": [ @@ -6841,11 +6899,10 @@ " position = posD\n", " }\n", "\n", - " layout {\n", - " size = 700 to 400\n", - " xAxisLabel = \"Dose (mg)\"\n", - " yAxisLabel = \"Tooth length (mm)\"\n", - " }\n", + " x.axis.name = \"Dose (mg)\"\n", + " y.axis.name = \"Tooth length (mm)\"\n", + "\n", + " layout.size = 700 to 400\n", "}" ], "outputs": [ @@ -6859,7 +6916,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="9LJ3jC"></div>\n", + " <div id="y7ku9S"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -6868,14 +6925,6 @@ " var plotSpec={\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"Dose (mg)"\n", - "},\n", - ""y":{\n", - ""title":"Tooth length (mm)"\n", - "}\n", - "},\n", ""data":{\n", ""dose":[0.5,1.0,2.0,0.5,1.0,2.0],\n", ""supp":["OJ","OJ","OJ","VC","VC","VC"],\n", @@ -6906,6 +6955,14 @@ "},{\n", ""aesthetic":"fill",\n", ""values":["#fc8452","dark_green"]\n", + "},{\n", + ""aesthetic":"x",\n", + ""name":"Dose (mg)",\n", + ""limits":[null,null]\n", + "},{\n", + ""aesthetic":"y",\n", + ""name":"Tooth length (mm)",\n", + ""limits":[null,null]\n", "}],\n", ""layers":[{\n", ""mapping":{\n", @@ -6966,7 +7023,7 @@ "},\n", ""spec_id":"26"\n", "};\n", - " var containerDiv = document.getElementById("9LJ3jC");\n", + " var containerDiv = document.getElementById("y7ku9S");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -6989,7 +7046,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -7162,7 +7219,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -7222,13 +7279,13 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -7435,23 +7492,15 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", "output": { "mapping": {}, - "guides": { - "x": { - "title": "Dose (mg)" - }, - "y": { - "title": "Tooth length (mm)" - } - }, "data": { "dose": [ 0.5, @@ -7541,6 +7590,22 @@ "#fc8452", "dark_green" ] + }, + { + "aesthetic": "x", + "name": "Dose (mg)", + "limits": [ + null, + null + ] + }, + { + "aesthetic": "y", + "name": "Tooth length (mm)", + "limits": [ + null, + null + ] } ], "layers": [ diff --git a/examples/notebooks/lets-plot/guides/label_format.ipynb b/examples/notebooks/lets-plot/guides/label_format.ipynb index c5c4b997..3a2480a3 100644 --- a/examples/notebooks/lets-plot/guides/label_format.ipynb +++ b/examples/notebooks/lets-plot/guides/label_format.ipynb @@ -11,8 +11,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:20:46.581166Z", - "start_time": "2025-02-03T09:20:24.505164Z" + "end_time": "2025-02-17T13:47:09.276710Z", + "start_time": "2025-02-17T13:47:03.882281Z" } }, "source": [ @@ -30,8 +30,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:20:53.229084Z", - "start_time": "2025-02-03T09:20:47.774578Z" + "end_time": "2025-02-17T13:47:10.086013Z", + "start_time": "2025-02-17T13:47:09.302493Z" } }, "source": [ @@ -226,7 +226,7 @@ " </style>\n", " </head>\n", " <body>\n", - " <table class="dataframe" id="df_603979776"></table>\n", + " <table class="dataframe" id="df_570425344"></table>\n", "\n", "<p class="dataframe_description">DataFrame: rowsCount = 5, columnsCount = 7</p>\n", "\n", @@ -514,10 +514,10 @@ "{ name: "<span title=\"psavert: Double\">psavert</span>", children: [], rightAlign: true, values: ["<span class=\"formatted\" title=\"\"><span class=\"numbers\">4,8</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">4,9</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">5,3</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">5,0</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">4,5</span></span>"] }, \n", "{ name: "<span title=\"uempmed: Double\">uempmed</span>", children: [], rightAlign: true, values: ["<span class=\"formatted\" title=\"\"><span class=\"numbers\">5,8</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">6,1</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">6,6</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">5,9</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">6,3</span></span>"] }, \n", "{ name: "<span title=\"unemploy: Int\">unemploy</span>", children: [], rightAlign: true, values: ["<span class=\"formatted\" title=\"\"><span class=\"numbers\">6023</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">6089</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">6141</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">6271</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">6226</span></span>"] }, \n", - "], id: 603979776, rootId: 603979776, totalRows: 5 } ) });\n", + "], id: 570425344, rootId: 570425344, totalRows: 5 } ) });\n", "/*-->*/\n", "\n", - "call_DataFrame(function() { DataFrame.renderTable(603979776) });\n", + "call_DataFrame(function() { DataFrame.renderTable(570425344) });\n", "\n", "\n", " </script>\n", @@ -690,10 +690,10 @@ " \n", " \n", " \n", - "
rownamesdatepcepoppsavertuempmedunemploy
4032001-01-016977,000000283920,0000004,8000005,8000006023
4042001-02-016995,800000284137,0000004,9000006,1000006089
4052001-03-016987,900000284350,0000005,3000006,6000006141
4062001-04-017001,200000284581,0000005,0000005,9000006271
4072001-05-017047,100000284810,0000004,5000006,3000006226
\n", + "
rownamesdatepcepoppsavertuempmedunemploy
4032001-01-016977,000000283920,0000004,8000005,8000006023
4042001-02-016995,800000284137,0000004,9000006,1000006089
4052001-03-016987,900000284350,0000005,3000006,6000006141
4062001-04-017001,200000284581,0000005,0000005,9000006271
4072001-05-017047,100000284810,0000004,5000006,3000006226
\n", " \n", " \n", " " ], @@ -729,8 +729,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2025-02-03T09:20:57.060165Z", - "start_time": "2025-02-03T09:20:53.932582Z" + "end_time": "2025-02-17T13:47:10.367981Z", + "start_time": "2025-02-17T13:47:10.090203Z" } }, "outputs": [ @@ -744,7 +744,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="VE6EWJ"></div>\n", + " <div id="nPaL9B"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -795,7 +795,7 @@ "},\n", ""spec_id":"2"\n", "};\n", - " var containerDiv = document.getElementById("VE6EWJ");\n", + " var containerDiv = document.getElementById("nPaL9B");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -818,7 +818,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1003,7 +1003,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1015,7 +1015,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1213,10 +1213,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -1669,8 +1669,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2025-02-03T09:20:59.355015Z", - "start_time": "2025-02-03T09:20:58.513899Z" + "end_time": "2025-02-17T13:47:10.499591Z", + "start_time": "2025-02-17T13:47:10.418149Z" } }, "outputs": [ @@ -1684,7 +1684,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="BV9rx7"></div>\n", + " <div id="C7tVpC"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -1737,7 +1737,7 @@ "},\n", ""spec_id":"5"\n", "};\n", - " var containerDiv = document.getElementById("BV9rx7");\n", + " var containerDiv = document.getElementById("C7tVpC");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -1760,7 +1760,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1929,7 +1929,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1941,7 +1941,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2067,10 +2067,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -2520,8 +2520,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2025-02-03T09:21:00.689248Z", - "start_time": "2025-02-03T09:20:59.847874Z" + "end_time": "2025-02-17T13:47:10.572904Z", + "start_time": "2025-02-17T13:47:10.505259Z" } }, "outputs": [ @@ -2535,7 +2535,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="FCi5F1"></div>\n", + " <div id="Rfityq"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -2589,7 +2589,7 @@ "},\n", ""spec_id":"8"\n", "};\n", - " var containerDiv = document.getElementById("FCi5F1");\n", + " var containerDiv = document.getElementById("Rfityq");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -2612,7 +2612,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2777,7 +2777,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2789,7 +2789,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2901,10 +2901,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -3362,8 +3362,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2025-02-03T09:21:02.465857Z", - "start_time": "2025-02-03T09:21:01.735733Z" + "end_time": "2025-02-17T13:47:10.656892Z", + "start_time": "2025-02-17T13:47:10.579287Z" } }, "outputs": [ @@ -3377,7 +3377,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="9hf6qb"></div>\n", + " <div id="fvxW3j"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -3436,7 +3436,7 @@ "},\n", ""spec_id":"11"\n", "};\n", - " var containerDiv = document.getElementById("9hf6qb");\n", + " var containerDiv = document.getElementById("fvxW3j");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -3459,7 +3459,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3628,7 +3628,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3640,7 +3640,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3766,10 +3766,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -4225,8 +4225,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2025-02-03T09:21:05.001671Z", - "start_time": "2025-02-03T09:21:04.232724Z" + "end_time": "2025-02-17T13:47:10.728988Z", + "start_time": "2025-02-17T13:47:10.662009Z" } }, "outputs": [ @@ -4240,7 +4240,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="3EXX2W"></div>\n", + " <div id="21WPwJ"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -4301,7 +4301,7 @@ "},\n", ""spec_id":"14"\n", "};\n", - " var containerDiv = document.getElementById("3EXX2W");\n", + " var containerDiv = document.getElementById("21WPwJ");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -4324,7 +4324,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4509,7 +4509,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4521,7 +4521,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4719,10 +4719,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -5186,9 +5186,9 @@ " x.constant(LocalDate(2001, 1, 1).atStartOfDayIn(TimeZone.UTC).toEpochMilliseconds())\n", " y.constant(unemploymentMean + 0.5)\n", " }\n", + " y.axis.name = \"unemployment rate\"\n", " layout {\n", " title = \"The US Unemployment Rates 2000-2016.\"\n", - " yAxisLabel = \"unemployment rate\"\n", " size = 900 to 400\n", " }\n", "}" @@ -5196,8 +5196,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2025-02-03T09:21:10.104640Z", - "start_time": "2025-02-03T09:21:07.902481Z" + "end_time": "2025-02-17T13:47:10.890295Z", + "start_time": "2025-02-17T13:47:10.735075Z" } }, "outputs": [ @@ -5211,7 +5211,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="cBRnBT"></div>\n", + " <div id="PJUWnj"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -5223,11 +5223,6 @@ "},\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""y":{\n", - ""title":"unemployment rate"\n", - "}\n", - "},\n", ""data":{\n", ""date":[9.783072E11,9.809856E11,9.834048E11,9.860832E11,9.886752E11,9.913536E11,9.939456E11,9.96624E11,9.993024E11,1.0018944E12,1.0045728E12,1.0071648E12,1.0098432E12,1.0125216E12,1.0149408E12,1.0176192E12,1.0202112E12,1.0228896E12,1.0254816E12,1.02816E12,1.0308384E12,1.0334304E12,1.0361088E12,1.0387008E12,1.0413792E12,1.0440576E12,1.0464768E12,1.0491552E12,1.0517472E12,1.0544256E12,1.0570176E12,1.059696E12,1.0623744E12,1.0649664E12,1.0676448E12,1.0702368E12,1.0729152E12,1.0755936E12,1.0780992E12,1.0807776E12,1.0833696E12,1.086048E12,1.08864E12,1.0913184E12,1.0939968E12,1.0965888E12,1.0992672E12,1.1018592E12,1.1045376E12,1.107216E12,1.1096352E12,1.1123136E12,1.1149056E12,1.117584E12,1.120176E12,1.1228544E12,1.1255328E12,1.1281248E12,1.1308032E12,1.1333952E12,1.1360736E12,1.138752E12,1.1411712E12,1.1438496E12,1.1464416E12,1.14912E12,1.151712E12,1.1543904E12,1.1570688E12,1.1596608E12,1.1623392E12,1.1649312E12,1.1676096E12,1.170288E12,1.1727072E12,1.1753856E12,1.1779776E12,1.180656E12,1.183248E12,1.1859264E12,1.1886048E12,1.1911968E12,1.1938752E12,1.1964672E12,1.1991456E12,1.201824E12,1.2043296E12,1.207008E12,1.2096E12,1.2122784E12,1.2148704E12,1.2175488E12,1.2202272E12,1.2228192E12,1.2254976E12,1.2280896E12,1.230768E12,1.2334464E12,1.2358656E12,1.238544E12,1.241136E12,1.2438144E12,1.2464064E12,1.2490848E12,1.2517632E12,1.2543552E12,1.2570336E12,1.2596256E12,1.262304E12,1.2649824E12,1.2674016E12,1.27008E12,1.272672E12,1.2753504E12,1.2779424E12,1.2806208E12,1.2832992E12,1.2858912E12,1.2885696E12,1.2911616E12,1.29384E12,1.2965184E12,1.2989376E12,1.301616E12,1.304208E12,1.3068864E12,1.3094784E12,1.3121568E12,1.3148352E12,1.3174272E12,1.3201056E12,1.3226976E12,1.325376E12,1.3280544E12,1.33056E12,1.3332384E12,1.3358304E12,1.3385088E12,1.3411008E12,1.3437792E12,1.3464576E12,1.3490496E12,1.351728E12,1.35432E12,1.3569984E12,1.3596768E12,1.362096E12,1.3647744E12,1.3673664E12,1.3700448E12,1.3726368E12,1.3753152E12,1.3779936E12,1.3805856E12,1.383264E12,1.385856E12,1.3885344E12,1.3912128E12,1.393632E12,1.3963104E12,1.3989024E12,1.4015808E12,1.4041728E12,1.4068512E12,1.4095296E12,1.4121216E12,1.4148E12,1.417392E12,1.4200704E12,1.4227488E12,1.425168E12,1.4278464E12],\n", ""uempmed":[5.8,6.1,6.6,5.9,6.3,6.0,6.8,6.9,7.2,7.3,7.7,8.2,8.4,8.3,8.4,8.9,9.5,11.0,8.9,9.0,9.5,9.6,9.3,9.6,9.6,9.5,9.7,10.2,9.9,11.5,10.3,10.1,10.2,10.4,10.3,10.4,10.6,10.2,10.2,9.5,9.9,11.0,8.9,9.2,9.6,9.5,9.7,9.5,9.4,9.2,9.3,9.0,9.1,9.0,8.8,9.2,8.4,8.6,8.5,8.7,8.6,9.1,8.7,8.4,8.5,7.3,8.0,8.4,8.0,7.9,8.3,7.5,8.3,8.5,9.1,8.6,8.2,7.7,8.7,8.8,8.7,8.4,8.6,8.4,9.0,8.7,8.7,9.4,7.9,9.0,9.7,9.7,10.2,10.4,9.8,10.5,10.7,11.7,12.3,13.1,14.2,17.2,16.0,16.3,17.8,18.9,19.8,20.1,20.0,19.9,20.4,22.1,22.3,25.2,22.3,21.0,20.3,21.2,21.0,21.9,21.5,21.1,21.5,20.9,21.6,22.4,22.0,22.4,22.0,20.6,20.8,20.5,20.8,19.7,19.2,19.1,19.9,20.4,17.5,18.4,18.8,19.9,18.6,17.7,15.8,17.2,17.6,17.1,17.1,17.0,16.2,16.5,16.5,16.3,17.1,17.3,15.4,15.9,15.8,15.7,14.6,13.8,13.1,12.9,13.4,13.6,13.0,12.9,13.2,12.9,12.0,11.5]\n", @@ -5264,6 +5259,10 @@ "},{\n", ""aesthetic":"y",\n", ""limits":[null,null]\n", + "},{\n", + ""aesthetic":"y",\n", + ""name":"unemployment rate",\n", + ""limits":[null,null]\n", "}],\n", ""layers":[{\n", ""mapping":{\n", @@ -5330,7 +5329,7 @@ "},\n", ""spec_id":"17"\n", "};\n", - " var containerDiv = document.getElementById("cBRnBT");\n", + " var containerDiv = document.getElementById("PJUWnj");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -5353,7 +5352,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -5538,7 +5537,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -5563,19 +5562,19 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -5778,10 +5777,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -5790,11 +5789,6 @@ "text": "The US Unemployment Rates 2000-2016." }, "mapping": {}, - "guides": { - "y": { - "title": "unemployment rate" - } - }, "data": { "date": [ 978307200000, @@ -6209,6 +6203,14 @@ null, null ] + }, + { + "aesthetic": "y", + "name": "unemployment rate", + "limits": [ + null, + null + ] } ], "layers": [ diff --git a/examples/notebooks/lets-plot/guides/legend_and_axis.ipynb b/examples/notebooks/lets-plot/guides/legend_and_axis.ipynb index 6941c171..af879f33 100644 --- a/examples/notebooks/lets-plot/guides/legend_and_axis.ipynb +++ b/examples/notebooks/lets-plot/guides/legend_and_axis.ipynb @@ -3,8 +3,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:46:44.506757Z", - "start_time": "2025-02-03T09:46:35.708578Z" + "end_time": "2025-02-17T13:47:03.555169Z", + "start_time": "2025-02-17T13:46:59.080204Z" } }, "cell_type": "code", @@ -20,8 +20,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:46:45.733044Z", - "start_time": "2025-02-03T09:46:44.514535Z" + "end_time": "2025-02-17T13:47:04.428626Z", + "start_time": "2025-02-17T13:47:03.580485Z" } }, "source": [ @@ -212,7 +212,7 @@ " </style>\n", " </head>\n", " <body>\n", - " <table class="dataframe" id="df_1476395008"></table>\n", + " <table class="dataframe" id="df_184549376"></table>\n", "\n", "<p class="dataframe_description">DataFrame: rowsCount = 5, columnsCount = 12</p>\n", "\n", @@ -505,10 +505,10 @@ "{ name: "<span title=\"hwy: Int\">hwy</span>", children: [], rightAlign: true, values: ["<span class=\"formatted\" title=\"\"><span class=\"numbers\">29</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">29</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">31</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">30</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">26</span></span>"] }, \n", "{ name: "<span title=\"fl: Char\">fl</span>", children: [], rightAlign: false, values: ["p","p","p","p","p"] }, \n", "{ name: "<span title=\"class: String\">class</span>", children: [], rightAlign: false, values: ["compact","compact","compact","compact","compact"] }, \n", - "], id: 1476395008, rootId: 1476395008, totalRows: 5 } ) });\n", + "], id: 184549376, rootId: 184549376, totalRows: 5 } ) });\n", "/*-->*/\n", "\n", - "call_DataFrame(function() { DataFrame.renderTable(1476395008) });\n", + "call_DataFrame(function() { DataFrame.renderTable(184549376) });\n", "\n", "\n", " </script>\n", @@ -681,10 +681,10 @@ " \n", " \n", " \n", - "
untitledmanufacturermodeldisplyearcyltransdrvctyhwyflclass
1audia41,80000019994auto(l5)f1829pcompact
2audia41,80000019994manual(m5)f2129pcompact
3audia42,00000020084manual(m6)f2031pcompact
4audia42,00000020084auto(av)f2130pcompact
5audia42,80000019996auto(l5)f1626pcompact
\n", + "
untitledmanufacturermodeldisplyearcyltransdrvctyhwyflclass
1audia41,80000019994auto(l5)f1829pcompact
2audia41,80000019994manual(m5)f2129pcompact
3audia42,00000020084manual(m6)f2031pcompact
4audia42,00000020084auto(av)f2130pcompact
5audia42,80000019996auto(l5)f1626pcompact
\n", " \n", " \n", " " ], @@ -701,8 +701,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:46:46.515842Z", - "start_time": "2025-02-03T09:46:45.741515Z" + "end_time": "2025-02-17T13:47:04.780817Z", + "start_time": "2025-02-17T13:47:04.467539Z" } }, "source": [ @@ -727,7 +727,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="qUX57s"></div>\n", + " <div id="Mbck6T"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -785,7 +785,7 @@ "},\n", ""spec_id":"2"\n", "};\n", - " var containerDiv = document.getElementById("qUX57s");\n", + " var containerDiv = document.getElementById("Mbck6T");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -808,7 +808,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -971,7 +971,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1217,7 +1217,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1573,10 +1573,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -2364,8 +2364,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:46:46.892283Z", - "start_time": "2025-02-03T09:46:46.637583Z" + "end_time": "2025-02-17T13:47:04.925261Z", + "start_time": "2025-02-17T13:47:04.836533Z" } }, "source": [ @@ -2395,7 +2395,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="wYuIzP"></div>\n", + " <div id="hlXOUK"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -2460,7 +2460,7 @@ "},\n", ""spec_id":"5"\n", "};\n", - " var containerDiv = document.getElementById("wYuIzP");\n", + " var containerDiv = document.getElementById("hlXOUK");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -2483,7 +2483,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2640,7 +2640,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2886,7 +2886,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3220,10 +3220,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -4018,8 +4018,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:46:47.120231Z", - "start_time": "2025-02-03T09:46:46.914024Z" + "end_time": "2025-02-17T13:47:04.999790Z", + "start_time": "2025-02-17T13:47:04.933975Z" } }, "source": [ @@ -4049,7 +4049,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="HgQRon"></div>\n", + " <div id="b8RBzg"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -4115,7 +4115,7 @@ "},\n", ""spec_id":"8"\n", "};\n", - " var containerDiv = document.getElementById("HgQRon");\n", + " var containerDiv = document.getElementById("b8RBzg");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -4138,7 +4138,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4295,7 +4295,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4541,7 +4541,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4875,10 +4875,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -5674,8 +5674,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:46:47.411477Z", - "start_time": "2025-02-03T09:46:47.141258Z" + "end_time": "2025-02-17T13:47:05.097718Z", + "start_time": "2025-02-17T13:47:05.008405Z" } }, "source": [ @@ -5709,7 +5709,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="TMFwod"></div>\n", + " <div id="MseJeX"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -5783,7 +5783,7 @@ "},\n", ""spec_id":"11"\n", "};\n", - " var containerDiv = document.getElementById("TMFwod");\n", + " var containerDiv = document.getElementById("MseJeX");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -5806,7 +5806,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -6116,7 +6116,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -6362,7 +6362,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -6632,10 +6632,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -7439,8 +7439,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:46:47.783255Z", - "start_time": "2025-02-03T09:46:47.446087Z" + "end_time": "2025-02-17T13:47:05.180467Z", + "start_time": "2025-02-17T13:47:05.107026Z" } }, "source": [ @@ -7466,7 +7466,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="9iH86M"></div>\n", + " <div id="cYGiR9"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -7529,7 +7529,7 @@ "},\n", ""spec_id":"14"\n", "};\n", - " var containerDiv = document.getElementById("9iH86M");\n", + " var containerDiv = document.getElementById("cYGiR9");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -7552,7 +7552,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -7723,7 +7723,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -7969,7 +7969,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -8270,10 +8270,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -9305,8 +9305,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:46:48.139792Z", - "start_time": "2025-02-03T09:46:47.862520Z" + "end_time": "2025-02-17T13:47:05.270425Z", + "start_time": "2025-02-17T13:47:05.190382Z" } }, "source": [ @@ -9341,7 +9341,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="pOzCyA"></div>\n", + " <div id="j9EPIE"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -9412,7 +9412,7 @@ "},\n", ""spec_id":"17"\n", "};\n", - " var containerDiv = document.getElementById("pOzCyA");\n", + " var containerDiv = document.getElementById("j9EPIE");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -9435,7 +9435,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -9781,7 +9781,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -10027,7 +10027,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -10219,10 +10219,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -11268,8 +11268,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:46:48.639005Z", - "start_time": "2025-02-03T09:46:48.191089Z" + "end_time": "2025-02-17T13:47:05.430158Z", + "start_time": "2025-02-17T13:47:05.280475Z" } }, "source": [ @@ -11292,6 +11292,8 @@ " }\n", " }\n", " }\n", + " x.axis.name = \"Engine displacement (L)\"\n", + " y.axis.name = \"Highway MPG\"\n", " layout {\n", " size = 700 to 350\n", " style {\n", @@ -11302,8 +11304,6 @@ " direction = LegendDirection.HORIZONTAL\n", " }\n", " }\n", - " xAxisLabel = \"Engine displacement (L)\"\n", - " yAxisLabel = \"Highway MPG\"\n", " }\n", "}" ], @@ -11318,7 +11318,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="ehmxV4"></div>\n", + " <div id="Sf3Eq1"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -11327,14 +11327,6 @@ " var plotSpec={\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"Engine displacement (L)"\n", - "},\n", - ""y":{\n", - ""title":"Highway MPG"\n", - "}\n", - "},\n", ""data":{\n", ""displ":[1.8,1.8,2.0,2.0,2.8,2.8,3.1,1.8,1.8,2.0,2.0,2.8,2.8,3.1,3.1,2.8,3.1,4.2,5.3,5.3,5.3,5.7,6.0,5.7,5.7,6.2,6.2,7.0,5.3,5.3,5.7,6.5,2.4,2.4,3.1,3.5,3.6,2.4,3.0,3.3,3.3,3.3,3.3,3.3,3.8,3.8,3.8,4.0,3.7,3.7,3.9,3.9,4.7,4.7,4.7,5.2,5.2,3.9,4.7,4.7,4.7,5.2,5.7,5.9,4.7,4.7,4.7,4.7,4.7,4.7,5.2,5.2,5.7,5.9,4.6,5.4,5.4,4.0,4.0,4.0,4.0,4.6,5.0,4.2,4.2,4.6,4.6,4.6,5.4,5.4,3.8,3.8,4.0,4.0,4.6,4.6,4.6,4.6,5.4,1.6,1.6,1.6,1.6,1.6,1.8,1.8,1.8,2.0,2.4,2.4,2.4,2.4,2.5,2.5,3.3,2.0,2.0,2.0,2.0,2.7,2.7,2.7,3.0,3.7,4.0,4.7,4.7,4.7,5.7,6.1,4.0,4.2,4.4,4.6,5.4,5.4,5.4,4.0,4.0,4.6,5.0,2.4,2.4,2.5,2.5,3.5,3.5,3.0,3.0,3.5,3.3,3.3,4.0,5.6,3.1,3.8,3.8,3.8,5.3,2.5,2.5,2.5,2.5,2.5,2.5,2.2,2.2,2.5,2.5,2.5,2.5,2.5,2.5,2.7,2.7,3.4,3.4,4.0,4.7,2.2,2.2,2.4,2.4,3.0,3.0,3.5,2.2,2.2,2.4,2.4,3.0,3.0,3.3,1.8,1.8,1.8,1.8,1.8,4.7,5.7,2.7,2.7,2.7,3.4,3.4,4.0,4.0,2.0,2.0,2.0,2.0,2.8,1.9,2.0,2.0,2.0,2.0,2.5,2.5,2.8,2.8,1.9,1.9,2.0,2.0,2.5,2.5,1.8,1.8,2.0,2.0,2.8,2.8,3.6],\n", ""cty":[18.0,21.0,20.0,21.0,16.0,18.0,18.0,18.0,16.0,20.0,19.0,15.0,17.0,17.0,15.0,15.0,17.0,16.0,14.0,11.0,14.0,13.0,12.0,16.0,15.0,16.0,15.0,15.0,14.0,11.0,11.0,14.0,19.0,22.0,18.0,18.0,17.0,18.0,17.0,16.0,16.0,17.0,17.0,11.0,15.0,15.0,16.0,16.0,15.0,14.0,13.0,14.0,14.0,14.0,9.0,11.0,11.0,13.0,13.0,9.0,13.0,11.0,13.0,11.0,12.0,9.0,13.0,13.0,12.0,9.0,11.0,11.0,13.0,11.0,11.0,11.0,12.0,14.0,15.0,14.0,13.0,13.0,13.0,14.0,14.0,13.0,13.0,13.0,11.0,13.0,18.0,18.0,17.0,16.0,15.0,15.0,15.0,15.0,14.0,28.0,24.0,25.0,23.0,24.0,26.0,25.0,24.0,21.0,18.0,18.0,21.0,21.0,18.0,18.0,19.0,19.0,19.0,20.0,20.0,17.0,16.0,17.0,17.0,15.0,15.0,14.0,9.0,14.0,13.0,11.0,11.0,12.0,12.0,11.0,11.0,11.0,12.0,14.0,13.0,13.0,13.0,21.0,19.0,23.0,23.0,19.0,19.0,18.0,19.0,19.0,14.0,15.0,14.0,12.0,18.0,16.0,17.0,18.0,16.0,18.0,18.0,20.0,19.0,20.0,18.0,21.0,19.0,19.0,19.0,20.0,20.0,19.0,20.0,15.0,16.0,15.0,15.0,16.0,14.0,21.0,21.0,21.0,21.0,18.0,18.0,19.0,21.0,21.0,21.0,22.0,18.0,18.0,18.0,24.0,24.0,26.0,28.0,26.0,11.0,13.0,15.0,16.0,17.0,15.0,15.0,15.0,16.0,21.0,19.0,21.0,22.0,17.0,33.0,21.0,19.0,22.0,21.0,21.0,21.0,16.0,17.0,35.0,29.0,21.0,19.0,20.0,20.0,21.0,18.0,19.0,21.0,16.0,18.0,17.0],\n", @@ -11369,6 +11361,14 @@ ""breaks":["f","r","4"],\n", ""name":"Drive-train",\n", ""labels":["front","rear","4X4"]\n", + "},{\n", + ""aesthetic":"x",\n", + ""name":"Engine displacement (L)",\n", + ""limits":[null,null]\n", + "},{\n", + ""aesthetic":"y",\n", + ""name":"Highway MPG",\n", + ""limits":[null,null]\n", "}],\n", ""layers":[{\n", ""mapping":{\n", @@ -11411,7 +11411,7 @@ "},\n", ""spec_id":"20"\n", "};\n", - " var containerDiv = document.getElementById("ehmxV4");\n", + " var containerDiv = document.getElementById("Sf3Eq1");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -11434,7 +11434,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -11780,7 +11780,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -12026,7 +12026,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -12218,23 +12218,15 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", "output": { "mapping": {}, - "guides": { - "x": { - "title": "Engine displacement (L)" - }, - "y": { - "title": "Highway MPG" - } - }, "data": { "displ": [ 1.8, @@ -13230,6 +13222,22 @@ "rear", "4X4" ] + }, + { + "aesthetic": "x", + "name": "Engine displacement (L)", + "limits": [ + null, + null + ] + }, + { + "aesthetic": "y", + "name": "Highway MPG", + "limits": [ + null, + null + ] } ], "layers": [ diff --git a/examples/notebooks/lets-plot/guides/plot_bunch.ipynb b/examples/notebooks/lets-plot/guides/plot_bunch.ipynb index e3193cf8..d1fb6db5 100644 --- a/examples/notebooks/lets-plot/guides/plot_bunch.ipynb +++ b/examples/notebooks/lets-plot/guides/plot_bunch.ipynb @@ -15,8 +15,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:21:10.571753Z", - "start_time": "2025-02-03T09:20:57.594428Z" + "end_time": "2025-02-17T13:47:05.399542Z", + "start_time": "2025-02-17T13:47:01.964756Z" } }, "source": [ @@ -33,8 +33,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:21:13.495529Z", - "start_time": "2025-02-03T09:21:10.926970Z" + "end_time": "2025-02-17T13:47:05.661270Z", + "start_time": "2025-02-17T13:47:05.429072Z" } }, "source": [ @@ -66,8 +66,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:21:18.300677Z", - "start_time": "2025-02-03T09:21:14.900016Z" + "end_time": "2025-02-17T13:47:06.033003Z", + "start_time": "2025-02-17T13:47:05.666232Z" } }, "source": [ @@ -80,8 +80,6 @@ " }\n", " layout {\n", " size = 600 to 200\n", - " xAxisLabel = \"x\"\n", - " yAxisLabel = \"y\"\n", " }\n", "}\n", "myScatter" @@ -97,7 +95,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="BFRAfo"></div>\n", + " <div id="7zk5p9"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -106,14 +104,6 @@ " var plotSpec={\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"x"\n", - "},\n", - ""y":{\n", - ""title":"y"\n", - "}\n", - "},\n", ""data":{\n", "},\n", ""ggsize":{\n", @@ -156,7 +146,7 @@ "}],\n", ""spec_id":"2"\n", "};\n", - " var containerDiv = document.getElementById("BFRAfo");\n", + " var containerDiv = document.getElementById("7zk5p9");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -179,7 +169,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -342,7 +332,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -754,7 +744,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -857,23 +847,15 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", "output": { "mapping": {}, - "guides": { - "x": { - "title": "x" - }, - "y": { - "title": "y" - } - }, "data": {}, "ggsize": { "width": 600.0, @@ -1745,8 +1727,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:21:21.697856Z", - "start_time": "2025-02-03T09:21:19.423653Z" + "end_time": "2025-02-17T13:47:06.192322Z", + "start_time": "2025-02-17T13:47:06.044624Z" } }, "source": [ @@ -1756,7 +1738,6 @@ " }\n", " layout {\n", " size = 600 to 200\n", - " xAxisLabel = \"x\"\n", " }\n", "}\n", "myHistogram" @@ -1772,7 +1753,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="H6CwzP"></div>\n", + " <div id="Hn9Gdr"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -1781,11 +1762,6 @@ " var plotSpec={\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"x"\n", - "}\n", - "},\n", ""data":{\n", "},\n", ""ggsize":{\n", @@ -1811,8 +1787,8 @@ "},\n", ""stat":"identity",\n", ""data":{\n", - ""count":[3.0,5.0,6.0,7.0,15.0,19.0,28.0,39.0,30.0,42.0,54.0,36.0,34.0,31.0,18.0,13.0,12.0,4.0,2.0,2.0],\n", - ""x":[-2.4149344904997463,-2.1466084359997746,-1.8782823814998024,-1.6099563269998307,-1.341630272499859,-1.0733042179998873,-0.8049781634999152,-0.5366521089999434,-0.2683260544999717,0.0,0.26832605449997193,0.5366521089999439,0.8049781634999156,1.0733042179998875,1.3416302724998594,1.6099563269998312,1.8782823814998029,2.1466084359997746,2.4149344904997463,2.683260544999718]\n", + ""x":[-2.4149344904997463,-2.1466084359997746,-1.8782823814998024,-1.6099563269998307,-1.341630272499859,-1.0733042179998873,-0.8049781634999152,-0.5366521089999434,-0.2683260544999717,0.0,0.26832605449997193,0.5366521089999439,0.8049781634999156,1.0733042179998875,1.3416302724998594,1.6099563269998312,1.8782823814998029,2.1466084359997746,2.4149344904997463,2.683260544999718],\n", + ""count":[3.0,5.0,6.0,7.0,15.0,19.0,28.0,39.0,30.0,42.0,54.0,36.0,34.0,31.0,18.0,13.0,12.0,4.0,2.0,2.0]\n", "},\n", ""sampling":"none",\n", ""inherit_aes":false,\n", @@ -1831,7 +1807,7 @@ "}],\n", ""spec_id":"5"\n", "};\n", - " var containerDiv = document.getElementById("H6CwzP");\n", + " var containerDiv = document.getElementById("Hn9Gdr");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -1854,7 +1830,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2017,7 +1993,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2065,7 +2041,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2168,20 +2144,15 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", "output": { "mapping": {}, - "guides": { - "x": { - "title": "x" - } - }, "data": {}, "ggsize": { "width": 600.0, @@ -2307,8 +2278,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:21:24.269405Z", - "start_time": "2025-02-03T09:21:21.778965Z" + "end_time": "2025-02-17T13:47:06.363903Z", + "start_time": "2025-02-17T13:47:06.198278Z" } }, "source": [ @@ -2333,8 +2304,6 @@ " }\n", " layout {\n", " size = 600 to 200\n", - " xAxisLabel = \"x\"\n", - " yAxisLabel = \"y\"\n", " }\n", " }, 0, 200)\n", "}" @@ -2350,7 +2319,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="4vx4cz"></div>\n", + " <div id="FBw9o9"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -2423,14 +2392,6 @@ ""feature_spec":{\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"x"\n", - "},\n", - ""y":{\n", - ""title":"y"\n", - "}\n", - "},\n", ""data":{\n", "},\n", ""ggsize":{\n", @@ -2476,7 +2437,7 @@ ""height":null\n", "}]\n", "};\n", - " var containerDiv = document.getElementById("4vx4cz");\n", + " var containerDiv = document.getElementById("FBw9o9");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -2499,7 +2460,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -2794,7 +2755,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2842,7 +2803,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2945,10 +2906,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -2982,7 +2943,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3394,7 +3355,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3506,11 +3467,11 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -3636,14 +3597,6 @@ { "feature_spec": { "mapping": {}, - "guides": { - "x": { - "title": "x" - }, - "y": { - "title": "y" - } - }, "data": {}, "ggsize": { "width": 600.0, @@ -4529,8 +4482,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:21:25.240051Z", - "start_time": "2025-02-03T09:21:24.385665Z" + "end_time": "2025-02-17T13:47:06.432675Z", + "start_time": "2025-02-17T13:47:06.376977Z" } }, "source": [ @@ -4555,8 +4508,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:21:27.242570Z", - "start_time": "2025-02-03T09:21:25.254554Z" + "end_time": "2025-02-17T13:47:06.568497Z", + "start_time": "2025-02-17T13:47:06.434862Z" } }, "source": [ @@ -4581,8 +4534,6 @@ " }\n", " layout {\n", " size = 600 to 200\n", - " xAxisLabel = \"x\"\n", - " yAxisLabel = \"y\"\n", " style(lowerStyle)\n", " }\n", " }, 0, 200)\n", @@ -4599,7 +4550,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="YTxzGb"></div>\n", + " <div id="6E8YgF"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -4687,14 +4638,6 @@ ""feature_spec":{\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"x"\n", - "},\n", - ""y":{\n", - ""title":"y"\n", - "}\n", - "},\n", ""data":{\n", "},\n", ""ggsize":{\n", @@ -4752,7 +4695,7 @@ ""height":null\n", "}]\n", "};\n", - " var containerDiv = document.getElementById("YTxzGb");\n", + " var containerDiv = document.getElementById("6E8YgF");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -4775,7 +4718,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -5131,7 +5074,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -5179,7 +5122,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -5196,10 +5139,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -5258,7 +5201,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -5670,7 +5613,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -5692,11 +5635,11 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -5837,14 +5780,6 @@ { "feature_spec": { "mapping": {}, - "guides": { - "x": { - "title": "x" - }, - "y": { - "title": "y" - } - }, "data": {}, "ggsize": { "width": 600.0, @@ -6746,8 +6681,8 @@ "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2025-02-03T09:21:29.994252Z", - "start_time": "2025-02-03T09:21:28.750455Z" + "end_time": "2025-02-17T13:47:06.691839Z", + "start_time": "2025-02-17T13:47:06.582552Z" } }, "source": [ @@ -6772,8 +6707,6 @@ " }\n", " layout {\n", " size = 600 to 200\n", - " xAxisLabel = \"x\"\n", - " yAxisLabel = \"y\"\n", " style(lowerStyle)\n", " }\n", " }, 0, 100, 600, 300)\n", @@ -6790,7 +6723,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="dHJ9zq"></div>\n", + " <div id="trNi3x"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -6836,8 +6769,8 @@ "},\n", ""stat":"identity",\n", ""data":{\n", - ""x":[-2.4149344904997463,-2.1466084359997746,-1.8782823814998024,-1.6099563269998307,-1.341630272499859,-1.0733042179998873,-0.8049781634999152,-0.5366521089999434,-0.2683260544999717,0.0,0.26832605449997193,0.5366521089999439,0.8049781634999156,1.0733042179998875,1.3416302724998594,1.6099563269998312,1.8782823814998029,2.1466084359997746,2.4149344904997463,2.683260544999718],\n", - ""count":[3.0,5.0,6.0,7.0,15.0,19.0,28.0,39.0,30.0,42.0,54.0,36.0,34.0,31.0,18.0,13.0,12.0,4.0,2.0,2.0]\n", + ""count":[3.0,5.0,6.0,7.0,15.0,19.0,28.0,39.0,30.0,42.0,54.0,36.0,34.0,31.0,18.0,13.0,12.0,4.0,2.0,2.0],\n", + ""x":[-2.4149344904997463,-2.1466084359997746,-1.8782823814998024,-1.6099563269998307,-1.341630272499859,-1.0733042179998873,-0.8049781634999152,-0.5366521089999434,-0.2683260544999717,0.0,0.26832605449997193,0.5366521089999439,0.8049781634999156,1.0733042179998875,1.3416302724998594,1.6099563269998312,1.8782823814998029,2.1466084359997746,2.4149344904997463,2.683260544999718]\n", "},\n", ""sampling":"none",\n", ""inherit_aes":false,\n", @@ -6878,14 +6811,6 @@ ""feature_spec":{\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"x"\n", - "},\n", - ""y":{\n", - ""title":"y"\n", - "}\n", - "},\n", ""data":{\n", "},\n", ""ggsize":{\n", @@ -6943,7 +6868,7 @@ ""height":300\n", "}]\n", "};\n", - " var containerDiv = document.getElementById("dHJ9zq");\n", + " var containerDiv = document.getElementById("trNi3x");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -6966,7 +6891,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -7315,7 +7240,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -7363,7 +7288,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -7380,10 +7305,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -7469,7 +7394,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -7881,7 +7806,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -7903,11 +7828,11 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -8048,14 +7973,6 @@ { "feature_spec": { "mapping": {}, - "guides": { - "x": { - "title": "x" - }, - "y": { - "title": "y" - } - }, "data": {}, "ggsize": { "width": 600.0, diff --git a/examples/notebooks/lets-plot/samples/area/area_fixed.ipynb b/examples/notebooks/lets-plot/samples/area/area_fixed.ipynb index 78ca216b..13a1dca1 100644 --- a/examples/notebooks/lets-plot/samples/area/area_fixed.ipynb +++ b/examples/notebooks/lets-plot/samples/area/area_fixed.ipynb @@ -5,8 +5,8 @@ "metadata": { "collapsed": true, "ExecuteTime": { - "end_time": "2025-02-03T09:52:07.639327Z", - "start_time": "2025-02-03T09:52:00.272476Z" + "end_time": "2025-02-17T13:41:04.499408Z", + "start_time": "2025-02-17T13:40:58.867972Z" } }, "source": [ @@ -33,8 +33,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2025-02-03T09:52:08.349083Z", - "start_time": "2025-02-03T09:52:07.701527Z" + "end_time": "2025-02-17T13:41:04.837632Z", + "start_time": "2025-02-17T13:41:04.529660Z" } }, "outputs": [], @@ -47,12 +47,12 @@ " layout {\n", " title = \"Water Level\"\n", " subtitle = \"Annual Water Level Fluctuations in Reservoir\"\n", - " yAxisLabel = \"Month\"\n", - " xAxisLabel = \"Water Level (meters)\"\n", " }\n", - "\n", - " x(month)\n", - " y { axis.limits = 3.0..8.0 }\n", + " x(month) { axis.name = \"Month\" }\n", + " y.axis {\n", + " name = \"Water Level (meters)\"\n", + " limits = 3.0..8.0\n", + " }\n", " line {\n", " y(waterLvl)\n", " }\n", @@ -67,8 +67,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2025-02-03T09:52:09.240681Z", - "start_time": "2025-02-03T09:52:08.400685Z" + "end_time": "2025-02-17T13:41:05.235244Z", + "start_time": "2025-02-17T13:41:04.860858Z" } }, "outputs": [ @@ -82,7 +82,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="CVETAX"></div>\n", + " <div id="9cghs0"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -95,14 +95,6 @@ "},\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"Water Level (meters)"\n", - "},\n", - ""y":{\n", - ""title":"Month"\n", - "}\n", - "},\n", ""coord":{\n", ""name":"cartesian",\n", ""flip":false,\n", @@ -115,7 +107,8 @@ ""kind":"plot",\n", ""scales":[{\n", ""aesthetic":"x",\n", - ""discrete":true\n", + ""discrete":true,\n", + ""name":"Month"\n", "},{\n", ""aesthetic":"y",\n", ""limits":[null,null]\n", @@ -124,9 +117,11 @@ ""limits":[null,null]\n", "},{\n", ""aesthetic":"x",\n", - ""discrete":true\n", + ""discrete":true,\n", + ""name":"Month"\n", "},{\n", ""aesthetic":"y",\n", + ""name":"Water Level (meters)",\n", ""limits":[null,null]\n", "}],\n", ""layers":[{\n", @@ -168,7 +163,7 @@ "},\n", ""spec_id":"2"\n", "};\n", - " var containerDiv = document.getElementById("CVETAX");\n", + " var containerDiv = document.getElementById("9cghs0");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -191,7 +186,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -372,7 +367,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -394,13 +389,13 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -577,21 +572,21 @@ " \n", " \n", " \n", - " Month\n", + " Water Level (meters)\n", " \n", " \n", " \n", " \n", - " Water Level (meters)\n", + " Month\n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -601,14 +596,6 @@ "subtitle": "Annual Water Level Fluctuations in Reservoir" }, "mapping": {}, - "guides": { - "x": { - "title": "Water Level (meters)" - }, - "y": { - "title": "Month" - } - }, "coord": { "name": "cartesian", "flip": false, @@ -651,7 +638,8 @@ "scales": [ { "aesthetic": "x", - "discrete": true + "discrete": true, + "name": "Month" }, { "aesthetic": "y", @@ -669,10 +657,12 @@ }, { "aesthetic": "x", - "discrete": true + "discrete": true, + "name": "Month" }, { "aesthetic": "y", + "name": "Water Level (meters)", "limits": [ null, null diff --git a/examples/notebooks/lets-plot/samples/bars/bar_settings.ipynb b/examples/notebooks/lets-plot/samples/bars/bar_settings.ipynb index 56bcf2a2..e67dba07 100644 --- a/examples/notebooks/lets-plot/samples/bars/bar_settings.ipynb +++ b/examples/notebooks/lets-plot/samples/bars/bar_settings.ipynb @@ -5,8 +5,8 @@ "metadata": { "collapsed": true, "ExecuteTime": { - "end_time": "2025-02-03T09:57:12.945982Z", - "start_time": "2025-02-03T09:57:03.848029Z" + "end_time": "2025-02-17T13:41:44.063946Z", + "start_time": "2025-02-17T13:41:40.042828Z" } }, "source": [ @@ -31,8 +31,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2025-02-03T09:57:14.024958Z", - "start_time": "2025-02-03T09:57:13.050699Z" + "end_time": "2025-02-17T13:41:44.326707Z", + "start_time": "2025-02-17T13:41:44.088200Z" } }, "outputs": [], @@ -42,11 +42,9 @@ "cell_type": "code", "source": [ "dataset.plot {\n", - " layout {\n", - " title = \"Sugar content\"\n", - " xAxisLabel = \"Candy Name\"\n", - " yAxisLabel = \"Sugar Content (g per 100g)\"\n", - " }\n", + " layout.title = \"Sugar content\"\n", + " x.axis.name = \"Candy Name\"\n", + " y.axis.name = \"Sugar Content (g per 100g)\"\n", " bars {\n", " x(candy)\n", " y(sugar) { scale = continuous(0..100) }\n", @@ -62,8 +60,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2025-02-03T09:57:15.229046Z", - "start_time": "2025-02-03T09:57:14.032012Z" + "end_time": "2025-02-17T13:41:44.710859Z", + "start_time": "2025-02-17T13:41:44.349072Z" } }, "outputs": [ @@ -77,7 +75,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="np09AK"></div>\n", + " <div id="3myxH4"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -89,14 +87,6 @@ "},\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""x":{\n", - ""title":"Candy Name"\n", - "},\n", - ""y":{\n", - ""title":"Sugar Content (g per 100g)"\n", - "}\n", - "},\n", ""data":{\n", ""candy":["Honey Stars","Fairy Tale Caramels"," ChocoDream","Fruity Clouds","Minty Spheres","Sour Strips","Vanilla Bars"],\n", ""sugar":[65.0,58.0,53.0,35.0,40.0,45.0,50.0]\n", @@ -108,6 +98,14 @@ "},{\n", ""aesthetic":"y",\n", ""limits":[0.0,100.0]\n", + "},{\n", + ""aesthetic":"x",\n", + ""name":"Candy Name",\n", + ""limits":[null,null]\n", + "},{\n", + ""aesthetic":"y",\n", + ""name":"Sugar Content (g per 100g)",\n", + ""limits":[null,null]\n", "}],\n", ""layers":[{\n", ""mapping":{\n", @@ -137,7 +135,7 @@ "},\n", ""spec_id":"2"\n", "};\n", - " var containerDiv = document.getElementById("np09AK");\n", + " var containerDiv = document.getElementById("3myxH4");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -160,7 +158,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", + " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -364,7 +364,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -373,7 +373,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -382,7 +382,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -391,7 +391,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -400,7 +400,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -409,7 +409,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -418,10 +418,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -429,24 +429,31 @@ " \n", " \n", " \n", - " \n", + " \n", + " \n", + " \n", + " 20\n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " 50\n", + " 40\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " 100\n", + " 60\n", " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " Sugar content\n", " \n", @@ -456,7 +463,7 @@ " Sugar Content (g per 100g)\n", " \n", " \n", - " \n", + " \n", " \n", " Candy Name\n", " \n", @@ -464,10 +471,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -476,14 +483,6 @@ "text": "Sugar content" }, "mapping": {}, - "guides": { - "x": { - "title": "Candy Name" - }, - "y": { - "title": "Sugar Content (g per 100g)" - } - }, "data": { "candy": [ "Honey Stars", @@ -516,6 +515,22 @@ 0.0, 100.0 ] + }, + { + "aesthetic": "x", + "name": "Candy Name", + "limits": [ + null, + null + ] + }, + { + "aesthetic": "y", + "name": "Sugar Content (g per 100g)", + "limits": [ + null, + null + ] } ], "layers": [ diff --git a/examples/notebooks/lets-plot/samples/line/path_line.ipynb b/examples/notebooks/lets-plot/samples/line/path_line.ipynb index f9014bc1..f149ad0e 100644 --- a/examples/notebooks/lets-plot/samples/line/path_line.ipynb +++ b/examples/notebooks/lets-plot/samples/line/path_line.ipynb @@ -5,8 +5,8 @@ "metadata": { "collapsed": true, "ExecuteTime": { - "end_time": "2025-02-03T10:57:39.752456Z", - "start_time": "2025-02-03T10:57:27.161164Z" + "end_time": "2025-02-17T13:47:37.999390Z", + "start_time": "2025-02-17T13:47:34.299572Z" } }, "source": [ @@ -27,14 +27,11 @@ " layout {\n", " title = \"Performance Dependency on Temperature\"\n", " subtitle = \"Analysis of Material Performance Decline at Extremely Low Temperatures\"\n", - " yAxisLabel = \"Performance Measure\"\n", " size = 700 to 550\n", " }\n", " path {\n", - " y(dist)\n", - " x(temp) {\n", - " axis.name = \"Temperature (°C)\"\n", - " }\n", + " y(dist) { axis.name = \"Performance Measure\"}\n", + " x(temp) { axis.name = \"Temperature (°C)\" }\n", " color = Color.BLUE\n", " type = LineType.LONGDASH\n", " }\n", @@ -43,8 +40,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2025-02-03T10:57:41.542978Z", - "start_time": "2025-02-03T10:57:39.771344Z" + "end_time": "2025-02-17T13:47:38.396253Z", + "start_time": "2025-02-17T13:47:38.021719Z" } }, "outputs": [ @@ -58,7 +55,7 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.5.1/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="cG7WJo"></div>\n", + " <div id="2s8uVR"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " \n", " (function() {\n", @@ -71,11 +68,6 @@ "},\n", ""mapping":{\n", "},\n", - ""guides":{\n", - ""y":{\n", - ""title":"Performance Measure"\n", - "}\n", - "},\n", ""data":{\n", "},\n", ""ggsize":{\n", @@ -85,6 +77,7 @@ ""kind":"plot",\n", ""scales":[{\n", ""aesthetic":"y",\n", + ""name":"Performance Measure",\n", ""limits":[null,null]\n", "},{\n", ""aesthetic":"x",\n", @@ -119,7 +112,7 @@ "}],\n", ""spec_id":"2"\n", "};\n", - " var containerDiv = document.getElementById("cG7WJo");\n", + " var containerDiv = document.getElementById("2s8uVR");\n", " \n", " var toolbar = null;\n", " var plotContainer = containerDiv; \n", @@ -142,7 +135,7 @@ " \n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -335,7 +328,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -347,7 +340,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -575,10 +568,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -588,11 +581,6 @@ "subtitle": "Analysis of Material Performance Decline at Extremely Low Temperatures" }, "mapping": {}, - "guides": { - "y": { - "title": "Performance Measure" - } - }, "data": {}, "ggsize": { "width": 700.0, @@ -602,6 +590,7 @@ "scales": [ { "aesthetic": "y", + "name": "Performance Measure", "limits": [ null, null diff --git a/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/feature/Layout.kt b/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/feature/Layout.kt index 48150558..e1a708ab 100644 --- a/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/feature/Layout.kt +++ b/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/feature/Layout.kt @@ -27,8 +27,6 @@ import org.jetbrains.kotlinx.kandy.letsplot.style.Theme * layout { * title = "Main Title" * subtitle = "Subtitle" - * xAxisLabel = "X-Axis" - * yAxisLabel = "Y-Axis" * style(Style.Grey) * } * } @@ -60,8 +58,6 @@ public val PlotBuilder.layout: Layout * @property title the main title of the plot. * @property subtitle the subtitle displayed below the main title. * @property caption additional text displayed at the bottom of the plot. - * @property xAxisLabel label for the X-Axis. - * @property yAxisLabel label for the Y-Axis. * @property theme the theme of the plot. * @property size the dimensions (width x height) of the plot in pixels. */ @@ -69,9 +65,6 @@ public data class Layout( var title: String? = null, var subtitle: String? = null, var caption: String? = null, - // TODO(https://github.com/Kotlin/kandy/issues/411) - var xAxisLabel: String? = null, - var yAxisLabel: String? = null, var theme: Theme? = null, var size: Pair? = null ) : PlotFeature { diff --git a/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/translator/feature.kt b/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/translator/feature.kt index 35ac1cfa..7c115822 100644 --- a/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/translator/feature.kt +++ b/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/translator/feature.kt @@ -65,7 +65,7 @@ internal fun Theme.wrap(): OptionsMap { internal fun Layout.wrap(featureBuffer: MutableList) { val labs = labs( - title, subtitle, caption, xAxisLabel, yAxisLabel + title, subtitle, caption ) featureBuffer.addAll(labs.elements) size?.let { diff --git a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/feature/layout.kt b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/feature/layout.kt index 1ab3640e..423479bd 100644 --- a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/feature/layout.kt +++ b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/feature/layout.kt @@ -14,8 +14,6 @@ class LayoutTests { title = "Test Title", subtitle = "Test Subtitle", caption = "Test Caption", - xAxisLabel = "x", - yAxisLabel = "y", theme = Theme.DARCULA, size = Pair(800, 600) ) @@ -23,8 +21,6 @@ class LayoutTests { assertEquals("Test Title", layout.title) assertEquals("Test Subtitle", layout.subtitle) assertEquals("Test Caption", layout.caption) - assertEquals("x", layout.xAxisLabel) - assertEquals("y", layout.yAxisLabel) assertEquals(Theme.DARCULA, layout.theme) assertEquals(Pair(800, 600), layout.size) } diff --git a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/area.kt b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/area.kt index f1ea5a74..3a5354c3 100644 --- a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/area.kt +++ b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/area.kt @@ -69,7 +69,6 @@ class Area : SampleHelper("area") { val load = column("load") loadServer.plot { - layout.title = "Daily Server Load Dynamics" area { x(time) { axis.name = "Time" } y(load) { @@ -84,6 +83,8 @@ class Area : SampleHelper("area") { fillColor = Color.RED alpha = 0.7 } + + layout.title = "Daily Server Load Dynamics" } // SampleEnd .saveSample() @@ -96,7 +97,6 @@ class Area : SampleHelper("area") { val load = listOf(10, 5, 15, 50, 75, 60, 80, 40) plot { - layout.title = "Daily Server Load Dynamics" area { x(time) { axis.name = "Time" } y(load) { axis.name = "Load (%)" } @@ -108,6 +108,8 @@ class Area : SampleHelper("area") { fillColor = Color.RED alpha = 0.7 } + + layout.title = "Daily Server Load Dynamics" } // SampleEnd } @@ -126,15 +128,13 @@ class Area : SampleHelper("area") { val reservoirDf = dataFrameOf(month, waterLvl) plot(reservoirDf) { - layout { - title = "Water Level" - subtitle = "Annual Water Level Fluctuations in Reservoir" - yAxisLabel = "Month" - xAxisLabel = "Water Level (meters)" + x(month) { + axis.name = "Month" + } + y.axis { + name = "Water Level (meters)" + limits = 3.0..8.0 } - - x(month) - y { axis.limits = 3.0..8.0 } line { y(waterLvl) } @@ -144,6 +144,11 @@ class Area : SampleHelper("area") { alpha = 0.5 fillColor = Color.RED } + + layout { + title = "Water Level" + subtitle = "Annual Water Level Fluctuations in Reservoir" + } } // SampleEnd .saveSample() @@ -164,15 +169,13 @@ class Area : SampleHelper("area") { ) plot(reservoirDf) { - layout { - title = "Water Level" - subtitle = "Annual Water Level Fluctuations in Reservoir" - yAxisLabel = "Month" - xAxisLabel = "Water Level (meters)" + x("month") { + axis.name = "Month" + } + y.axis { + name = "Water Level (meters)" + limits = 3.0..8.0 } - - x("month") - y { axis.limits = 3.0..8.0 } line { y("waterLvl") } @@ -182,6 +185,11 @@ class Area : SampleHelper("area") { alpha = 0.5 fillColor = Color.RED } + + layout { + title = "Water Level" + subtitle = "Annual Water Level Fluctuations in Reservoir" + } } // SampleEnd } diff --git a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/bars.kt b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/bars.kt index f46d9d93..7a33a138 100644 --- a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/bars.kt +++ b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/bars.kt @@ -12,6 +12,7 @@ import org.jetbrains.kotlinx.kandy.letsplot.layers.barsH import org.jetbrains.kotlinx.kandy.letsplot.scales.Transformation import org.jetbrains.kotlinx.kandy.letsplot.scales.categoricalColorHue import org.jetbrains.kotlinx.kandy.letsplot.x +import org.jetbrains.kotlinx.kandy.letsplot.y import org.jetbrains.kotlinx.kandy.util.color.Color import org.jetbrains.kotlinx.kandy.util.context.invoke import org.jetbrains.kotlinx.statistics.kandy.layers.histogram @@ -68,11 +69,6 @@ class Bars : SampleHelper("bars") { val sugar by columnOf(65, 58, 53, 35, 40, 45, 50) plot { - layout { - title = "Sugar content" - xAxisLabel = "Candy Name" - yAxisLabel = "Sugar Content (g per 100g)" - } bars { x(candy) y(sugar) { scale = continuous(0..100) } @@ -83,6 +79,11 @@ class Bars : SampleHelper("bars") { width = 1.3 } } + + x.axis.name = "Candy Name" + y.axis.name = "Sugar Content (g per 100g)" + + layout.title = "Sugar content" } // SampleEnd .saveSample() @@ -98,11 +99,6 @@ class Bars : SampleHelper("bars") { val sugar = listOf(65, 58, 53, 35, 40, 45, 50) plot { - layout { - title = "Sugar content" - xAxisLabel = "Candy Name" - yAxisLabel = "Sugar Content (g per 100g)" - } bars { x(candy) y(sugar) { scale = continuous(0..100) } @@ -113,6 +109,11 @@ class Bars : SampleHelper("bars") { width = 1.3 } } + + x.axis.name = "Candy Name" + y.axis.name = "Sugar Content (g per 100g)" + + layout.title = "Sugar content" } // SampleEnd } diff --git a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/errorBars.kt b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/errorBars.kt index a33c194d..a693aa08 100644 --- a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/errorBars.kt +++ b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/errorBars.kt @@ -12,6 +12,7 @@ import org.jetbrains.kotlinx.kandy.letsplot.layers.* import org.jetbrains.kotlinx.kandy.letsplot.samples.SampleHelper import org.jetbrains.kotlinx.kandy.letsplot.settings.Symbol import org.jetbrains.kotlinx.kandy.letsplot.x +import org.jetbrains.kotlinx.kandy.letsplot.y import org.jetbrains.kotlinx.kandy.util.color.Color import org.jetbrains.kotlinx.kandy.util.context.invoke import kotlin.test.Test @@ -190,11 +191,12 @@ class ErrorBars : SampleHelper("geoms", "guides") { position = posD } + x.axis.name = "Dose (mg)" + y.axis.name = "Tooth length (mm)" + layout { title = "The Effect of Vitamin C on Tooth Growth in Guinea Pigs" size = 700 to 400 - xAxisLabel = "Dose (mg)" - yAxisLabel = "Tooth length (mm)" style { legend { @@ -234,11 +236,11 @@ class ErrorBars : SampleHelper("geoms", "guides") { } } + x.axis.name = "Dose (mg)" + y.axis.name = "Tooth length (mm)" layout { size = 700 to 400 - xAxisLabel = "Dose (mg)" - yAxisLabel = "Tooth length (mm)" style { legend { @@ -268,11 +270,10 @@ class ErrorBars : SampleHelper("geoms", "guides") { position = Position.dodge(0.95) } - layout { - size = 700 to 400 - xAxisLabel = "Dose (mg)" - yAxisLabel = "Tooth length (mm)" - } + x.axis.name = "Dose (mg)" + y.axis.name = "Tooth length (mm)" + + layout.size = 700 to 400 } // SampleEnd .saveSample() @@ -299,11 +300,10 @@ class ErrorBars : SampleHelper("geoms", "guides") { position = posD } - layout { - size = 700 to 400 - xAxisLabel = "Dose (mg)" - yAxisLabel = "Tooth length (mm)" - } + x.axis.name = "Dose (mg)" + y.axis.name = "Tooth length (mm)" + + layout.size = 700 to 400 } // SampleEnd .saveSample() @@ -331,11 +331,10 @@ class ErrorBars : SampleHelper("geoms", "guides") { position = posD } - layout { - size = 700 to 400 - xAxisLabel = "Dose (mg)" - yAxisLabel = "Tooth length (mm)" - } + x.axis.name = "Dose (mg)" + y.axis.name = "Tooth length (mm)" + + layout.size = 700 to 400 } // SampleEnd .saveSample() @@ -370,11 +369,10 @@ class ErrorBars : SampleHelper("geoms", "guides") { position = posD } - layout { - size = 700 to 400 - xAxisLabel = "Dose (mg)" - yAxisLabel = "Tooth length (mm)" - } + x.axis.name = "Dose (mg)" + y.axis.name = "Tooth length (mm)" + + layout.size = 700 to 400 } // SampleEnd .saveSample() diff --git a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/labelFormat.kt b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/labelFormat.kt index 24d985f3..544eede7 100644 --- a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/labelFormat.kt +++ b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/labelFormat.kt @@ -169,9 +169,9 @@ class LabelFormat : SampleHelper("layout", "guides") { x.constant(LocalDate(2001, 1, 1).atStartOfDayIn(TimeZone.UTC).toEpochMilliseconds()) y.constant(unemploymentMean + 0.5) } + y.axis.name = "unemployment rate" layout { title = "The US Unemployment Rates 2000-2016." - yAxisLabel = "unemployment rate" size = 900 to 400 } } diff --git a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/legendAndAxis.kt b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/legendAndAxis.kt index fb8a47f6..de0a324b 100644 --- a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/legendAndAxis.kt +++ b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/legendAndAxis.kt @@ -185,6 +185,8 @@ class LegendAndAxis : SampleHelper("layout", "guides") { } } } + x.axis.name = "Engine displacement (L)" + y.axis.name = "Highway MPG" layout { size = 700 to 350 style { @@ -195,8 +197,6 @@ class LegendAndAxis : SampleHelper("layout", "guides") { direction = LegendDirection.HORIZONTAL } } - xAxisLabel = "Engine displacement (L)" - yAxisLabel = "Highway MPG" } } // SampleEnd diff --git a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/plotBunch.kt b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/plotBunch.kt index dc05c609..696f1c4b 100644 --- a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/plotBunch.kt +++ b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/guides/plotBunch.kt @@ -74,11 +74,7 @@ class PlotBunch : SampleHelper("multiplot", "guides") { color = Color.GREY alpha = .4 } - layout { - size = 600 to 200 - xAxisLabel = "x" - yAxisLabel = "y" - } + layout.size = 600 to 200 } // SampleEnd // .saveSample() @@ -93,10 +89,7 @@ class PlotBunch : SampleHelper("multiplot", "guides") { histogram(xs) { fillColor = Color.named("dark_magenta") } - layout { - size = 600 to 200 - xAxisLabel = "x" - } + layout.size = 600 to 200 } // SampleEnd // .saveSample() @@ -112,10 +105,7 @@ class PlotBunch : SampleHelper("multiplot", "guides") { x { scale = scaleX } fillColor = Color.named("dark_magenta") } - layout { - size = 600 to 200 - xAxisLabel = "x" - } + layout.size = 600 to 200 }, 0, 0) add(plot { points { @@ -124,11 +114,7 @@ class PlotBunch : SampleHelper("multiplot", "guides") { color = Color.GREY alpha = .4 } - layout { - size = 600 to 200 - xAxisLabel = "x" - yAxisLabel = "y" - } + layout.size = 600 to 200 }, 0, 200) } // SampleEnd @@ -167,7 +153,6 @@ class PlotBunch : SampleHelper("multiplot", "guides") { } layout { size = 600 to 200 - xAxisLabel = "x" style(upperStyle) } }, 0, 0) @@ -180,8 +165,6 @@ class PlotBunch : SampleHelper("multiplot", "guides") { } layout { size = 600 to 200 - xAxisLabel = "x" - yAxisLabel = "y" style(lowerStyle) } }, 0, 200) @@ -201,7 +184,6 @@ class PlotBunch : SampleHelper("multiplot", "guides") { } layout { size = 600 to 200 - xAxisLabel = "x" style(upperStyle) } }, 0, 0, 600, 100) @@ -214,8 +196,6 @@ class PlotBunch : SampleHelper("multiplot", "guides") { } layout { size = 600 to 200 - xAxisLabel = "x" - yAxisLabel = "y" style(lowerStyle) } }, 0, 100, 600, 300) diff --git a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/kdoc/layout.kt b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/kdoc/layout.kt index 7230a113..01528672 100644 --- a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/kdoc/layout.kt +++ b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/kdoc/layout.kt @@ -13,8 +13,6 @@ class LayoutTest : KandyLetsPlotJupyterTest() { layout { title = "Main Title" subtitle = "Subtitle" - xAxisLabel = "X-Axis" - yAxisLabel = "Y-Axis" style(Style.Grey) } } diff --git a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/lines.kt b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/lines.kt index e6bc34f8..9e9523d6 100644 --- a/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/lines.kt +++ b/kandy-lets-plot/src/test/kotlin/org/jetbrains/kotlinx/kandy/letsplot/samples/lines.kt @@ -499,20 +499,18 @@ class Lines : SampleHelper("line") { val temp = listOf(-45.5, -44.4, -40.0, -43.2, -41.5, -35.5, -39.9) plot { + path { + y(dist,"Performance Measure") + x(temp, "Temperature (°C)") + color = Color.BLUE + type = LineType.LONGDASH + } + layout { title = "Performance Dependency on Temperature" subtitle = "Analysis of Material Performance Decline at Extremely Low Temperatures" - yAxisLabel = "Performance Measure" size = 600 to 550 } - path { - y(dist) - x(temp) { - axis.name = "Temperature (°C)" - } - color = Color.BLUE - type = LineType.LONGDASH - } } // SampleEnd .apply { diff --git a/kandy-lets-plot/src/test/resources/jupyter/layout output in jupyter.out b/kandy-lets-plot/src/test/resources/jupyter/layout output in jupyter.out index 87a0dbe6..c2b96144 100644 --- a/kandy-lets-plot/src/test/resources/jupyter/layout output in jupyter.out +++ b/kandy-lets-plot/src/test/resources/jupyter/layout output in jupyter.out @@ -1 +1 @@ -{"output_type":"lets_plot_spec","output":{"ggtitle":{"text":"Main Title","subtitle":"Subtitle"},"mapping":{},"guides":{"x":{"title":"X-Axis"},"y":{"title":"Y-Axis"}},"data":{},"kind":"plot","scales":[{"aesthetic":"y","limits":[null,null]},{"aesthetic":"x","limits":[null,null]}],"layers":[{"mapping":{"x":"x"},"stat":"identity","data":{"x":[1.0,2.0,3.0]},"sampling":"none","y":5.0,"inherit_aes":false,"position":"identity","geom":"line","data_meta":{"series_annotations":[{"type":"int","column":"x"}]}}],"theme":{"name":"grey","axis_ontop":false,"axis_ontop_y":false,"axis_ontop_x":false}},"apply_color_scheme":true,"swing_enabled":true} \ No newline at end of file +{"output_type":"lets_plot_spec","output":{"ggtitle":{"text":"Main Title","subtitle":"Subtitle"},"mapping":{},"data":{},"kind":"plot","scales":[{"aesthetic":"y","limits":[null,null]},{"aesthetic":"x","limits":[null,null]}],"layers":[{"mapping":{"x":"x"},"stat":"identity","data":{"x":[1.0,2.0,3.0]},"sampling":"none","y":5.0,"inherit_aes":false,"position":"identity","geom":"line","data_meta":{"series_annotations":[{"type":"int","column":"x"}]}}],"theme":{"name":"grey","axis_ontop":false,"axis_ontop_y":false,"axis_ontop_x":false}},"apply_color_scheme":true,"swing_enabled":true} \ No newline at end of file