Skip to content

Axis label remove dupl #478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/images/samples/area/area_fixed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/images/samples/area/area_fixed_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 44 additions & 80 deletions docs/images/samples/bars/bar_settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 44 additions & 80 deletions docs/images/samples/bars/bar_settings_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 21 additions & 24 deletions docs/topics/guides/ErrorBars-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
```

Expand Down Expand Up @@ -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
}
```

Expand Down Expand Up @@ -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
}
```

Expand Down Expand Up @@ -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
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/topics/guides/Formatting-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
4 changes: 2 additions & 2 deletions docs/topics/guides/Legend-and-Axis-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ mpgDf.plot {
}
}
}
x.axis.name = "Engine displacement (L)"
y.axis.name = "Highway MPG"
layout {
size = 700 to 350
style {
Expand All @@ -204,8 +206,6 @@ mpgDf.plot {
direction = LegendDirection.HORIZONTAL
}
}
xAxisLabel = "Engine displacement (L)"
yAxisLabel = "Highway MPG"
}
}
```
Expand Down
28 changes: 4 additions & 24 deletions docs/topics/guides/Plot-Bunch-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ plot {
color = Color.GREY
alpha = .4
}
layout {
size = 600 to 200
xAxisLabel = "x"
yAxisLabel = "y"
}
layout.size = 600 to 200
}
```

Expand All @@ -69,10 +65,7 @@ plot {
histogram(xs) {
fillColor = Color.named("dark_magenta")
}
layout {
size = 600 to 200
xAxisLabel = "x"
}
layout.size = 600 to 200
}
```

Expand All @@ -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 {
Expand All @@ -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)
}
```
Expand Down Expand Up @@ -151,7 +137,6 @@ plotBunch {
}
layout {
size = 600 to 200
xAxisLabel = "x"
style(upperStyle)
}
}, 0, 0)
Expand All @@ -164,8 +149,6 @@ plotBunch {
}
layout {
size = 600 to 200
xAxisLabel = "x"
yAxisLabel = "y"
style(lowerStyle)
}
}, 0, 200)
Expand Down Expand Up @@ -193,7 +176,6 @@ plotBunch {
}
layout {
size = 600 to 200
xAxisLabel = "x"
style(upperStyle)
}
}, 0, 0, 600, 100)
Expand All @@ -206,8 +188,6 @@ plotBunch {
}
layout {
size = 600 to 200
xAxisLabel = "x"
yAxisLabel = "y"
style(lowerStyle)
}
}, 0, 100, 600, 300)
Expand Down
6 changes: 4 additions & 2 deletions docs/topics/samples/area/Area-Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ val time = column<String>("time")
val load = column<Int>("load")

loadServer.plot {
layout.title = "Daily Server Load Dynamics"
area {
x(time) { axis.name = "Time" }
y(load) {
Expand All @@ -45,6 +44,8 @@ loadServer.plot {
fillColor = Color.RED
alpha = 0.7
}

layout.title = "Daily Server Load Dynamics"
}
```

Expand All @@ -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 (%)" }
Expand All @@ -68,6 +68,8 @@ plot {
fillColor = Color.RED
alpha = 0.7
}

layout.title = "Daily Server Load Dynamics"
}
```

Expand Down
38 changes: 22 additions & 16 deletions docs/topics/samples/area/Fixed-Area-Coordinate.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -52,6 +50,11 @@ plot(reservoirDf) {
alpha = 0.5
fillColor = Color.RED
}

layout {
title = "Water Level"
subtitle = "Annual Water Level Fluctuations in Reservoir"
}
}
```

Expand All @@ -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")
}
Expand All @@ -89,6 +90,11 @@ plot(reservoirDf) {
alpha = 0.5
fillColor = Color.RED
}

layout {
title = "Water Level"
subtitle = "Annual Water Level Fluctuations in Reservoir"
}
}
```

Expand Down
20 changes: 10 additions & 10 deletions docs/topics/samples/bars/Bar-Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand All @@ -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"
}
```

Expand All @@ -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) }
Expand All @@ -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"
}
```

Expand Down
Loading