Carter
10/24/2022, 5:12 PMCarter
10/24/2022, 5:15 PMaltavir
10/24/2022, 7:04 PMCarter
10/24/2022, 7:04 PMAndrei Kislitsyn
10/24/2022, 7:13 PMfacetGrid
with the parameterization of the freeScales
parameter could help you!altavir
10/24/2022, 7:21 PMCarter
10/24/2022, 7:22 PMAndrei Kislitsyn
10/24/2022, 7:38 PMscaleYLog10
Igor Alshannikov
10/24/2022, 7:39 PMIgor Alshannikov
10/24/2022, 7:42 PMAndrei Kislitsyn
10/24/2022, 7:42 PMIgor Alshannikov
10/24/2022, 7:43 PMCarter
10/24/2022, 8:00 PMIgor Alshannikov
10/25/2022, 4:13 PMgeomLine
layer and use position = positionStack
on that layer to stack one line ontop of another.Carter
10/26/2022, 1:09 PMposition = positionStack
approach? I’m not sure I totally follow.
I tried GGBunch with transparency but either I configured it incorrectly or I did something wrong. I got a graph with just a single line representing the first graph but with a different color background
For the second plot, I added
+ themeMinimal2() + theme(plotBackground = elementRect(fill=Color.TRANSPARENT, color = Color.TRANSPARENT))
Igor Alshannikov
10/26/2022, 11:22 PMval line1 = listOf(1.0, 1.2, 0.9)
val line2 = line1.map { it + 10000}
val line = line2 + line1 // <-- important: line2 goes 1st, line1 - 2nd
val dat = mapOf(
"y" to line,
"x" to List(line2.size) { it } + List(line1.size) { it },
"c" to List(line2.size) { "line 2" } + List(line1.size) { "line 1" }
)
Now, if we simply create a line plot, the result is not useful:
letsPlot(dat) + geomLine {
x = "x"
y = "y"
color = "c"
}
Igor Alshannikov
10/26/2022, 11:23 PMletsPlot(dat) + geomLine(position = positionStack) {
x = "x"
y = "y"
color = "c"
}
Igor Alshannikov
10/26/2022, 11:44 PMval dat2 = mapOf(
"line1" to line1,
"line2" to line2,
"x" to List(line2.size) { it },
)
val bunch = GGBunch()
val t = theme(plotBackground = elementRect(fill = "rgba(0,0,0,0)"))
bunch.addPlot(letsPlot(dat2) + geomLine(color = "red") {x = "x"; y = "line1"}, 0, 0)
bunch.addPlot(letsPlot(dat2) + geomLine(color = "blue") {x = "x"; y = "line2"} + t, 0, 0)
Igor Alshannikov
10/26/2022, 11:55 PMletsPlot(dat) + geomLine {
x = "x"
y = "y"
color = "c"
} + facetGrid(y="c", scales="free_y") + ggsize(600, 200)
altavir
10/27/2022, 8:14 PM