Skip to content

Commit 18b7b2b

Browse files
committed
plot curve for scatter
1 parent a93a994 commit 18b7b2b

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

test/pc_test.png

47 KB
Loading

test/princurve.R

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
require(ggplot);
22

3-
let n <- 200;
4-
let t <- seq(0, 4 * PI, length.out = n);
3+
data(UMAP3D);
54

6-
str(t);
7-
str(rnorm(n, sd = 0.1));
8-
str(cos(t));
9-
str(sin(t));
5+
UMAP3D[,"class"] = `number_${UMAP3D$class}`;
106

11-
let x <- (t + 1) * cos(t) + rnorm(n, sd = 0.1);
12-
let y <- (t + 1) * sin(t) + rnorm(n, sd = 0.1);
13-
let data <- data.frame(x = x, y = y);
7+
print(UMAP3D, max.print = 20);
148

15-
bitmap(file = relative_work("pc_test.png")) {
16-
ggplot(data, aes(x = "x", y = "y")) +
17-
geom_point(alpha = 0.6, color = "steelblue", size = 12) +
18-
geom_princurve(color = "red", size = 1) +
9+
bitmap(file = relative_work("pc_test.png"), size = []) {
10+
ggplot(UMAP3D, aes(x = "X", y = "Y",color = "class")) +
11+
geom_point(aes(color = "class"),alpha = 0.6, color = "paper", size = 24) +
12+
geom_princurve(color = "black", size = 1) +
1913
labs(title = "Scatter Plot with Principal Curve",
2014
x = "X", y = "Y")
2115
}

0 commit comments

Comments
 (0)