Last active
October 4, 2019 21:53
-
-
Save ianmcook/c1bc8b3056c332f5eac3f456c57a6228 to your computer and use it in GitHub Desktop.
Scatterplot of chess piece dimensions with ggplot2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
piece | base_diameter | height | weight | |
---|---|---|---|---|
King | 37.3086 | 95.1557 | 50.2774 | |
King | 36.9878 | 95.3598 | 51.5528 | |
King | 37.6846 | 94.8507 | 50.7298 | |
King | 37.4201 | 96.2158 | 50.9344 | |
King | 36.7413 | 95.5326 | 51.9347 | |
King | 36.8166 | 96.0273 | 51.2393 | |
King | 37.5822 | 95.8491 | 50.8103 | |
King | 37.4132 | 95.2667 | 52.2267 | |
King | 37.7643 | 94.9941 | 51.2417 | |
King | 37.2461 | 95.4200 | 50.9716 | |
King | 37.4344 | 97.1294 | 52.3607 | |
King | 36.9434 | 93.8589 | 51.1943 | |
King | 37.4048 | 96.7069 | 50.9785 | |
King | 37.8884 | 96.1395 | 50.8816 | |
King | 37.4015 | 94.6402 | 50.7653 | |
King | 37.4268 | 96.3111 | 50.3909 | |
King | 37.6895 | 95.7078 | 50.2131 | |
King | 37.3815 | 94.0310 | 51.8549 | |
King | 37.8020 | 96.0005 | 50.9162 | |
King | 37.6016 | 95.6542 | 51.8100 | |
King | 37.3815 | 95.6499 | 50.9471 | |
King | 36.8940 | 94.6389 | 50.4165 | |
King | 37.4065 | 94.0439 | 51.6604 | |
King | 36.9291 | 94.7226 | 50.8416 | |
King | 37.7682 | 94.4029 | 50.8569 | |
Queen | 35.8629 | 76.3029 | 45.7800 | |
Queen | 35.8345 | 75.2892 | 47.3362 | |
Queen | 35.8631 | 76.1590 | 45.8920 | |
Queen | 35.8222 | 74.7224 | 45.2095 | |
Queen | 35.9691 | 74.5851 | 46.1361 | |
Queen | 35.2977 | 74.8686 | 45.8440 | |
Queen | 35.7311 | 75.9475 | 44.4421 | |
Queen | 35.5110 | 76.0641 | 45.5206 | |
Queen | 35.8699 | 75.1956 | 46.0214 | |
Queen | 35.0244 | 75.4776 | 45.4221 | |
Queen | 36.4899 | 75.4992 | 45.5540 | |
Queen | 36.0746 | 75.4542 | 45.9781 | |
Queen | 36.5911 | 76.1020 | 44.9619 | |
Queen | 35.8789 | 74.8580 | 46.3530 | |
Queen | 35.5830 | 75.4047 | 46.9881 | |
Queen | 35.8397 | 76.3987 | 46.0809 | |
Queen | 36.2540 | 76.5951 | 46.5779 | |
Queen | 35.7046 | 76.3877 | 46.9212 | |
Queen | 35.4220 | 76.1318 | 45.9727 | |
Queen | 35.8065 | 75.6346 | 46.3266 | |
Queen | 36.0403 | 76.7191 | 45.3716 | |
Queen | 35.2052 | 74.3777 | 46.5902 | |
Queen | 36.4166 | 75.2862 | 45.0690 | |
Queen | 36.0471 | 75.6503 | 45.7715 | |
Queen | 35.8568 | 76.2716 | 45.9018 | |
Rook | 32.2037 | 47.2608 | 34.0058 | |
Rook | 31.9197 | 45.1839 | 34.2527 | |
Rook | 32.1491 | 46.2395 | 33.9424 | |
Rook | 31.7004 | 46.1397 | 33.0111 | |
Rook | 31.8765 | 44.8300 | 33.9747 | |
Rook | 32.1329 | 46.2257 | 34.3892 | |
Rook | 32.5177 | 45.9880 | 33.6160 | |
Rook | 31.3183 | 45.5618 | 33.4482 | |
Rook | 31.2116 | 45.9084 | 33.6970 | |
Rook | 32.0104 | 46.2614 | 34.4193 | |
Rook | 31.4455 | 46.0121 | 34.2943 | |
Rook | 31.7083 | 47.0618 | 33.4659 | |
Rook | 32.5084 | 46.3037 | 33.8439 | |
Rook | 32.4234 | 46.8890 | 33.6450 | |
Rook | 31.4266 | 46.3357 | 34.0659 | |
Rook | 32.0692 | 45.8670 | 33.6803 | |
Rook | 31.7027 | 47.8052 | 34.1552 | |
Rook | 32.1988 | 45.8455 | 34.2147 | |
Rook | 32.5180 | 46.2426 | 34.5267 | |
Rook | 32.5484 | 46.9968 | 33.7647 | |
Rook | 31.6552 | 46.5581 | 34.5801 | |
Rook | 31.9268 | 46.2829 | 34.6175 | |
Rook | 32.0675 | 46.3236 | 34.1947 | |
Rook | 31.5868 | 46.6635 | 34.7982 | |
Rook | 31.9595 | 48.2096 | 35.2367 | |
Bishop | 30.2658 | 65.3323 | 26.8124 | |
Bishop | 32.0520 | 64.7959 | 27.0373 | |
Bishop | 31.6701 | 64.5322 | 27.0980 | |
Bishop | 30.6711 | 64.6314 | 27.8302 | |
Bishop | 30.6829 | 65.3082 | 27.6825 | |
Bishop | 31.0658 | 64.6882 | 27.3469 | |
Bishop | 30.9337 | 64.1629 | 26.4100 | |
Bishop | 31.3043 | 64.3458 | 27.0750 | |
Bishop | 31.3505 | 65.2360 | 27.1992 | |
Bishop | 30.9288 | 64.8947 | 26.9156 | |
Bishop | 31.2702 | 65.8148 | 27.1698 | |
Bishop | 30.7978 | 64.7075 | 26.6869 | |
Bishop | 31.1055 | 64.9461 | 26.9204 | |
Bishop | 30.7376 | 65.6398 | 26.4850 | |
Bishop | 31.3872 | 64.4818 | 26.5822 | |
Bishop | 30.0104 | 65.5059 | 27.3970 | |
Bishop | 30.3971 | 66.1954 | 27.3776 | |
Bishop | 31.1542 | 65.8326 | 27.2824 | |
Bishop | 30.6190 | 65.9074 | 26.7858 | |
Bishop | 30.4475 | 64.8867 | 27.4648 | |
Bishop | 31.1822 | 65.7687 | 26.6652 | |
Bishop | 31.4982 | 65.0529 | 26.7099 | |
Bishop | 31.1347 | 64.9250 | 27.1480 | |
Bishop | 31.4947 | 66.2382 | 27.2251 | |
Bishop | 31.5532 | 64.5412 | 27.2773 | |
Knight | 32.6611 | 58.0986 | 35.5057 | |
Knight | 32.5660 | 59.2883 | 35.2110 | |
Knight | 32.6976 | 57.6555 | 35.0356 | |
Knight | 32.4517 | 57.6763 | 35.2506 | |
Knight | 32.3385 | 58.0583 | 36.6659 | |
Knight | 32.0971 | 58.4582 | 35.8318 | |
Knight | 32.5988 | 57.8299 | 36.3004 | |
Knight | 32.5194 | 57.7490 | 35.9630 | |
Knight | 32.7964 | 57.5125 | 35.5670 | |
Knight | 32.5113 | 57.3929 | 36.6844 | |
Knight | 33.1492 | 57.0154 | 35.8534 | |
Knight | 32.6714 | 58.6347 | 35.5556 | |
Knight | 33.7670 | 57.6750 | 37.0703 | |
Knight | 33.5817 | 60.2205 | 35.7332 | |
Knight | 32.2639 | 58.0509 | 36.1949 | |
Knight | 33.2228 | 58.2421 | 36.4933 | |
Knight | 33.1013 | 57.2060 | 36.1741 | |
Knight | 32.5706 | 58.0272 | 35.7569 | |
Knight | 32.6066 | 58.5386 | 35.8060 | |
Knight | 32.6001 | 58.2399 | 36.0825 | |
Knight | 32.5609 | 58.7188 | 36.6064 | |
Knight | 32.5246 | 58.0515 | 36.2904 | |
Knight | 32.8170 | 59.4493 | 36.7869 | |
Knight | 32.4293 | 59.1107 | 36.1332 | |
Knight | 32.9216 | 57.2684 | 36.5649 | |
Pawn | 26.9624 | 45.8563 | 16.1868 | |
Pawn | 26.6241 | 45.5850 | 15.9781 | |
Pawn | 26.8643 | 45.6050 | 16.0608 | |
Pawn | 26.9732 | 45.4377 | 15.5221 | |
Pawn | 27.0854 | 45.7236 | 15.9738 | |
Pawn | 26.8645 | 45.8514 | 15.9394 | |
Pawn | 27.0910 | 46.3200 | 16.0703 | |
Pawn | 26.5115 | 45.1574 | 16.0753 | |
Pawn | 27.1175 | 45.5251 | 15.8799 | |
Pawn | 27.2141 | 44.5999 | 16.3686 | |
Pawn | 27.3890 | 45.2089 | 15.8706 | |
Pawn | 27.1482 | 45.8694 | 15.9371 | |
Pawn | 27.8217 | 45.9068 | 15.9974 | |
Pawn | 27.5727 | 45.4199 | 15.8584 | |
Pawn | 27.4874 | 45.6715 | 15.6288 | |
Pawn | 27.6523 | 45.4405 | 16.2926 | |
Pawn | 26.9195 | 45.3629 | 15.8346 | |
Pawn | 27.6798 | 46.1202 | 15.9396 | |
Pawn | 27.2590 | 45.4617 | 15.9495 | |
Pawn | 27.0574 | 44.9810 | 15.9700 | |
Pawn | 27.8047 | 46.3819 | 15.6441 | |
Pawn | 27.0347 | 45.2988 | 15.9724 | |
Pawn | 26.9718 | 46.0306 | 15.6924 | |
Pawn | 27.7476 | 45.4953 | 16.2108 | |
Pawn | 27.1112 | 45.7127 | 16.1226 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(readr) | |
library(ggplot2) | |
chess <- read_csv("one_chess_set.csv") | |
pieces <- c("King", "Queen", "Rook", "Bishop", "Knight", "Pawn") | |
white_shapes <- c("♔", "♕", "♖", "♗", "♘", "♙") | |
black_shapes <- c("♚", "♛", "♜", "♝", "♞", "♟") | |
shapes <- black_shapes | |
chess$shape <- as.character(NA) | |
for(i in 1:6) { | |
chess[chess$piece == pieces[i], "shape"] <- shapes[i] | |
} | |
chess$piece <- factor( | |
chess$piece, | |
levels = pieces | |
) | |
myplot <- ggplot(data = chess, aes(x = height, y = weight)) + | |
geom_point(shape = chess$shape, size = 7, aes(color = piece)) + | |
theme(legend.title=element_blank()) + | |
guides(colour = guide_legend(override.aes = list(size = 7, shape = shapes))) + | |
xlab("Height (mm)") + ylab("Weight (g)") + | |
ggtitle("Staunton chess pieces") | |
ggsave("chess.svg", plot = myplot, device = "svg", width = 6, height = 6, units = "in") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment