[education/rkward] rkward: multiple plots via layout(matrix()) added
Stefan Rödiger
null at kde.org
Tue Jul 12 12:27:34 BST 2022
Git commit 8e5e061a09b905cf162c9a16540c944fb8b81c06 by Stefan Rödiger.
Committed on 12/07/2022 at 11:26.
Pushed by srodiger into branch 'master'.
multiple plots via layout(matrix()) added
M +16 -1 rkward/RKWardR.xml
https://invent.kde.org/education/rkward/commit/8e5e061a09b905cf162c9a16540c944fb8b81c06
diff --git a/rkward/RKWardR.xml b/rkward/RKWardR.xml
index efb01316..78731144 100644
--- a/rkward/RKWardR.xml
+++ b/rkward/RKWardR.xml
@@ -131,7 +131,7 @@ if (condition) {
<match>Two plots (in row)</match>
<fillin># Two plots in a row
# style of axis labels changed
-par(mfrow=c(1,2), las = 1)
+par(mfrow = c(1, 2), las = 1)
# First plot (stripchart)
stripchart(rnorm(10), method = "jitter", main = "Stripchart")
@@ -140,6 +140,21 @@ mtext("A", cex = 1.2, side = 3, adj = 0, font = 2)
# Second plot (Histogram)
hist(rnorm(10), main = "Histogram")
mtext("B", cex = 1.2, side = 3, adj = 0, font = 2)
+</fillin>
+ </item>
+ <item>
+ <match>Plots (multiple in matrix layout)</match>
+ <fillin># Layout of three plots (1, 2, 3) in two rows and 3 columns
+layout(matrix(c(1, 2, 2, 3, 3, 3), nrow = 2, ncol = 3, byrow = TRUE))
+# Dummy histogram
+hist(rnorm(100))
+mtext("A", cex = 1.2, side = 3, adj = 0, font = 2)
+# Dummy stripchart
+stripchart(rlnorm(100), method = "jitter", xlab = "data")
+mtext("B", cex = 1.2, side = 3, adj = 0, font = 2)
+# Dummy barplot
+barplot(table(rpois(100, 10)), xlab = "data", ylab = "Frequency")
+mtext("C", cex = 1.2, side = 3, adj = 0, font = 2)
</fillin>
</item>
</snippets>
More information about the rkward-tracker
mailing list